Can load empty folder of "not available" external storage #21125

Closed
nickvergessen opened this Issue Dec 10, 2015 · 12 comments

Projects

None yet

4 participants

@nickvergessen
Contributor

The PROPFIND of the folder returns 200, although the storage is not available.
But the list of files is empty.
Trying to create a folder/file both results in an error.

cc @PVince81

@nickvergessen nickvergessen added this to the 9.0-current milestone Dec 10, 2015
@nickvergessen
Contributor

Regression from #21086

@PVince81
Collaborator

The getOwner() call was actually indirectly causing an availability check. Now that it is removed, there is no code path coming from Webdav that will trigger the availability check.

One suggestion would be to add an explicit availability check inside the Webdav code to make sure we are able to return 503 when needed. What do you think @icewind1991 @Xenopathic ?

@PVince81 PVince81 self-assigned this Feb 23, 2016
@nickvergessen
Contributor

Duplicate of #18474 ?

@PVince81
Collaborator

Could be. I'll verify this later.

@PVince81
Collaborator

I tried the following:

  1. user1 shares "test" with "admin@localhost/owncloud"
  2. admin accepts the share
  3. admin does propfind on "/test"
  4. user1 deletes the share to trash
  5. admin does propfind on "/test"

Expected: 503 storage not available
Actual:

{"reqId":"jP8Y7xH+0KwFQDebFOD+","remoteAddr":"127.0.0.1","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 401 No 'Authorization: Basic' header found. Either the client didn't send one, or the server is mis-configured\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(446): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(248): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php(82): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/public.php(74): require_once('\\\/srv\\\/www\\\/htdocs...')\\n#6 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":188,\"User\":false}","level":0,"time":"2016-02-24T16:40:40+00:00","method":"PROPFIND","url":"\/owncloud\/public.php\/webdav\/"}
{"reqId":"uOUSBYHBnjnwI7hsndeW","remoteAddr":"127.0.0.1","app":"webdav","message":"Exception: {\"Message\":\"File with id \\\"17\\\" has not been found.\",\"Exception\":\"OCP\\\\Files\\\\NotFoundException\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php(72): OC\\\\Files\\\\View->getPath('17')\\n#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/connector\\\/sabre\\\/serverfactory.php(121): {closure}(Object(OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Server))\\n#2 [internal function]: OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ServerFactory->OCA\\\\DAV\\\\Connector\\\\Sabre\\\\{closure}(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Object(Closure), Array)\\n#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(446): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(248): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#6 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php(82): Sabre\\\\DAV\\\\Server->exec()\\n#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/public.php(74): require_once('\\\/srv\\\/www\\\/htdocs...')\\n#8 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php\",\"Line\":1639,\"User\":false}","level":4,"time":"2016-02-24T16:40:40+00:00","method":"PROPFIND","url":"\/owncloud\/public.php\/webdav\/"}
{"reqId":"+KqheHXjEpasi7Q\/bVgt","remoteAddr":"127.0.0.1","app":"files_external","message":"Internal Server Error","level":3,"time":"2016-02-24T16:40:40+00:00","method":"PROPFIND","url":"\/owncloud\/remote.php\/files\/test"}
{"reqId":"CZZ4F2fFAlvQGZV65pVA","remoteAddr":"127.0.0.1","app":"share","message":"could not resolve linkItem","level":0,"time":"2016-02-24T16:40:40+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files_sharing\/shareinfo?t=GJENXoFjxcP4clT"}
{"reqId":"+KqheHXjEpasi7Q\/bVgt","remoteAddr":"127.0.0.1","app":"PHP","message":"Call to undefined method OCA\\Files_Sharing\\External\\MountProvider::removeShare() at \/srv\/www\/htdocs\/owncloud\/apps\/files_sharing\/lib\/external\/storage.php#191","level":3,"time":"2016-02-24T16:40:40+00:00","method":"PROPFIND","url":"\/owncloud\/remote.php\/files\/test"}

Broken again 😢

@PVince81
Collaborator

This is on master faf65e7

Looks like #22498 isn't fully functioning. If I revert it, I properly get 503 ...

Investigating...

@PVince81
Collaborator

So weird... how can the method removeShare not exist on $this->manager ? Has this been broken since a long while ?

@PVince81
Collaborator

also observed on stable8.2

@PVince81
Collaborator

The manager is in instance of:

  $this->manager                 = (object|OCA\Files_Sharing\External\MountProvider[2]);
    $this->manager->connection   = (object|OC\DB\Connection[17])+;
    $this->manager->managerProvider = (object|Closure[2])+;

There is neither getMountManager nor removeShare there...

I do remember that this used to work in older versions, maybe the mount managers changed in-between.

@PVince81
Collaborator

In stable8.1 it was different;

  $this->manager                 = (object|OCA\Files_Sharing\External\Manager[5]);
    $this->manager->uid          = (string[5]) 'admin';
    $this->manager->connection   = (object|OC\DB\Connection[17])+;
    $this->manager->mountManager = (object|OC\Files\Mount\Manager[1])+;
    $this->manager->storageLoader = (object|OC\Files\Storage\StorageFactory[1])+;
    $this->manager->httpHelper   = (object|OC\HTTPHelper[2])+;

Something has gone wrong with the introduction of mount providers ? @Xenopathic @icewind1991

@PVince81 PVince81 added the regression label Feb 24, 2016
@PVince81
Collaborator

@icewind1991 @Xenopathic please help fixing this. We need to inject the share manager like in the past "OCA\Files_Sharing\External\Manager" but the code path that creates the storage has no sharing-specific code. Might need a sharing-specific mount provider...

@PVince81 PVince81 assigned icewind1991 and unassigned PVince81 Feb 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment