files_primary_s3 icon indicating copy to clipboard operation
files_primary_s3 copied to clipboard

[QA] moving files across storages fails

Open jnweiger opened this issue 3 years ago • 2 comments

Seen while testing files_primary_s3-1.3.0 on 10.11

  • set up a server with files_primary_s3 and a scality cloudserver as primary storage.
  • mount an external SFTP storage, add a text file there.
  • move the text file out of the SFTP storage into the top level folder.
  • try move the text file back into the SFTP storage. it always fails. BAD. image

  • moving into and out of folders in the primary storage works fine.
  • moving a file that was created in the primary storage into the SFTP mount also works fine.
  • a text file created in an s3 external storage also can be moved out, but not moved back.

Expected behaviour

  • moving files around should work in any case

The server log produces this when the move fails:

{"reqId":"YwlOnqTK0qK1yBWmNkU4NgAAAAU","level":3,"time":"2022-08-26T22:52:15+00:00","remoteAddr":"84.180.181.57","user":"admin","app":"PHP","method":"MOVE","url":"\/ remote.php\/dav\/files\/admin\/hello.txt","message":"Error executing \"GetObject\" on \"http:\/\/localhost:8000\/oc-primary\/urn%3Aoid%3A39\"; AWS HTTP error: Client error: `GET http:\/\/localhost:8000\/oc-primary\/urn%3Aoid%3A39` resulted in a `404 Not Found` response NotFound (client): 404 Not Found (Request-ID: 22ef9ac1d24182 0e195e) - NoSuchKeyThe specified key does not exist.22ef9ac1d241820e195e at \/var\/www\/owncloud\/apps-external\/files_primary_s3\/lib\/streamwrapper.php#721"} {"reqId":"YwlOnqTK0qK1yBWmNkU4NgAAAAU","level":3,"time":"2022-08-26T22:52:15+00:00","remoteAddr":"84.180.181.57","user":"admin","app":"PHP","method":"MOVE","url":"\/ remote.php\/dav\/files\/admin\/hello.txt","message":"fopen(s3:\/\/oc-primary\/urn:oid:39): failed to open stream: "OCA\\Files_Primary_S3\\StreamWrapper::stream_ open" call failed at \/var\/www\/owncloud\/apps-external\/files_primary_s3\/lib\/s3storage.php#230"} {"reqId":"YwlOnqTK0qK1yBWmNkU4NgAAAAU","level":3,"time":"2022-08-26T22:52:15+00:00","remoteAddr":"84.180.181.57","user":"admin","app":"PHP","method":"MOVE","url":"\/ remote.php\/dav\/files\/admin\/hello.txt","message":"fread() expects parameter 1 to be resource, bool given at \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Wr apper\/Encryption.php#932"} {"reqId":"YwlOnqTK0qK1yBWmNkU4NgAAAAU","level":3,"time":"2022-08-26T22:52:15+00:00","remoteAddr":"84.180.181.57","user":"admin","app":"PHP","method":"MOVE","url":"\/ remote.php\/dav\/files\/admin\/hello.txt","message":"fclose() expects parameter 1 to be resource, bool given at \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/W rapper\/Encryption.php#933"} {"reqId":"YwlOnqTK0qK1yBWmNkU4NgAAAAU","level":3,"time":"2022-08-26T22:52:15+00:00","remoteAddr":"84.180.181.57","user":"admin","app":"PHP","method":"MOVE","url":"\/ remote.php\/dav\/files\/admin\/hello.txt","message":"Error executing \"GetObject\" on \"http:\/\/localhost:8000\/oc-primary\/urn%3Aoid%3A39\"; AWS HTTP error: Client error: `GET http:\/\/localhost:8000\/oc-primary\/urn%3Aoid%3A39` resulted in a `404 Not Found` response NotFound (client): 404 Not Found (Request-ID: 3e7580c3fb418f d6fc9b) - NoSuchKeyThe specified key does not exist.3e7580c3fb418fd6fc9b at \/var\/www\/owncloud\/apps-external\/files_primary_s3\/lib\/streamwrapper.php#721"} {"reqId":"YwlOnqTK0qK1yBWmNkU4NgAAAAU","level":3,"time":"2022-08-26T22:52:15+00:00","remoteAddr":"84.180.181.57","user":"admin","app":"PHP","method":"MOVE","url":"\/ remote.php\/dav\/files\/admin\/hello.txt","message":"fopen(s3:\/\/oc-primary\/urn:oid:39): failed to open stream: "OCA\\Files_Primary_S3\\StreamWrapper::stream_ open" call failed at \/var\/www\/owncloud\/apps-external\/files_primary_s3\/lib\/s3storage.php#230"} {"reqId":"YwlOnqTK0qK1yBWmNkU4NgAAAAU","level":3,"time":"2022-08-26T22:52:15+00:00","remoteAddr":"84.180.181.57","user":"admin","app":"PHP","method":"MOVE","url":"\/ remote.php\/dav\/files\/admin\/hello.txt","message":"fclose() expects parameter 1 to be resource, bool given at \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/C ommon.php#595"} {"reqId":"YwlOnqTK0qK1yBWmNkU4NgAAAAU","level":0,"time":"2022-08-26T22:52:15+00:00","remoteAddr":"84.180.181.57","user":"admin","app":"webdav","method":"MOVE","url": "\/remote.php\/dav\/files\/admin\/hello.txt","message":"Exception: HTTP\/1.1 403 There was an error while renaming the file or directory: {\"Exception\":\"Sabre\\\\D AV\\\\Exception\\\\Forbidden\",\"Message\":\"There was an error while renaming the file or directory\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\ /composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(160): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->moveInto()\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/compose r\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(612): Sabre\\\\DAV\\\\Tree->move()\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/W ildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpMove()\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(47 2): Sabre\\\\DAV\\\\Server->emit()\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(253): Sabre\\\\DAV\\\\Server->invok eMethod()\\n#5 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(349): Sabre\\\\DAV\\\\Server->start()\\n#6 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\ /appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#7 \\\/var\\\/www\\\/owncloud\\\/remote.php(165): require_once('\\\/var\\\/www\\\/ownclo...')\\n#8 { main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Directory.php\",\"Line\":498}"} /tt>

jnweiger avatar Aug 26 '22 22:08 jnweiger

Same issue also seen with objectstore as primary storage: https://github.com/owncloud/objectstore/issues/161

jnweiger avatar Aug 26 '22 22:08 jnweiger

needs retest with 1.6.0 once we have it ....

DeepDiver1975 avatar Oct 16 '23 13:10 DeepDiver1975