-
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
Backends provided no user object for LDAP User #28039
Comments
Does the user_ldap app version in the list match the one release on the marketplace ? Or is that the old one ? |
it is the one in the market place: user_ldap: 0.9.1 |
@cormite did you run the
|
@jvillafanez, Yes I did ... Note that I have already > 1000 users but only 680 so far known (those who have logged in). However, in the logs I keep receiving the errors of unknown for those who have not yet logged in.
|
I need to know the filters and bases you're using and any other related configuration. The only thing I can say for now is that you're trying to load 2133 of something (not necessary users) from somewhere, so maybe you're not even trying to load users but other things. |
@jvillafanez The filters I am using are those which I have used since version 7 of ownCloud. Nothing has changed and it has always worked fine for us. The problem appear only after the migration from 9.1.4 to 10.0.1.5 We have custom attributes: (&(!(accountlockdate=*))(|(objectclass=owncloudallowed)(objectclass=personactive))(uid=*)) Bases: |
could you run the user:sync command as much isolated as possible and check the logs? There should be errors in the log file. |
@jvillafanez do you mean in a per user level? |
@PVince81 @jvillafanez I have run the user:sync command again in verbose mode. I have not received any information in the logs not in the console ... The only extra information I have received is about performance but no errors. Any suggestion about how to gather better information to share should be appreciated. So far this is what I get:
|
I do not know if this brings any idea, or even if this is related to the issue or if on the other hand it is expected, but I thought it would be worth mention it and if it is not related we can delete this comment. I am also consuming via python the owncloud API and for some users I do not receive a quota value. The XML response for quota is empty. |
Looks like we'll need to check the hard way... Please add the following 2 lines in the "lib/private/User/SyncService.php", around line 111 of the file. Then run the "occ user:sync" command. You can remove the lines added afterwards.
You should see 680 log entries with "Updated ... account" and around 1450 entries with "Inserted ... account" in the owncloud.log file. The other option is that you see 2135 entries with "Updated ... account", which would confirm that the exception isn't thrown and so the new accounts aren't being added. |
@jvillafanez, I have followed your instructions but unfortunatelly I see nothing at all in the owncloud.log file after adding those two lines and running the occ users:sync command. |
Either ownCloud isn't writing there because you've set another location for the log file, or ownCloud can't write in the file for some reason. ownCloud should be yelling; the fact the there is no output shows that there is something wrong with your setup. |
@jvillafanez I am tailing the file (realtime -f) and I see the errors contantly being written to owncloud.log so it seems to be accessible and writable. It is just that those lines are not in the owncloud.log file. |
@jvillafanez I have modified the lines you mentioned for: I wanted to make sure that the problem does not come from owncloud.log nor being accessible/writtable. Still I see nothing ... |
Let's try commenting those logs and add these ones (same file, around line 96):
If somehow the backend isn't fetching the users, that could explain why you aren't seeing the other logs. |
ok .. some improvement 👍 I see the following in owncloud.log: {"reqId":"2MU6AucmlF8XxEakf8Bs","level":3,"time":"2017-06-02T09:32:39+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"--","url":"--","message":"Users fetched: 498"} The output of the occ user:sync command was: sudo -u apache occ user:sync "OCA\User_LDAP\User_Proxy" -vvv If unknown users are found, what do you want to do with their accounts? (removing the account will also remove its data) [0] disable [1] remove [2] ask later > 2 Analyse unknown users ... 703 [============================] 1 sec 25.8 MiB Following users are no longer known with the connected backend. listing the unknown accounts USER_ID What do you want to do with their accounts? (removing the account will also remove its data) [0] disable [1] remove > 0 Proceeding to disable the accounts Insert new and update existing users ... 2134/2134 [============================] 100% 1 min/1 min 60.2 MiB Still occ user:report shows: occ user:report +--------------------------+------+ | User Report | | +--------------------------+------+ | OCA\User_LDAP\User_Proxy | 701 | | OC\User\Database | 2 | | | | | total users | 703 | | | | | user directories | 1187 | +--------------------------+------+ |
@jvillafanez I have noticed that everytime I run the occ user:sync command the same userID pops up as unknown. If I disable the account it appears again as unknown in the next occ user:sync run. |
Ok, so somehow the users returned by the LDAP app are 498 and it stops there because it thinks there are no more users. That could explain why there isn't any new user.
That's kind of expected because the user is still in ownCloud but no longer in LDAP. It's expected that the account is removed by the admin at some point. You might want to open a new ticket for it for further discussion, but it isn't relevant for the current one. |
@jvillafanez I agree with you I will open a new ticket for the non-relevant part of this issue. |
You've said there should be more than 1000 LDAP users. LDAP should be fetching the first 500, and then proceed with the next 500. Somehow LDAP is only returning 498 (I trust only the first 498 are being fetched, not 500 + 500 + 498 or something similar, please confirm this). Since the service asked for 500 users and only 498 have been returned, the service thinks there are no more users. If this assumption is correct, there are 2 entries missing because LDAP should be returning 500 entries, not 498. |
You can also change the log level to debug and look for the following logs in the owncloud.log file after rerunning the "occ user:sync" command The limit and the user count shoud match. If they don't match, add the following log there:
That will show where we're losing the users. |
Changing the log level to debug and running the occ user:sync shows: "getUsers: Options: search limit 500 offset 0 and "getUsers: 498 Users found" Adding the new line and running the command again shows the following: {"reqId":"uvt25nClX75Z6xC5bsBB","level":0,"time":"2017-06-02T12:23:04+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"getUsers: Options: search limit 500 offset 0 Filter: (&(&(!(accountlockdate=*))(|(objectclass=owncloudallowed)(objectclass=personactive))(uid=*))(displayname=*)(displayname=*))"} {"reqId":"uvt25nClX75Z6xC5bsBB","level":0,"time":"2017-06-02T12:25:10+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"getUsers0: 500 Users found"} {"reqId":"uvt25nClX75Z6xC5bsBB","level":0,"time":"2017-06-02T12:25:10+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"getUsers: 498 Users found"} So weird enough, the LDAP filter is not exactly the one I have defined in my admin settings: (&(!(accountlockdate=*))(|(objectclass=owncloudallowed)(objectclass=personactive))(uid=*)) And also, two consecutive lines showing different number of users found: 500 and 498. |
@jvillafanez Sorry ... I closed the case and reopen again ... (I pressed the wrong button). |
Ok, suspicious confirmed: somehow 2 users are left out, which is causing this weird behaviour. Next logs in apps/user_ldap/lib/Access.php, around line 641
The count there should be 500, but there should be 2 log entries with a weird "ocName" value. The "ocName" will likely be boolean for those. |
The goal is to verify if the |
premio! 👍 {"reqId":"UONqybnx3ZfWriDuCRj7","level":3,"time":"2017-06-02T14:47:30+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"ldap2ownCloudNames: dn cn=SENSITIVE_DATA the ocName returned a falsy value"} {"reqId":"UONqybnx3ZfWriDuCRj7","level":3,"time":"2017-06-02T14:47:30+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"ldap2ownCloudNames: dn cn=SENSITIVE_DATA the ocName returned a falsy value"} We are finally narrowing down the problem. |
@jvillafanez, something I do not understand from the administration point of view is that if there are, like in my case, two problematic users (as far as we have found) why doesn't the code continue importing the rest of detected users? It is clear that occ user:scan detects >2000 LDAP users and occ user:report >1000 owncloud users. If it knows about >1000 why doesn't it continue with the rest and gets stuck at 498? why doesn't it report the admin about this problem and continues importing until the end? That would be the expected behavior from my point of view. Anyway, for the time being, I would appreciate just a little hand further to fix overcome these two blocking users. Thanks! |
@jvillafanez I have finally been able to fix the problem. I have slightly modified the LDAP filter to restrict a bit more and leave out the users whose condition was not meet in order to be considered ownCloud users. After this modification I was able to syn all the users again. occ user:report +--------------------------+------+ | User Report | | +--------------------------+------+ | OCA\User_LDAP\User_Proxy | 2077 | | OC\User\Database | 2 | | | | | total users | 2079 | | | | | user directories | 1188 | +--------------------------+------+ I really appreciate your effort, time spent, and support. |
The way it's coded doesn't involve knowing all the users: it asks for the first 500, if LDAP returns 500 users then it will ask for the next 500 because there could be more. The problem is that it ask for 500 user but LDAP returns 498, so it thinks there are no more users. I'm glad you've fixed your problem. I'm reopening the issue because I'll have to take some action regarding this, probably adding some logs to detect this problem easier. |
@jvillafanez yes, please take over the thread. If you want me to make more tests I will be glad to help. |
more verbose logging in #28212 |
Hey, this issue has been closed because the label |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Steps to reproduce
Expected behavior
If no errors are show during the update, the expected behavior would be a clean log file
Actual behavior
owncloud.log shows many errors of the type:
This means some user cannot get shared files and receive a "Internal Server Error" message.
When making a occ files:scan on the user represented by SENSITIVE_DATA, the response is "Unknown user 1 SENSITIVE_DATA". This happens until the user logs in for the first time. Obviously the login triggers something so the user is no longer unknown.
Once the user logs in, then the person who received the "Internal Server Error" sees the Shared content again.
Server configuration
Operating system:
CentOS Linux release 7.3.1611 (Core)
Web server:
Apache 2.4.6
Database:
mysql Ver 15.1 Distrib 5.5.52-MariaDB, for Linux (x86_64) using readline 5.1
PHP version:
PHP 5.6.30
ownCloud version: (see ownCloud admin page)
ownCloud 10.0.1.5
Updated from an older ownCloud or fresh install:
Upgraded from 9.1.4 to 9.1.5 to 10.0.1.5
Where did you install ownCloud from:
Manual upgrade performed without any errors reported. The files where downloaded from owncloud.org.
Signing status (ownCloud 9.0 and above):
All good except .htaccess integrity due to modification of upload_max_size
https://gist.github.com/cormite/42c80455d3f300ff9c808853d56390ed
The content of config/config.php:
https://gist.github.com/cormite/a3de7da5a4bef885226ace36a82c55c2
List of activated apps:
Are you using external storage, if yes which one: NFS
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:
Firefox, Chrome, Explorer (many different versions). We have > 1000 owncloud users.
Operating system:
Windows, Mac OS X, Linux
Logs
Web server error log
Many similar errors: PHP Fatal error: Call to a member function file_get_contents() on null in OWNCLOUD_DIR/lib/private/Files/Filesystem.php on line 753
ownCloud log (data/owncloud.log)
Repeated over and over again for many users:
Browser log
Content Security Policy: Directive ‘frame-src’ has been deprecated. Please use directive ‘child-src’ instead. (unknown)
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src https://OWNCLOUD_URL 'unsafe-eval'”). Source: onsubmit attribute on DIV element. files
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src https://OWNCLOUD_URL 'unsafe-eval'”). Source: onchange attribute on DIV element. files
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src https://OWNCLOUD_URL 'unsafe-eval'”). Source: onfocusin attribute on DIV element. files
JQMIGRATE: Migrate is installed, version 1.4.0 jquery-migrate.min.js:2:542
window.controllers is deprecated. Do not use it for UA detection. ace.js:1716
The text was updated successfully, but these errors were encountered: