Upgrade from o.C. 8.2.X to 9.0.X. Cannot access to oC if and LDAP user that made a share was deleted from the LDAP server. #24090

Closed
davitol opened this Issue Apr 19, 2016 · 21 comments

Projects

None yet

6 participants

@davitol
Contributor
davitol commented Apr 19, 2016 edited

Steps to reproduce

  1. Using a oC server 8.2.3, configure a LDAP as a users backend
  2. Log in with an LDAP user
  3. Share a file with another user.
  4. In the LDAP server, delete the LDAP user
  5. Upgrade from 8.2.3 to 9.0.X oC version
  6. Log in with a oC user

Expected behaviour

The upgrade worked fine and the users are able to log in

Actual behaviour

An error is shown and the users cannot log into oC

Note: The server was upgraded before from 8.1.X to 8.2.3 and the upgrade went fine and the users were able to log in.

Note2: No logs were generated just after the upgrade from 8.2.3 to 9.0.X. The logs written below were printed after trying to log in with a oC user.

Server configuration

Operating system:
Ubuntu 14.04

Web server:
Apache

Database:
MySQL

PHP version:
5.5.9

**ownCloud version:**version":"9.0.1.3","versionstring":"9.0.1","edition":"Enterprise"}

**Updated from an older ownCloud or fresh install:**Update from 8.2.3 to 9.0.1

Are you using external storage, if yes which one: local/smb/sftp/...
No

Are you using encryption:
No

Logs

{"reqId":"30FFTkwoLZxj2WWykhAg","remoteAddr":"XXXX","app":"files","message":" Backends provided no user object for e161fc56-26ac-1032-88c4-53011e5afe6a","level":3,"time":"2016-04-19T07:19:30+00:00","method":"GET","url":"\/index.php\/apps\/files\/","user":"f2636f78-e656-1034-82bf-8500c4126330"}
{"reqId":"30FFTkwoLZxj2WWykhAg","remoteAddr":"XXXX","app":"no app in context","message":"Exception: {\"Exception\":\"OC\\\\User\\\\NoUserException\",\"Message\":\"Backends provided no user object for e161fc56-26ac-1032-88c4-53011e5afe6a\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/sharedstorage.php(89): OC\\\\Files\\\\Filesystem::initMountPoints('e161fc56-26ac-1...')\\n#1 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/sharedstorage.php(581): OC\\\\Files\\\\Storage\\\\Shared->init()\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(381): OC\\\\Files\\\\Storage\\\\Shared->getCache('', Object(OCA\\\\Workflow\\\\AutoTagging\\\\StorageWrapper))\\n#3 \\\/var\\\/www\\\/owncloud\\\/apps\\\/workflow\\\/autotagging\\\/storagewrapper.php(389): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getCache('', Object(OCA\\\\Workflow\\\\AutoTagging\\\\StorageWrapper))\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(1306): OCA\\\\Workflow\\\\AutoTagging\\\\StorageWrapper->getCache('')\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/node\\\/root.php(179): OC\\\\Files\\\\View->getFileInfo('\\\/f2636f78-e656-...')\\n#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/avatarmanager.php(93): OC\\\\Files\\\\Node\\\\Root->get('\\\/f2636f78-e656-...')\\n#7 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/templatelayout.php(113): OC\\\\AvatarManager->getAvatar('f2636f78-e656-1...')\\n#8 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/template.php(225): OC\\\\TemplateLayout->__construct('user', 'files')\\n#9 \\\/var\\\/www\\\/owncloud\\\/lib\\\/public\\\/appframework\\\/http\\\/templateresponse.php(156): OC_Template->fetchPage()\\n#10 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(112): OCP\\\\AppFramework\\\\Http\\\\TemplateResponse->render()\\n#11 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/app.php(110): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Files\\\\Controller\\\\ViewController), 'index')\\n#12 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/routing\\\/routeactionhandler.php(45): OC\\\\AppFramework\\\\App::main('ViewController', 'index', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#13 [internal function]: OC\\\\AppFramework\\\\routing\\\\RouteActionHandler->__invoke(Array)\\n#14 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(276): call_user_func(Object(OC\\\\AppFramework\\\\routing\\\\RouteActionHandler), Array)\\n#15 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(882): OC\\\\Route\\\\Router->match('\\\/apps\\\/files\\\/')\\n#16 \\\/var\\\/www\\\/owncloud\\\/index.php(39): OC::handleRequest()\\n#17 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/filesystem.php\",\"Line\":387}","level":3,"time":"2016-04-19T07:19:30+00:00","method":"GET","url":"\/index.php\/apps\/files\/","user":"f2636f78-e656-1034-82bf-8500c4126330"}
{"reqId":"30FFTkwoLZxj2WWykhAg","remoteAddr":"XXXX","app":"index","message":"Exception: {\"Exception\":\"OCP\\\\Files\\\\NotFoundException\",\"Message\":\"File with id \\\"1485\\\" has not been found.\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/sharedstorage.php(740): OC\\\\Files\\\\View->getPath('1485')\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(469): OC\\\\Files\\\\Storage\\\\Shared->isLocal()\\n#2 \\\/var\\\/www\\\/owncloud\\\/apps\\\/workflow\\\/autotagging\\\/storagewrapper.php(389): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->isLocal()\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(1306): OCA\\\\Workflow\\\\AutoTagging\\\\StorageWrapper->getCache('')\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/node\\\/root.php(179): OC\\\\Files\\\\View->getFileInfo('\\\/f2636f78-e656-...')\\n#5 \\\/var\\\/www\\\/owncloud-\\\/lib\\\/private\\\/avatarmanager.php(93): OC\\\\Files\\\\Node\\\\Root->get('\\\/f2636f78-e656-...')\\n#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/templatelayout.php(113): OC\\\\AvatarManager->getAvatar('f2636f78-e656-1...')\\n#7 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/template.php(225): OC\\\\TemplateLayout->__construct('user', 'files')\\n#8 \\\/var\\\/www\\\/owncloud\\\/lib\\\/public\\\/appframework\\\/http\\\/templateresponse.php(156): OC_Template->fetchPage()\\n#9 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(112): OCP\\\\AppFramework\\\\Http\\\\TemplateResponse->render()\\n#10 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/app.php(110): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Files\\\\Controller\\\\ViewController), 'index')\\n#11 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/routing\\\/routeactionhandler.php(45): OC\\\\AppFramework\\\\App::main('ViewController', 'index', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#12 [internal function]: OC\\\\AppFramework\\\\routing\\\\RouteActionHandler->__invoke(Array)\\n#13 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(276): call_user_func(Object(OC\\\\AppFramework\\\\routing\\\\RouteActionHandler), Array)\\n#14 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(882): OC\\\\Route\\\\Router->match('\\\/apps\\\/files\\\/')\\n#15 \\\/var\\\/www\\\/owncloud\\\/index.php(39): OC::handleRequest()\\n#16 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php\",\"Line\":1643}","level":3,"time":"2016-04-19T07:19:30+00:00","method":"GET","url":"\/index.php\/apps\/files\/","user":"f2636f78-e656-1034-82bf-8500c4126330"}
{"reqId":"gcpvG0IsXSi6lotJlqF9","remoteAddr":"XXXX","app":"files","message":" Backends provided no user object for 062331ac-26aa-1032-88b7-53011e5afe6a","level":3,"time":"2016-04-19T07:19:33+00:00","method":"GET","url":"\/cron.php","user":"--"}

Client configuration

browser

Firefox

screen shot 2016-04-19 at 13 07 22

@davitol davitol added this to the 9.0.2-current-maintenance milestone Apr 19, 2016
@davitol
Contributor
davitol commented Apr 19, 2016
@blizzz blizzz was assigned by PVince81 Apr 19, 2016
@rullzer
Contributor
rullzer commented Apr 20, 2016

Let me dive into this.

@rullzer rullzer assigned rullzer and unassigned blizzz Apr 20, 2016
@rullzer
Contributor
rullzer commented Apr 20, 2016

I can't reproduce this. But it feels like this might be a different issue.

I see that the avatarmanager gets called. As well as the storage wrapper from the workflow app. Which both seem ๐ŸŸ-y to me. It kind of tells me that most likely the issue is a side effect of something...

@rullzer
Contributor
rullzer commented Apr 21, 2016

@davitol any luck reproducing this on a docker instance?

@PVince81 PVince81 added sev2-high and removed sev1-critical labels Apr 22, 2016
@PVince81
Collaborator

Downgrading to high as @davitol could not reproduce the issue.
Moving to 9.0.3 in case it is observed again at some point.

@PVince81
Collaborator
@davitol
Contributor
davitol commented Apr 26, 2016

@rullzer @PVince81 @cmonteroluque Just reproduced again. i'll share my server credential with @rullzer

@davitol
Contributor
davitol commented Apr 27, 2016 edited

@rullzer @PVince81 These are the final steps:

1.Using a oC server 8.2.3, configure a LDAP as a users backend
2. Log in with an LDAP userA
3. Share a file with another LDAP userB.
4. In the LDAP server, delete the LDAP userA
5. Upgrade from 8.2.3 to 9.0.X oC version
6. Try to log in with LDAP userB

This issue can be reproduced without encryption, so the problem might be related to share + LDAP

@PVince81
Collaborator

@schiesbn can you help here ?

@PVince81 PVince81 added sev1-critical and removed sev2-high labels Apr 27, 2016
@PVince81
Collaborator

After discussing with @cmonteroluque @davitol, setting to critical since user cannot login any more.

@blizzz can you also assist a bit for the part about the deleted user ? Would it help as a workaround to run the LDAP cleanup before or after the upgrade ?

@PVince81 PVince81 assigned schiessle and unassigned rullzer Apr 27, 2016
@schiessle
Member

I just tried it without LDAP in the hope that I can avoid the LDAP setup ๐Ÿ˜‰

My test steps:

  1. setup a ownCloud 8.2.3 with admin, user1, user2
  2. user1 shares a file to user2
  3. go to the database and delete user1 from the oc_users table (which should be the same as a user deleted from ldap)
  4. update to 9.0.1
  5. login with user2

Everything worked without any problems. Will try now with LDAP.

@schiessle
Member

Now I tried the same with LDAP following exactly the steps described by @davitol but couldn't re-produce it.

@davitol to which ownCloud version do you upgrade? I tried it with 9.0.1.

@schiessle
Member

I also tried to update directly to the latest stable9 branch with the same result -> can't reproduce

@schiessle
Member

I see that the avatarmanager gets called. As well as the storage wrapper from the workflow app. Which both seem ๐ŸŸ-y to me. It kind of tells me that most likely the issue is a side effect of something...

Have the same feeling... @davitol which apps do you have enabled?

@davitol
Contributor
davitol commented Apr 27, 2016

@schiesbn I upgraded from 8.2.3 EE to 9.0.1. EE

Enabled:

  • activity: 2.2.1
  • admin_audit: 0.7
  • comments: 0.2
  • dav: 0.1.6
  • enterprise_key: 0.1.0
  • federatedfilesharing: 0.1.0
  • federation: 0.0.4
  • files: 1.4.4
  • files_external: 0.5.2
  • files_pdfviewer: 0.8
  • files_sharing: 0.9.1
  • files_texteditor: 2.1
  • files_trashbin: 0.8.0
  • files_versions: 1.2.0
  • files_videoplayer: 0.9.8
  • firewall: 2.3.0
  • firstrunwizard: 1.1
  • gallery: 14.5.0
  • notifications: 0.2.3
  • provisioning_api: 0.4.1
  • systemtags: 0.2
  • templateeditor: 0.1
  • updatenotification: 0.1.0
  • user_ldap: 0.8.0
  • windows_network_drive: 0.2.33
  • workflow: 0.1.3
@blizzz
Contributor
blizzz commented Apr 27, 2016 edited

Was an LDAP attribute set for the User Home (paste the whole LDAP config)? Did the deleted LDAP user has had an avatar?

@davitol
Contributor
davitol commented Apr 28, 2016

Did the deleted LDAP user has had an avatar?

No, never.

Was an LDAP attribute set for the User Home

No

@schiessle
Member

I could re-produce it, the bug was in the workflow app... @davitol I mentioned you in the pull request, please test it. Thanks!

@davitol
Contributor
davitol commented Apr 28, 2016

@schiesbn I ' ve tested it and it seems to work!!! Well Done!!

@PVince81
Collaborator

@nickvergessen @schiesbn please close this when you think this is ready. I heard you wanted to test out a potentially better solution, so leaving open for now.

CC @icewind1991

@nickvergessen
Contributor

Closing, the other solution helps with a new problem that happens in 9.1+, but not for this one.
so the merged solution is sufficient.

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