owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.4k stars 2.05k forks source link

exception & blocked UI when creating a storage with the same name as a share #36719

Open individual-it opened 4 years ago

individual-it commented 4 years ago

Steps to reproduce

  1. as user "uu1" create a folder called "f1"
  2. as user "uu1" share folder "f1" with user "uu2"
  3. as user "uu2" rename folder "f1" to "f1-renamed"
  4. create a local storage called "f1" occ files_external:create f1 local null::null -c datadir=/home/artur/www/owncloud-core/data/local-storage
  5. as user "uu2" try to refresh webUI

Expected behaviour

UI should work! not sure about:

Actual behaviour

for uu2 the UI is blocked till uu1 logs in again

Logs

Web server error log

ownCloud log (data/owncloud.log)

{"reqId":"eNLhFqRgWCaeUamwJiWd","level":4,"time":"2020-01-07T14:01:12+00:00","remoteAddr":"127.0.0.1","user":"uu2","app":"webdav","method":"REPORT","url":"\/owncloud-core\/remote.php\/dav\/files\/uu2\/","message":"Exception: Argument 3 passed to OCA\\Files_Sharing\\Cache::__construct() must implement interface OCP\\Files\\Cache\\ICacheEntry, boolean given, called in \/home\/artur\/www\/owncloud-core\/apps\/files_sharing\/lib\/SharedStorage.php on line 333: {\"Exception\":\"TypeError\",\"Message\":\"Argument 3 passed to OCA\\\\Files_Sharing\\\\Cache::__construct() must implement interface OCP\\\\Files\\\\Cache\\\\ICacheEntry, boolean given, called in \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/files_sharing\\\/lib\\\/SharedStorage.php on line 333\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/files_sharing\\\/lib\\\/SharedStorage.php(333): OCA\\\\Files_Sharing\\\\Cache->__construct(Object(OCA\\\\Files_Trashbin\\\\Storage), Object(OCA\\\\Files_Trashbin\\\\Storage), false)\\n#1 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(392): OCA\\\\Files_Sharing\\\\SharedStorage->getCache('', Object(OCA\\\\Files_Trashbin\\\\Storage))\\n#2 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/View.php(1481): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getCache('')\\n#3 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/Node\\\/Root.php(190): OC\\\\Files\\\\View->getFileInfo('\\\/uu2')\\n#4 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/Node\\\/Root.php(363): OC\\\\Files\\\\Node\\\\Root->get('\\\/uu2')\\n#5 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Server.php(1036): OC\\\\Files\\\\Node\\\\Root->getUserFolder('uu2')\\n#6 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Server.php(288): OC\\\\Server->getUserFolder()\\n#7 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(96): OCA\\\\DAV\\\\Server->OCA\\\\DAV\\\\{closure}(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(448): Sabre\\\\DAV\\\\Server->emit('beforeMethod:RE...', Array)\\n#9 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(241): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#10 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Server.php(333): Sabre\\\\DAV\\\\Server->start()\\n#11 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#12 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/remote.php(165): require_once('\\\/home\\\/artur\\\/www...')\\n#13 {main}\",\"File\":\"\\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/files_sharing\\\/lib\\\/Cache.php\",\"Line\":65}"}
{"reqId":"EBsQNM65iI98EtubGbE9","level":4,"time":"2020-01-07T14:01:14+00:00","remoteAddr":"127.0.0.1","user":"uu2","app":"webdav","method":"PROPFIND","url":"\/owncloud-core\/remote.php\/dav\/files\/uu2\/","message":"Exception: Argument 3 passed to OCA\\Files_Sharing\\Cache::__construct() must implement interface OCP\\Files\\Cache\\ICacheEntry, boolean given, called in \/home\/artur\/www\/owncloud-core\/apps\/files_sharing\/lib\/SharedStorage.php on line 333: {\"Exception\":\"TypeError\",\"Message\":\"Argument 3 passed to OCA\\\\Files_Sharing\\\\Cache::__construct() must implement interface OCP\\\\Files\\\\Cache\\\\ICacheEntry, boolean given, called in \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/files_sharing\\\/lib\\\/SharedStorage.php on line 333\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/files_sharing\\\/lib\\\/SharedStorage.php(333): OCA\\\\Files_Sharing\\\\Cache->__construct(Object(OCA\\\\Files_Trashbin\\\\Storage), Object(OCA\\\\Files_Trashbin\\\\Storage), false)\\n#1 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(392): OCA\\\\Files_Sharing\\\\SharedStorage->getCache('', Object(OCA\\\\Files_Trashbin\\\\Storage))\\n#2 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/View.php(1481): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getCache('')\\n#3 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/Node\\\/Root.php(190): OC\\\\Files\\\\View->getFileInfo('\\\/uu2')\\n#4 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/Node\\\/Root.php(363): OC\\\\Files\\\\Node\\\\Root->get('\\\/uu2')\\n#5 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Server.php(1036): OC\\\\Files\\\\Node\\\\Root->getUserFolder('uu2')\\n#6 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Server.php(288): OC\\\\Server->getUserFolder()\\n#7 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(96): OCA\\\\DAV\\\\Server->OCA\\\\DAV\\\\{closure}(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(448): Sabre\\\\DAV\\\\Server->emit('beforeMethod:PR...', Array)\\n#9 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(241): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#10 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Server.php(333): Sabre\\\\DAV\\\\Server->start()\\n#11 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#12 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/remote.php(165): require_once('\\\/home\\\/artur\\\/www...')\\n#13 {main}\",\"File\":\"\\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/files_sharing\\\/lib\\\/Cache.php\",\"Line\":65}"}
{"reqId":"9OzuxqWTeVZLdJmuoYnj","level":3,"time":"2020-01-07T14:01:15+00:00","remoteAddr":"127.0.0.1","user":"uu2","app":"PHP","method":"GET","url":"\/owncloud-core\/ocs\/v1.php\/apps\/files_sharing\/api\/v1\/shares?format=json&include_tags=true","message":"TypeError: Argument 3 passed to OCA\\Files_Sharing\\Cache::__construct() must implement interface OCP\\Files\\Cache\\ICacheEntry, boolean given, called in \/home\/artur\/www\/owncloud-core\/apps\/files_sharing\/lib\/SharedStorage.php on line 333 at \/home\/artur\/www\/owncloud-core\/apps\/files_sharing\/lib\/Cache.php#65"}
{"reqId":"HTeQI3bgg7obhHY1FCRd","level":3,"time":"2020-01-07T14:01:17+00:00","remoteAddr":"127.0.0.1","user":"uu2","app":"PHP","method":"GET","url":"\/owncloud-core\/ocs\/v1.php\/apps\/files_sharing\/api\/v1\/shares?format=json&include_tags=true","message":"TypeError: Argument 3 passed to OCA\\Files_Sharing\\Cache::__construct() must implement interface OCP\\Files\\Cache\\ICacheEntry, boolean given, called in \/home\/artur\/www\/owncloud-core\/apps\/files_sharing\/lib\/SharedStorage.php on line 333 at \/home\/artur\/www\/owncloud-core\/apps\/files_sharing\/lib\/Cache.php#65"}
{"reqId":"4bUEqWn3tdivZzMlpWTv","level":4,"time":"2020-01-07T14:01:20+00:00","remoteAddr":"127.0.0.1","user":"uu2","app":"webdav","method":"PROPFIND","url":"\/owncloud-core\/remote.php\/dav\/files\/uu2\/","message":"Exception: Argument 3 passed to OCA\\Files_Sharing\\Cache::__construct() must implement interface OCP\\Files\\Cache\\ICacheEntry, boolean given, called in \/home\/artur\/www\/owncloud-core\/apps\/files_sharing\/lib\/SharedStorage.php on line 333: {\"Exception\":\"TypeError\",\"Message\":\"Argument 3 passed to OCA\\\\Files_Sharing\\\\Cache::__construct() must implement interface OCP\\\\Files\\\\Cache\\\\ICacheEntry, boolean given, called in \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/files_sharing\\\/lib\\\/SharedStorage.php on line 333\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/files_sharing\\\/lib\\\/SharedStorage.php(333): OCA\\\\Files_Sharing\\\\Cache->__construct(Object(OCA\\\\Files_Trashbin\\\\Storage), Object(OCA\\\\Files_Trashbin\\\\Storage), false)\\n#1 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(392): OCA\\\\Files_Sharing\\\\SharedStorage->getCache('', Object(OCA\\\\Files_Trashbin\\\\Storage))\\n#2 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/View.php(1481): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getCache('')\\n#3 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/Node\\\/Root.php(190): OC\\\\Files\\\\View->getFileInfo('\\\/uu2')\\n#4 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Files\\\/Node\\\/Root.php(363): OC\\\\Files\\\\Node\\\\Root->get('\\\/uu2')\\n#5 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Server.php(1036): OC\\\\Files\\\\Node\\\\Root->getUserFolder('uu2')\\n#6 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Server.php(288): OC\\\\Server->getUserFolder()\\n#7 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(96): OCA\\\\DAV\\\\Server->OCA\\\\DAV\\\\{closure}(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(448): Sabre\\\\DAV\\\\Server->emit('beforeMethod:PR...', Array)\\n#9 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(241): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#10 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Server.php(333): Sabre\\\\DAV\\\\Server->start()\\n#11 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#12 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/remote.php(165): require_once('\\\/home\\\/artur\\\/www...')\\n#13 {main}\",\"File\":\"\\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/files_sharing\\\/lib\\\/Cache.php\",\"Line\":65}"}
phil-davis commented 4 years ago

Also, as uu1 the folder f1 is the local storage. uu1 does not see the original f1 at all, their files in f1 are effectively "lost" to them. If the admin modifies the local storage so it applies just to some user or group other than uu1 then uu1 gets to see their original f1 again. So the original f1 is not deleted or... It is just not visible while the local storage f1 is visible.

phil-davis commented 4 years ago

See #36738 for some scenarios to demonstrate this issue. Over to product management to define the expected behaviour.

voroyam commented 3 years ago

reproducible with 10.7.0

JammingBen commented 3 years ago

Adjusted the title as this does not only happen with local storages, but also with others.