[6.0.4 LDAP Home] No error when Home Directory is missing #10419

Closed
ser72 opened this Issue Aug 14, 2014 · 9 comments

Projects

None yet
@ser72
ser72 commented Aug 14, 2014

Expected Behavior
Provide a decent error as to what the issue is

Actual Behavior
No real error in browser and log doesn't provide details as well

Steps

  1. Configure LDAP Home directory in LDAP
  2. In the Advanced Tab of the LDAP wizard, configure the attribute of the home directory
  3. If the home directory mount is gone for some reason, when the user browses to their ownCloud webUI, they get the following:

capture

Better is an error explaining what the issue is -- or to contact the Admin for assistance.

The logs are as follows:

Error   PHP mkdir(): Permission denied at /var/www/owncloud604/lib/private/util.php#82  2014-08-14T11:22:41+00:00
Error   PHP mkdir(): Permission denied at /var/www/owncloud604/lib/private/util.php#82  2014-08-14T11:22:41+00:00
Error   PHP mkdir(): Permission denied at /var/www/owncloud604/lib/private/util.php#82  2014-08-14T11:22:40+00:00

Which are insufficient to tell the Admin what the issue is. A log stating something like "Mount no longer exists" would be better so the Admin can remount and the user can be operational again.

@karlitschek
Member

@blizzz Would be good to add a check here

@ser72 ser72 added the blue-ticket label Aug 14, 2014
@blizzz blizzz added the Bug label Aug 21, 2014
@blizzz
Contributor
blizzz commented Oct 21, 2014

on master:

If the directory is not found, ownCloud attempts to create it.

If ownCloud cannot create it, master presents this screen:

int-error

This is definitely better than what @ser72 sees, although the details are sparse here. You get wiser when you look into the log, but also only if you know what

{"reqId":"918bf269fefb8f08c6dc2dc731328262","remoteAddr":"127.0.0.1","app":"index","message":"Exception: {\"Message\":\"\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/blizzz\\\/owncloud\\\/dev\\\/master\\\/lib\\\/private\\\/server.php(309): OC\\\\Files\\\\Node\\\\Folder->newFolder('\\\/files')\\n#1 \\\/home\\\/blizzz\\\/owncloud\\\/dev\\\/master\\\/lib\\\/private\\\/util.php(127): OC\\\\Server->getUserFolder('zombie26384')\\n#2 \\\/home\\\/blizzz\\\/owncloud\\\/dev\\\/master\\\/lib\\\/base.php(729): OC_Util::setupFS()\\n#3 \\\/home\\\/blizzz\\\/owncloud\\\/dev\\\/master\\\/index.php(28): OC::handleRequest()\\n#4 {main}\",\"File\":\"\\\/home\\\/blizzz\\\/owncloud\\\/dev\\\/master\\\/lib\\\/private\\\/files\\\/node\\\/folder.php\",\"Line\":194}","level":4,"time":"2014-10-21T12:58:18+00:00","method":"POST","url":"\/master\/index.php\/core\/ajax\/translations.php"}

means. In OC 7 the error screen (also ownCloud design) is empty, not helpful. The log message is also not very clear:

{"reqId":"54465a746d4db","app":"index","message":"OCP\\Files\\NotPermittedException: ","level":4,"time":"2014-10-21T13:07:00+00:00","method":"POST","url":"\/stable7\/index.php\/core\/ajax\/translations.php"}

Anyway, his problem is on OC 6. And in 6.0.5 I can confirm the reported behaviour. ownCloud always tries to redirect to the default app, which will result in the redirection error. If you set a different app as default you will end up there, but files is not accessible for you.

This is also a bug in core, and not specific to LDAP. In order to force it to happen using local users, chown a user folder inside data to root and chmod it to 700.

What we need to do here is to find where the user folder is attempted to be created and wrap it in exception handling as it is done with OC 7 (backport is possible, but it can be that the code is too divergent in the effected parts).

@MorrisJobke
Member

What we need to do here is to find where the user folder is attempted to be created and wrap it in exception handling as it is done with OC 7 (backport is possible, but it can be that the code is too divergent in the effected parts).

@craigpg @karlitschek @gig13 Is this the way to go or what is the decision on this?

@gig13
gig13 commented Dec 2, 2014

This looks better than no message, but can there be an explicit, "Cannot connect to home directory"?
@MTRichards - Is this error message sufficient?

@MTRichards
Contributor

A tad more information on what the error is would be useful. Such as what the error is for. Right now, no info on what caused the error - can we add that somehow?

Such as "Cannot connect to or create Home Directory"

@craigpg craigpg removed the app:user_ldap label Dec 2, 2014
@craigpg
craigpg commented Dec 2, 2014

Sounds like we understand the issue (thx @blizzz). We can fix / improve the error message in a future release. Has the immediate issue been resolved by fixing permissions or fixing the user's home directory attribute?

@remixtj
remixtj commented Mar 2, 2015

What if a user is impacted by this error? How can the admin fix? I created manually files directory which was unavailable for the user and launched a rescan, but i'm looking for a more elegant way to fix.

@PVince81
Collaborator

Does this still happen in 7.0.5 or 8.0.2 ?

@blizzz what do you think ?

@blizzz blizzz added this to the 8.2-next milestone Jun 16, 2015
@cmonteroluque cmonteroluque modified the milestone: 9.0-next, 8.2-current Sep 9, 2015
@MorrisJobke
Member

I improved a bit the error handling - #21459 should fix this issue.

@MorrisJobke MorrisJobke removed their assignment Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment