Shared storage stack trace for deleted user #27026

Closed
PVince81 opened this Issue Jan 25, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@PVince81
Member

PVince81 commented Jan 25, 2017

Steps

  1. Setup LDAP (no memcache) with 3 users "zombie300", "zombie301", "zombie302"
  2. Login as "zombie300"
  3. Create a folder "test"
  4. Share "test" with "zombie301"
  5. Post a comment for "test"
  6. Login as "zombie301" and see that "test" folder exists
  7. Post a comment for "test"
  8. Delete the user "zombie300" from LDAP
  9. Refresh the page: the share "test" disappears
  10. Create a new folder "test2"
  11. Share "test2" with "zombie302"
  12. Post a comment for "test2"
  13. Login as "zombie302"
  14. Post a comment for "test2"
  15. Refresh the page
  16. Select the folder "test2" to open the sidebar's "Activity tab"
  17. Check owncloud.log

Expected result

No exceptions

Actual result

Some exceptions related to NoUserException related to initMountPoints for user "zombie300"

Versions

v9.1.3

Logs

{"reqId":"gS74G9\/Raq\/IxhYMCH3U","remoteAddr":"127.0.0.1","app":"no app in context","message":"Exception: {\"Exception\":\"OC\\\\User\\\\NoUserException\",\"Message\":\"a8c81166-7737-1036-94a1-6d25c28f3018 is not a valid user anymore\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/User\\\/User.php(251): OCA\\\\User_LDAP\\\\User_LDAP->getHome('a8c81166-7737-1...')\\n#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Mount\\\/LocalHomeMountProvider.php(41): OC\\\\User\\\\User->getHome()\\n#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Config\\\/MountProviderCollection.php(97): OC\\\\Files\\\\Mount\\\\LocalHomeMountProvider->getHomeMountForUser(Object(OC\\\\User\\\\User), Object(OC\\\\Files\\\\Storage\\\\StorageFactory))\\n#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php(435): OC\\\\Files\\\\Config\\\\MountProviderCollection->getHomeMountForUser(Object(OC\\\\User\\\\User))\\n#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/sharedstorage.php(99): OC\\\\Files\\\\Filesystem::initMountPoints('a8c81166-7737-1...')\\n#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/sharedstorage.php(448): OC\\\\Files\\\\Storage\\\\Shared->init()\\n#6 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(485): OC\\\\Files\\\\Storage\\\\Shared->getWrapperStorage()\\n#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/sharedstorage.php(122): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->instanceOfStorage('\\\\\\\\OC\\\\\\\\Files\\\\\\\\Stora...')\\n#8 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/legacy\\\/util.php(153): OC\\\\Files\\\\Storage\\\\Shared->instanceOfStorage('\\\\\\\\OC\\\\\\\\Files\\\\\\\\Stora...')\\n#9 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/StorageFactory.php(100): OC_Util::{closure}('\\\/a8c8fdd8-7737-...', Object(OC\\\\Files\\\\Storage\\\\Shared), Object(OCA\\\\Files_Sharing\\\\SharedMount))\\n#10 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/StorageFactory.php(82): OC\\\\Files\\\\Storage\\\\StorageFactory->wrap(Object(OCA\\\\Files_Sharing\\\\SharedMount), Object(OC\\\\Files\\\\Storage\\\\Shared))\\n#11 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Mount\\\/MountPoint.php(137): OC\\\\Files\\\\Storage\\\\StorageFactory->getInstance(Object(OCA\\\\Files_Sharing\\\\SharedMount), '\\\\\\\\OC\\\\\\\\Files\\\\\\\\Stora...', Array)\\n#12 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Mount\\\/MountPoint.php(160): OC\\\\Files\\\\Mount\\\\MountPoint->createStorage()\\n#13 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/View.php(1356): OC\\\\Files\\\\Mount\\\\MountPoint->getStorage()\\n#14 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Node\\\/Root.php(180): OC\\\\Files\\\\View->getFileInfo('\\\/a8c8fdd8-7737-...')\\n#15 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/AvatarManager.php(97): OC\\\\Files\\\\Node\\\\Root->get('\\\/a8c8fdd8-7737-...')\\n#16 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/core\\\/Controller\\\/AvatarController.php(117): OC\\\\AvatarManager->getAvatar('a8c8fdd8-7737-1...')\\n#17 [internal function]: OC\\\\Core\\\\Controller\\\\AvatarController->getAvatar('a8c8fdd8-7737-1...', 31)\\n#18 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(159): call_user_func_array(Array, Array)\\n#19 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OC\\\\Core\\\\Controller\\\\AvatarController), 'getAvatar')\\n#20 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(99): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OC\\\\Core\\\\Controller\\\\AvatarController), 'getAvatar')\\n#21 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(46): OC\\\\AppFramework\\\\App::main('AvatarControlle...', 'getAvatar', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#22 [internal function]: OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n#23 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(280): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n#24 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/base.php(891): OC\\\\Route\\\\Router->match('\\\/avatar\\\/a8c8fdd...')\\n#25 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#26 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_LDAP.php\",\"Line\":335}","level":3,"time":"2017-01-25T11:07:47+00:00","method":"GET","url":"\/owncloud\/index.php\/avatar\/a8c8fdd8-7737-1036-94a2-6d25c28f3018\/31","user":"a8c9e66c-7737-1036-94a3-6d25c28f3018"}

When posting a comment on "test2":

{"reqId":"nOMPsdi+\/o5Xjy9pOMz1","remoteAddr":"127.0.0.1","app":"no app in context","message":"Exception: {\"Exception\":\"OC\\\\User\\\\NoUserException\",\"Message\":\"a8c81166-7737-1036-94a1-6d25c28f3018 is not a valid user anymore\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/User\\\/User.php(251): OCA\\\\User_LDAP\\\\User_LDAP->getHome('a8c81166-7737-1...')\\n#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Mount\\\/LocalHomeMountProvider.php(41): OC\\\\User\\\\User->getHome()\\n#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Config\\\/MountProviderCollection.php(97): OC\\\\Files\\\\Mount\\\\LocalHomeMountProvider->getHomeMountForUser(Object(OC\\\\User\\\\User), Object(OC\\\\Files\\\\Storage\\\\StorageFactory))\\n#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php(435): OC\\\\Files\\\\Config\\\\MountProviderCollection->getHomeMountForUser(Object(OC\\\\User\\\\User))\\n#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/sharedstorage.php(99): OC\\\\Files\\\\Filesystem::initMountPoints('a8c81166-7737-1...')\\n#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/sharedstorage.php(448): OC\\\\Files\\\\Storage\\\\Shared->init()\\n#6 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(485): OC\\\\Files\\\\Storage\\\\Shared->getWrapperStorage()\\n#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/sharedstorage.php(122): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->instanceOfStorage('\\\\\\\\OC\\\\\\\\Files\\\\\\\\Stora...')\\n#8 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/legacy\\\/util.php(153): OC\\\\Files\\\\Storage\\\\Shared->instanceOfStorage('\\\\\\\\OC\\\\\\\\Files\\\\\\\\Stora...')\\n#9 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/StorageFactory.php(100): OC_Util::{closure}('\\\/a8c8fdd8-7737-...', Object(OC\\\\Files\\\\Storage\\\\Shared), Object(OCA\\\\Files_Sharing\\\\SharedMount))\\n#10 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/StorageFactory.php(82): OC\\\\Files\\\\Storage\\\\StorageFactory->wrap(Object(OCA\\\\Files_Sharing\\\\SharedMount), Object(OC\\\\Files\\\\Storage\\\\Shared))\\n#11 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Mount\\\/MountPoint.php(137): OC\\\\Files\\\\Storage\\\\StorageFactory->getInstance(Object(OCA\\\\Files_Sharing\\\\SharedMount), '\\\\\\\\OC\\\\\\\\Files\\\\\\\\Stora...', Array)\\n#12 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Mount\\\/MountPoint.php(160): OC\\\\Files\\\\Mount\\\\MountPoint->createStorage()\\n#13 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/View.php(1356): OC\\\\Files\\\\Mount\\\\MountPoint->getStorage()\\n#14 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Node\\\/Root.php(180): OC\\\\Files\\\\View->getFileInfo('\\\/a8c8fdd8-7737-...')\\n#15 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Node\\\/Root.php(351): OC\\\\Files\\\\Node\\\\Root->get('\\\/a8c8fdd8-7737-...')\\n#16 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/comments\\\/lib\\\/Activity\\\/Listener.php(88): OC\\\\Files\\\\Node\\\\Root->getUserFolder('a8c8fdd8-7737-1...')\\n#17 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/comments\\\/appinfo\\\/app.php(50): OCA\\\\Comments\\\\Activity\\\\Listener->commentEvent(Object(OCP\\\\Comments\\\\CommentsEvent))\\n#18 [internal function]: OC_App::{closure}(Object(OCP\\\\Comments\\\\CommentsEvent), 'OCP\\\\\\\\Comments\\\\\\\\IC...', Object(Symfony\\\\Component\\\\EventDispatcher\\\\EventDispatcher))\\n#19 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/symfony\\\/event-dispatcher\\\/EventDispatcher.php(181): call_user_func(Object(Closure), Object(OCP\\\\Comments\\\\CommentsEvent), 'OCP\\\\\\\\Comments\\\\\\\\IC...', Object(Symfony\\\\Component\\\\EventDispatcher\\\\EventDispatcher))\\n#20 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/symfony\\\/event-dispatcher\\\/EventDispatcher.php(46): Symfony\\\\Component\\\\EventDispatcher\\\\EventDispatcher->doDispatch(Array, 'OCP\\\\\\\\Comments\\\\\\\\IC...', Object(OCP\\\\Comments\\\\CommentsEvent))\\n#21 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Comments\\\/Manager.php(532): Symfony\\\\Component\\\\EventDispatcher\\\\EventDispatcher->dispatch('OCP\\\\\\\\Comments\\\\\\\\IC...', Object(OCP\\\\Comments\\\\CommentsEvent))\\n#22 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Comments\\\/Manager.php(484): OC\\\\Comments\\\\Manager->insert(Object(OC\\\\Comments\\\\Comment))\\n#23 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Comments\\\/CommentsPlugin.php(243): OC\\\\Comments\\\\Manager->save(Object(OC\\\\Comments\\\\Comment))\\n#24 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Comments\\\/CommentsPlugin.php(120): OCA\\\\DAV\\\\Comments\\\\CommentsPlugin->createComment('files', '27', '{\\\"actorId\\\":\\\"a8c...', 'application\\\/jso...')\\n#25 [internal function]: OCA\\\\DAV\\\\Comments\\\\CommentsPlugin->httpPost(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#26 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#27 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(459): Sabre\\\\Event\\\\EventEmitter->emit('method:POST', Array)\\n#28 \\\/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#29 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(178): Sabre\\\\DAV\\\\Server->exec()\\n#30 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(29): OCA\\\\DAV\\\\Server->exec()\\n#31 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/remote.php(164): require_once('\\\/srv\\\/www\\\/htdocs...')\\n#32 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/user_ldap\\\/lib\\\/User_LDAP.php\",\"Line\":335}","level":3,"time":"2017-01-25T11:09:10+00:00","method":"POST","url":"\/owncloud\/remote.php\/dav\/comments\/files\/27\/","user":"a8c9e66c-7737-1036-94a3-6d25c28f3018"}

This doesn't make sense at all. "test2" isn't in any way related to the deleted user "zombie300".
It is likely that the chain of "initMountPoints" is somehow reaching that user through the deleted/orphaned share and causing such exceptions.

This looks suspicious...

@PVince81 PVince81 added this to the 9.1.5 milestone Jan 25, 2017

@PVince81 PVince81 referenced this issue Jan 25, 2017

Closed

Error while posting comment in web view #27012

0 of 3 tasks complete

@PVince81 PVince81 self-assigned this Jan 25, 2017

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 Jan 25, 2017

Member

I debugged into this and saw that it is properly converted to a FailedStorage, but the exception is still logged because it's NoUserException instead of NotFoundException.

So adding NoUserException to the "white list" should be fine.

Member

PVince81 commented Jan 25, 2017

I debugged into this and saw that it is properly converted to a FailedStorage, but the exception is still logged because it's NoUserException instead of NotFoundException.

So adding NoUserException to the "white list" should be fine.

@PVince81 PVince81 referenced this issue Jan 25, 2017

Merged

Ignore NoUserException for shares from ghosts #27027

4 of 9 tasks complete
@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 Jan 25, 2017

Member

Fix is here #27027

Member

PVince81 commented Jan 25, 2017

Fix is here #27027

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment