Repository navigation
OC\Files\Stream\Encryption::loadContext($name) should be compatible with Icewind\Streams\Wrapper::loadContext #26464
Copy link
Copy link
Closed
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmapbug
Description
Getting the followung error once updated to NC 20.0.9 everytime i open a file or scroll throw the photos app or files
Nextcloud Error 1 (data/nextcloud.log)
Error: Declaration of OC\Files\Stream\Encryption::wrapSource($source, $context, $protocol, $class, $mode = 'r+') should be compatible with Icewind\Streams\WrapperHandler::wrapSource($source, $context = Array, $protocol = NULL, $class = NULL) at /var/www/nextcloud/lib/private/Files/Stream/Encryption.php#201
{"reqId":"UTnfI0uqU071I3r5FXI7","level":3,"time":"2021-04-08T16:21:26+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/apps/onlyoffice/download?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJkb3dubG9hZCIsImZpbGVJZCI6Mzk4OTkzLCJ1c2VySWQiOiJheGhlbGkifQ.A1eXyrt0TLUYfhhEhgdru1bEGfnBESxs55v62iMM--0","message":{"Exception":"Error","Message":"Declaration of OC\\Files\\Stream\\Encryption::wrapSource($source, $context, $protocol, $class, $mode = 'r+') should be compatible with Icewind\\Streams\\WrapperHandler::wrapSource($source, $context = Array, $protocol = NULL, $class = NULL) at /var/www/nextcloud/lib/private/Files/Stream/Encryption.php#201","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Stream/Encryption.php","line":38,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/lib/composer/composer/ClassLoader.php","line":444,"args":["/var/www/nextcloud/lib/private/Files/Stream/Encryption.php"],"function":"include"},{"file":"/var/www/nextcloud/lib/composer/composer/ClassLoader.php","line":322,"function":"Composer\\Autoload\\includeFile"},{"function":"loadClass","class":"Composer\\Autoload\\ClassLoader","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":469,"function":"spl_autoload_call"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":218,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":246,"function":"file_get_contents","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1167,"function":"file_get_contents","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":597,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/File.php","line":57,"function":"file_get_contents","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/onlyoffice/controller/callbackcontroller.php","line":295,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"download","class":"OCA\\Onlyoffice\\Controller\\CallbackController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Node.js/6.13","version":"20.0.9.1","id":"606f2e1fb6e10"}
Nextcloud Error 2 (data/nextcloud.log)
Error: Declaration of OC\Files\Stream\Encryption::loadContext($name) should be compatible with Icewind\Streams\Wrapper::loadContext($name = NULL) at /var/www/nextcloud/lib/private/Files/Stream/Encryption.php#224 --
{"reqId":"UTnfI0uqU071I3r5FXI7","level":3,"time":"2021-04-08T16:21:26+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/apps/onlyoffice/download?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJkb3dubG9hZCIsImZpbGVJZCI6Mzk4OTkzLCJ1c2VySWQiOiJheGhlbGkifQ.A1eXyrt0TLUYfhhEhgdru1bEGfnBESxs55v62iMM--0","message":{"Exception":"Error","Message":"Declaration of OC\\Files\\Stream\\Encryption::loadContext($name) should be compatible with Icewind\\Streams\\Wrapper::loadContext($name = NULL) at /var/www/nextcloud/lib/private/Files/Stream/Encryption.php#224","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Stream/Encryption.php","line":38,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/lib/composer/composer/ClassLoader.php","line":444,"args":["/var/www/nextcloud/lib/private/Files/Stream/Encryption.php"],"function":"include"},{"file":"/var/www/nextcloud/lib/composer/composer/ClassLoader.php","line":322,"function":"Composer\\Autoload\\includeFile"},{"function":"loadClass","class":"Composer\\Autoload\\ClassLoader","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":469,"function":"spl_autoload_call"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":218,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":246,"function":"file_get_contents","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1167,"function":"file_get_contents","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":597,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/File.php","line":57,"function":"file_get_contents","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/onlyoffice/controller/callbackcontroller.php","line":295,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"download","class":"OCA\\Onlyoffice\\Controller\\CallbackController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Node.js/6.13","version":"20.0.9.1","id":"606f2e1fb6eb0"}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmapbug
Activity
AndyXheli commentedon Apr 8, 2021
vitormattos commentedon Apr 8, 2021
The problem is that the method of the
Encryptionclass has a different signature (arguments) than the arguments of the same methodwrapSourcein the parent classesWrapperandWrapperHandler.[-]Nextcloud 20.0.9 OC\Files\Stream\Encryption::loadContext($name) should be compatible with Icewind\Streams\Wrapper::loadContext($name = NULL) at /var/www/nextcloud/lib/private/Files/Stream/Encryption.php#224[/-][+]Nextcloud 20.0.9 & Nextcloud 21.0.1 OC\Files\Stream\Encryption::loadContext($name) should be compatible with Icewind\Streams\Wrapper::loadContext($name = NULL) at /var/www/nextcloud/lib/private/Files/Stream/Encryption.php#224[/+]AndyXheli commentedon Apr 9, 2021
This also seems to happen on Nextcloud 21.0.1
Zaxooy commentedon Apr 11, 2021
@jknockaert You asked in #24966 to get tagged for this. 🙂
[-]Nextcloud 20.0.9 & Nextcloud 21.0.1 OC\Files\Stream\Encryption::loadContext($name) should be compatible with Icewind\Streams\Wrapper::loadContext($name = NULL) at /var/www/nextcloud/lib/private/Files/Stream/Encryption.php#224[/-][+]OC\Files\Stream\Encryption::loadContext($name) should be compatible with Icewind\Streams\Wrapper::loadContext[/+]jknockaert commentedon Apr 13, 2021
@axheli Error 3 is a duplicate of #26473
AndyXheli commentedon Apr 16, 2021
@jknockaert did you have anytime to look into this :)
jknockaert commentedon Apr 16, 2021
Yes. Error 3 is a duplicate of #26473. For the other two errors I can't yet make sense of it. I'd rather first have a better understanding of what we see happening in some other recent errors which may be wrapper related.
AndyXheli commentedon Apr 16, 2021
Thank you! @jknockaert is there anything you need on my end ? more logs ?
jknockaert commentedon Apr 16, 2021
Are you actually using SMB storage for your files?
AndyXheli commentedon Apr 16, 2021
Nope everything is local i dont use SMB storage
jknockaert commentedon Apr 16, 2021
OK let's keep this one open for now.
AndyXheli commentedon Apr 16, 2021
Okay sounds good!
jknockaert commentedon Apr 19, 2021
@AndyXheli Today I decided to switch off encryption on my NC server, so I will no longer investigate any issues relating to its sloppy implementation.
AndyXheli commentedon Apr 19, 2021
AndyXheli commentedon Apr 23, 2021
@vitormattos anyway you could help with this please? :)
appzer0 commentedon May 17, 2021
This issue is referenced as solution on NC's forum, though:
I upgraded to NC 21.0.2 RC1 and the upload fails are still there:
AndyXheli commentedon May 20, 2021
Still an issue on Nextcloud 20.0.10
AndyXheli commentedon May 21, 2021
@juliushaertl @rullzer im really sorry to bother you I was just wondering do you have any feedback on this?
juliusknorr commentedon May 25, 2021
Pushed a fix to icewind1991/Streams#15
koelmel commentedon May 25, 2021
I believe, that the base problem is that different Icewind/Streams implementations are available under ./3rdparty/icewind and ./apps/files_external/3rdparty/icewind, as i see in my 20.0.9 installation. In my former nextcloud version 19.0.9 the files under the 2 paths were equal (for nextcloud 19.0.9 with files_external app version 1.10.0)
If the files_external app (in version 1.11.1 on 20.0.x) is activated, there are conflicts between both and the ClassLoader seems to take the last one, which requires because of the derivation from the WrapperHandler class that the Wrapper class has the wrapSource function without mode argument.
Nethertheless the adaptation of the WrapperHandler class should work, but @AndyXheli has also found the problem that there are 2 paths which are providing the WrapperHandler class (icewind1991/Streams#15 (comment)).
koelmel commentedon May 27, 2021
This is another problem. I have seen this also on a 20.0.10 version during file upload, but the files are ok afterwards.
I don't know why the array does not contain the key 'encryptedVersion', but a simple check could be a workround:
Instead
the following code does a check after the key
AndyXheli commentedon May 28, 2021
icewind1991/Streams#15 dose fix the issue on NC 21 but not on NC 20.0.10. For more info please see icewind1991/Streams#15
koelmel commentedon May 28, 2021
the correct solution should be to clarify, which Icewind/Streams implementations either ./3rdparty/icewind/streams or ./apps/files_external/3rdparty/icewind/streams should be used. Different classes with the same namespaces should be avoided. Until the 20er version (i don't know which minor version has changed this) both Icewind/Streams paths are providing the same version.
I can confirm that deactivating the files_external app is a workaround for those who don't need this app.
talesam commentedon Jun 27, 2021
I have version 21.0.2.1 stable and I have the same error.
Error: Undefined index: encryptedVersion at /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php#669
AndyXheli commentedon Jul 3, 2021
Issue fixed in 21.0.3