-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"OCP\Files\NotFoundException" when logging in #28061
Comments
Doesn't look like the skeleton files missing was the cause. I've put them back and the issue still happens. |
Also tried removing the homeDirectory attribute so that the user data DIR becomes .../data/uid, also didn't work. |
I've got passed the exception by manually changing the "home" property in the accounts table from "/home/adam_reece" to "/var/www/cloud/data/root". I guess what's happening here is that the real home folder "/home/adam_reece" is trying to be looked at as the "www-data" user, whereas what should be happening is session pass-through authentication in the same way that the SMB/CIFS mounts work. This makes the setting to specify a home folder "homeFolderNamingRule" useless in the LDAP authentication module if it's not going to use the right credentials to access the underlying file system. |
AFAIK the web server can only ever access folders as "www-data". It is not possible to make it switch to another user on FS/process level, if that's what you mean. The SMB/CIFS mount happen on PHP level, so it's not really a filesystem mount but PHP which is connecting directly to SMB and virtually make the contents appear inside OC. It's not done on FS level. |
Ah okay... Wouldn't that make "homeFolderNamingRule" quite pointless then? Typically a POSIX home folder path in a directory would be "/home/username". A web server user would almost never be allowed to read/write anyone else's home folder because allowing anything other than the owning user to read/write a home folder at FS level would deny the user from logging in at all. (The host system or another application would throw a security exception because the home folder is open to exploits.) Example: https://unix.stackexchange.com/questions/37164/ssh-and-home-directory-permissions This would only be useful if a SMB/CIFS or other external mount path could be used for home folders so file operations happen in context of the owning user rather than the web server's user. |
Many successful deployments use this but have the home folder under the "data" folder inside the OC folder, or a folder in another location also accessible under "www-data". So I wouldn't call it pointless. I'm not sure how these setups are done in detail though. Maybe permissions are remapped somehow by forcing user/group to be www-data on the FS mount. |
Allowing www-data to directly write to a home folder sounds like disaster waiting to happen. :) |
@jvillafanez @butonic do you know more about how this is used ? |
I haven't used it. I'll have to check it at some point. Anyway, my personal recommendation is to treat the data folder as a black box: you shouldn't care about its folder structure. |
Sounds fair. What I was going to do is set the user quota right down to 1 KiB because it wouldn't be great for user data to be placed with the website, then we will instruct our staff to use the "Personal" external storage folder (which is a SMB/CIFS mount) for their own files. The downside to this is no deleted or old files could be stored as these are within the user's "black box" space. |
Hey, this issue has been closed because the label |
It is not technically possible for the PHP code to make the web server user to switch to another user to access the data from another user on FS level. |
@AdamReece-WebBox Hi I am having the same problem. Getting an error 500 when logging in with another user but login as root is fine. Could you please point to how to solve this? Thank you |
@coco3271 as discussed the issue is simply a Linux FS permissions one. Your web server is likely running as user "www-data" or similar, thus won't have permission to read/write to the home folder of the user you're logging in as.
|
@AdamReece-WebBox Thanks. My path "/var/www/cloud/data/root" doesn't exist on my server. |
There might be potentially problematic behaviours changing the default home directory. My personal recommendation is to leave the "homeFolderNamingRule" and "ldapExpertUsernameAttr" ldap configurations with the default empty values.
No, you shouldn't. Unless told otherwise, all home directories will be created inside the ownCloud's data directory (consider the "homeFolderNamingRule" as an exception to this), so ownCloud should have enough permissions to create the user's folder there. |
Just in case someone gets here via web search:
I suggest that ownCloud handles this missing dir better, if |
Just as an FYI, I have this same problem with LDAP accounts. I can resolve manually by running a Edit: this is using Ubuntu snap method. So owner of the path is root:root, not www-data. (by design) |
Note: this is the ownCloud repository. |
Steps to reproduce
Login as an LDAP user.
(Does not occur if I login as the root user.)
Expected behaviour
Login completed with index view.
Actual behaviour
Internal server error without an exception message.
My only thoughts would be:
Technical details
Trace
Server configuration
Operating system: Debian Linux 9 "Stretch"
Web server: Apache 2.4.25 (Debian)
Database: mysql Ver 15.1 Distrib 10.1.23-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
PHP version: PHP 7.0.19-1 (cli) (built: May 11 2017 14:04:47) ( NTS )
ownCloud version: ownCloud 10.0.1.5 (production)
Updated from an older ownCloud or fresh install: Fresh
Where did you install ownCloud from: Manual through shell. (Not using apt/yum.)
Signing status (ownCloud 9.0 and above): https://gist.github.com/AdamReece-WebBox/7a1e3eb17573daac4c9079dca6c6679b
The content of config/config.php: https://gist.github.com/AdamReece-WebBox/e1d79c950e4ea95a71b94841f4f8de39
List of activated apps:
Enabled:
Disabled:
Are you using external storage, if yes which one: SMB/CIFS
Are you using encryption: No
Are you using an external user-backend, if yes which one: LDAP
LDAP configuration (delete this part if not used)
Client configuration
Browser: Happens on any (Chrome/Edge/...)
Operating system: Happens on any (Windows/OSX/...)
Logs
Web server error log
Irrelevant, same as stack trace posted above.
ownCloud log (data/owncloud.log)
Irrelevant, same as stack trace posted above.
Browser log
Irrelevant, server side issue.
The text was updated successfully, but these errors were encountered: