Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copying a file inside a localStorage sometimes exit with 500 #747

Open
1 task done
kiranparajuli589 opened this issue Jul 20, 2022 · 0 comments
Open
1 task done
Labels

Comments

@kiranparajuli589
Copy link
Contributor

kiranparajuli589 commented Jul 20, 2022

Description

The setup for this issue needs the following connected together:

  • latest oc10
  • encryption app with UserSpecific keys enabled
  • user_ldap as authentication backend
  • PHP version 7.3

Steps to reproduce:

The issue can be reproduced with this drone yml: https://gist.github.com/kiranparajuli589/f0eb9bcbf4da9043fab7b1804d31a27d

  1. download the drone yml from the above gist on your local machine
  2. install the Drone CLI in your host machine if not already installed
  3. install Docker & DockerCompose in your host machine if not already installed
  4. execute the drone pipeline on your machine as
    drone exec --pipeline core-apiAll-e-UK-latest-mysql8.0-php7.3 /path/to/yml

Server Log

Following log is seen in the oC10 log file at the moment of failure:

[owncloud-log-server:13] {"reqId":"Rb6X6luF8PtjaKSLWEZB","level":3,"time":"2022-07-20T06:52:25+00:00","remoteAddr":"172.19.0.6","user":"Alice","app":"PHP","method":"COPY","url":"\/remote.php\/webdav\/textfile0.txt","message":"fclose() expects parameter 1 to be resource, string given at \/var\/www\/owncloud\/server\/lib\/private\/Files\/Storage\/Wrapper\/Encryption.php#818"}
[owncloud-log-server:14] {"reqId":"Rb6X6luF8PtjaKSLWEZB","level":4,"time":"2022-07-20T06:52:25+00:00","remoteAddr":"172.19.0.6","user":"Alice","app":"webdav","method":"COPY","url":"\/remote.php\/webdav\/textfile0.txt","message":"Exception: multikeydecrypt with share key failed:error:04065072:rsa routines:rsa_ossl_private_decrypt:padding check failed: {\"Exception\":\"OCA\\\\Encryption\\\\Exceptions\\\\MultiKeyDecryptException\",\"Message\":\"multikeydecrypt with share key failed:error:04065072:rsa routines:rsa_ossl_private_decrypt:padding check failed\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/server\\\/apps\\\/encryption\\\/lib\\\/KeyManager.php(434): OCA\\\\Encryption\\\\Crypto\\\\Crypt->multiKeyDecrypt('[\\\\xF07I\\\\x90X@\\\\xAC\\\\\\\\~\\\/W\\\\xA1p\\\\x1C...', 'U\\\\x18\\\\xE0\\\\x8E\\\\x13\\\\xD0\\\\x8A{\\\\xE7\\\\x06qe\\\\xDA\\\\xBF\\\\x99...', '-----BEGIN PRIV...')\\n#1 \\\/var\\\/www\\\/owncloud\\\/server\\\/apps\\\/encryption\\\/lib\\\/Crypto\\\/Encryption.php(195): OCA\\\\Encryption\\\\KeyManager->getFileKey('\\\/Alice\\\/files\\\/lo...', 'Alice')\\n#2 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/Stream\\\/Encryption.php(262): OCA\\\\Encryption\\\\Crypto\\\\Encryption->begin('\\\/Alice\\\/files\\\/lo...', 'Alice', 'w', Array, Array, NULL)\\n#3 [internal function]: OC\\\\Files\\\\Stream\\\\Encryption->stream_open('ocencryption:\\\/\\\/', 'w', 0, NULL)\\n#4 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/Stream\\\/Encryption.php(204): fopen('ocencryption:\\\/\\\/', 'w', false, Resource id #61)\\n#5 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/Stream\\\/Encryption.php(186): OC\\\\Files\\\\Stream\\\\Encryption::wrapSource(Resource id #60, Resource id #61, 'ocencryption', 'OC\\\\\\\\Files\\\\\\\\Stream...', 'w')\\n#6 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Encryption.php(479): OC\\\\Files\\\\Stream\\\\Encryption::wrap(Resource id #60, 'foo1\\\/textfile0....', '\\\/Alice\\\/files\\\/lo...', Array, 'Alice', Object(OCA\\\\Encryption\\\\Crypto\\\\Encryption), Object(OC\\\\Files\\\\Storage\\\\Local), Object(OC\\\\Files\\\\Storage\\\\Wrapper\\\\Encryption), Object(OC\\\\Encryption\\\\Util), Object(OC\\\\Encryption\\\\File), 'w', 0, 0, 0, true, NULL)\\n#7 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Encryption.php(811): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Encryption->fopen('foo1\\\/textfile0....', 'w')\\n#8 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Encryption.php(686): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Encryption->copyBetweenStorage(Object(OCA\\\\Files_Trashbin\\\\Storage), 'files\\\/textfile0...', 'foo1\\\/textfile0....', false, false)\\n#9 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(565): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Encryption->copyFromStorage(Object(OCA\\\\Files_Trashbin\\\\Storage), 'files\\\/textfile0...', 'foo1\\\/textfile0....')\\n#10 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(565): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->copyFromStorage(Object(OCA\\\\Files_Trashbin\\\\Storage), 'files\\\/textfile0...', 'foo1\\\/textfile0....')\\n#11 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/View.php(991): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->copyFromStorage(Object(OCA\\\\Files_Trashbin\\\\Storage), 'files\\\/textfile0...', 'foo1\\\/textfile0....')\\n#12 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/public\\\/Events\\\/EventEmitterTrait.php(50): OC\\\\Files\\\\View->OC\\\\Files\\\\{closure}(*** sensitive parameters replaced ***)\\n#13 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/private\\\/Files\\\/View.php(1032): OC\\\\Files\\\\View->emittingCall(Object(Closure), Array, 'file', 'copy')\\n#14 \\\/var\\\/www\\\/owncloud\\\/server\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ObjectTree.php(249): OC\\\\Files\\\\View->copy('textfile0.txt', 'local_storage\\\/f...')\\n#15 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(659): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->copy('textfile0.txt', 'local_storage\\\/f...')\\n#16 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpCopy(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#17 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(472): Sabre\\\\DAV\\\\Server->emit('method:COPY', Array)\\n#18 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(253): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#19 \\\/var\\\/www\\\/owncloud\\\/server\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(321): Sabre\\\\DAV\\\\Server->start()\\n#20 \\\/var\\\/www\\\/owncloud\\\/server\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(67): Sabre\\\\DAV\\\\Server->exec()\\n#21 \\\/var\\\/www\\\/owncloud\\\/server\\\/remote.php(165): require_once('\\\/var\\\/www\\\/ownclo...')\\n#22 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/server\\\/apps\\\/encryption\\\/lib\\\/Crypto\\\/Crypt.php\",\"Line\":702}"}

Fails sometimes only:

With this drone YAML, I've used a core branch check-user-ldap-746 where the Scenario failing because of this is duplicated 5 times. Here, the first scenario always passes and the rest always fails.

I've checked if there is some uncleared state for the next scenarios, but the created local_storage and external_storages are properly cleared. That's why we can create the user and localStorage again in the next scenarios without any errors. The next scenarios then break on COPY request with 500 response code

P.S. In the encryption app, the core API tests are not run with UserKey encryption, only runs with MasterKey encryption.

Open Tasks

Originally posted by @kiranparajuli589 in #746 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant