Some LDAP users incorrectly mapped as remnants

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 16.0.4
Operating system and version (eg, Ubuntu 17.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.14.2-2+deb10u1
PHP version (eg, 7.1): 7.3.4-2

The issue you are facing:

We had a working instance since a few years. On September 10, we attempted an upgrade from 13.x to 16.x which (for now obvious reasons) failed, so made a rollback, read the docs (oops!), and attempted to upgrade to 13.0.14 (latest 13.x), latest 14.x, latest 15.x and at last to 16.0.4 which seemed to be working ok, at least to some users. Yesterday was a non workable day, so only today we got the firsts reports of errors:

All users are LDAP binded, but some of the users report that cannot login on the web interface, nor with desktop clients. Some others are working as usual.

I am in doubt, if in the upgrade process, I found that the LDAP setup got lost on one of the attempts and was necessary to configure again (or this was on the GitLab upgrade?), sorry, we are upgrading lot’s of things these days…

But, as it seems that all users having trouble are listed using:

sudo -u www-data php occ ldap:show-remnants

I’m thinking about that may be a cron job was unable to get LDAP info and treated ~50 users as deleted from LDAP, and launched a cleanup as documented in:

https://docs.nextcloud.com/server/12/admin_manual/configuration_user/user_auth_ldap_cleanup.html

Is there a way to tell nextcloud that those users should not be in this remnants list?
why they are being get listed there?

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. login with a valid LDAP user, listed as remmant

The output of your Nextcloud log in Admin > Logging:

A user logging with a desktop cli

{"reqId":"REMOVED_REQID","level":3,"time":"2019-09-12T11:17:12+00:00","remoteAddr":"REMOVED_USERIP","user":"REMOVED_USERID","app":"no app in context","method":"GET","url":"\/apps\/files\/","message":{"Exception":"OC\\User\\NoUserException","Message":"REMOVED_USERID is not a valid user anymore","Code":0,"Trace":[{"function":"getHome","class":"OCA\\User_LDAP\\User_LDAP","type":"->","args":["REMOVED_USERID"]},{"file":"\/srv\/nextcloud\/www\/apps\/user_ldap\/lib\/User_Proxy.php","line":81,"function":"call_user_func_array","args":[[{"__class__":"OCA\\User_LDAP\\User_LDAP"},"getHome"],["REMOVED_USERID"]]},{"file":"\/srv\/nextcloud\/www\/apps\/user_ldap\/lib\/Proxy.php","line":152,"function":"walkBackends","class":"OCA\\User_LDAP\\User_Proxy","type":"->","args":["REMOVED_USERID","getHome",["REMOVED_USERID"]]},{"file":"\/srv\/nextcloud\/www\/apps\/user_ldap\/lib\/User_Proxy.php","line":227,"function":"handleRequest","class":"OCA\\User_LDAP\\Proxy","type":"->","args":["REMOVED_USERID","getHome",["REMOVED_USERID"]]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/User\/User.php","line":290,"function":"getHome","class":"OCA\\User_LDAP\\User_Proxy","type":"->","args":["REMOVED_USERID"]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/Files\/Storage\/Home.php","line":53,"function":"getHome","class":"OC\\User\\User","type":"->","args":[]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/Files\/Mount\/MountPoint.php","line":147,"function":"__construct","class":"OC\\Files\\Storage\\Home","type":"->","args":[{"user":{"__class__":"OC\\User\\User"}}]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/Files\/Mount\/MountPoint.php","line":172,"function":"createStorage","class":"OC\\Files\\Mount\\MountPoint","type":"->","args":[]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/Files\/Filesystem.php","line":321,"function":"getStorage","class":"OC\\Files\\Mount\\MountPoint","type":"->","args":[]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/Files\/Filesystem.php","line":443,"function":"getStorage","class":"OC\\Files\\Filesystem","type":"::","args":["REMOVED_USERID"]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/Files\/Filesystem.php","line":376,"function":"initMountPoints","class":"OC\\Files\\Filesystem","type":"::","args":["REMOVED_USERID"]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/legacy\/util.php","line":309,"function":"init","class":"OC\\Files\\Filesystem","type":"::","args":["REMOVED_USERID","\/REMOVED_USERID\/files"]},{"file":"\/srv\/nextcloud\/www\/lib\/base.php","line":974,"function":"setupFS","class":"OC_Util","type":"::","args":[]},{"file":"\/srv\/nextcloud\/www\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/srv\/nextcloud\/www\/apps\/user_ldap\/lib\/User_LDAP.php","Line":438,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/76.0.3809.132 Safari\/537.36 OPR\/63.0.3368.71","version":"16.0.4.1"}
{"reqId":"REMOVED_REQID","level":2,"time":"2019-09-12T11:17:12+00:00","remoteAddr":"REMOVED_USERIP","user":"REMOVED_USERID","app":"no app in context","method":"GET","url":"\/apps\/files\/","message":"Storage not valid for mountpoint: \/REMOVED_USERID\/","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/76.0.3809.132 Safari\/537.36 OPR\/63.0.3368.71","version":"16.0.4.1"}
{"reqId":"REMOVED_REQID","level":2,"time":"2019-09-12T11:17:12+00:00","remoteAddr":"REMOVED_USERIP","user":"REMOVED_USERID","app":"no app in context","method":"GET","url":"\/apps\/files\/","message":"Storage not valid for mountpoint: \/REMOVED_USERID\/","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/76.0.3809.132 Safari\/537.36 OPR\/63.0.3368.71","version":"16.0.4.1"}
{"reqId":"REMOVED_REQID","level":3,"time":"2019-09-12T11:17:12+00:00","remoteAddr":"REMOVED_USERIP","user":"REMOVED_USERID","app":"index","method":"GET","url":"\/apps\/files\/","message":{"Exception":"OCP\\Files\\NotFoundException","Message":"","Code":0,"Trace":[{"file":"\/srv\/nextcloud\/www\/apps\/files\/lib\/Controller\/ViewController.php","line":129,"function":"getStorageInfo","class":"OC_Helper","type":"::","args":["\/",false]},{"file":"\/srv\/nextcloud\/www\/apps\/files\/lib\/Controller\/ViewController.php","line":170,"function":"getStorageInfo","class":"OCA\\Files\\Controller\\ViewController","type":"->","args":[]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"index","class":"OCA\\Files\\Controller\\ViewController","type":"->","args":["","",null,false]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files\\Controller\\ViewController"},"index"]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/AppFramework\/App.php","line":126,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files\\Controller\\ViewController"},"index"]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["ViewController","index",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"files.view.index"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"_route":"files.view.index"}]},{"file":"\/srv\/nextcloud\/www\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"files.view.index"}]},{"file":"\/srv\/nextcloud\/www\/lib\/base.php","line":975,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/apps\/files\/"]},{"file":"\/srv\/nextcloud\/www\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/srv\/nextcloud\/www\/lib\/private\/legacy\/helper.php","Line":488,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/76.0.3809.132 Safari\/537.36 OPR\/63.0.3368.71","version":"16.0.4.1"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

  'datadirectory' => '/srv/nextcloud/data',
  'overwrite.cli.url' => 'http://nextcloud.fcal.uner.edu.ar',
  'mysql.utf8mb4' => true,
  'installed' => true,
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => 'nextcloud.fcal.uner.edu.ar',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'default_language' => 'es_AR',
  'maintenance' => false,
  'loglevel' => 2,
  'mail_sendmailmode' => 'smtp',
  'memcache.local' => '\OC\Memcache\APCu',

The output of your Apache/nginx/system log in /var/log/____:

Access.log

REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:50:41 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:50:43 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:51:13 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:51:13 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:51:45 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:51:46 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:52:17 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:52:18 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:52:51 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:52:51 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:53:21 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:53:22 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 404 186 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:53:53 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:53:54 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:54:25 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:54:25 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:54:57 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:54:58 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:55:30 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:55:30 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:56:01 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:56:02 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:56:34 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:56:34 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:57:06 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:57:06 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:57:37 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:57:37 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:58:09 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:58:09 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:58:41 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:58:41 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 404 186 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:59:13 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:59:14 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:59:45 -0300] "GET /status.php HTTP/2.0" 200 136 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"
REMOVED_USERIP - REMOVED_USERNAME [12/Sep/2019:08:59:46 -0300] "PROPFIND /remote.php/dav/files/REMOVED_USERNAME/ HTTP/2.0" 500 218 "-" "Mozilla/5.0 (Windows) mirall/2.5.3daily-Win64 (build 20190725) (Nextcloud)"

(nothing in nginx’s error.log)

I know this thread is old but did you manage to solve that? I have the same problem and i am searching for a way to convert the remnant back to a regular user.

Greetings,
Michael