nextcloud / ldap_write_support

šŸ‘„šŸ–Ž create, edit and delete LDAP users and groups from Nextcloud
https://apps.nextcloud.com/apps/ldap_write_support
GNU Affero General Public License v3.0
29 stars 10 forks source link

ldap_write_support not working with nextcloud 29.0.0.19 #740

Open mrdrmmn opened 6 months ago

mrdrmmn commented 6 months ago

I'm new to nextcloud and have a fresh install of 29.0.0.19 with and ldap backend for users. authentication is working as expected and verified to be coming from LDAP. When I enable ldap_write_support, I immediately start seeing the following errors in my logs:

{"reqId":"pS4lTGpVaUwGwesjMBNL","level":4,"time":"2024-05-19T18:52:26+00:00","remoteAddr":"XXX.XXX.XXX.XXX","user":"--","app":"no app in context","method":"GET","url":"/remote.php/dav/","message":"Could not boot user_ldap: No LDAP provider is available","userAgent":"Nextcloud Server Crawler","version":"29.0.0.19","exception":{"Exception":"Exception","Message":"No LDAP provider is available","Code":0,"Trace":[{"file":"/mnt/data/var/nextcloud/html/lib/private/Server.php","line":1083,"function":"getLDAPProvider","class":"OC\\LDAP\\NullLDAPProviderFactory","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":175,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/mnt/data/var/nextcloud/html/3rdparty/pimple/pimple/src/Pimple/Container.php","line":122,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":142,"function":"offsetGet","class":"Pimple\\Container","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/ServerContainer.php","line":173,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":445,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":96,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":120,"function":"array_map"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":470,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":442,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":96,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":120,"function":"array_map"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":470,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/ServerContainer.php","line":155,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/EventDispatcher/ServiceEventListener.php","line":70,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/mnt/data/var/nextcloud/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":230,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/mnt/data/var/nextcloud/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":59,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/EventDispatcher/EventDispatcher.php","line":98,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/mnt/data/var/nextcloud/html/apps/user_ldap/lib/AppInfo/Application.php","line":143,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":66,"function":"OCA\\User_LDAP\\AppInfo\\{closure}","class":"OCA\\User_LDAP\\AppInfo\\Application","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Bootstrap/BootContext.php","line":50,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->"},{"file":"/mnt/data/var/nextcloud/html/apps/user_ldap/lib/AppInfo/Application.php","line":147,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\User_LDAP\\AppInfo\\Application","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/App/AppManager.php","line":437,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/App/AppManager.php","line":216,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/mnt/data/var/nextcloud/html/lib/private/legacy/OC_App.php","line":128,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/mnt/data/var/nextcloud/html/remote.php","line":155,"function":"loadApps","class":"OC_App","type":"::"}],"File":"/mnt/data/var/nextcloud/html/lib/private/LDAP/NullLDAPProviderFactory.php","Line":36,"message":"Could not boot user_ldap: No LDAP provider is available","exception":{},"CustomMessage":"Could not boot user_ldap: No LDAP provider is available"}}

But I do in fact have an LDAP provider configured and working.

I've been digging into the code and have not been able to determine what the exact problem is. I suspect maybe things have changed in nextcloud that have caused this to become an issue as I am sure others have been working just fine.

I'll continue to poke and it and if I can find a solution, I will update this.

mrdrmmn commented 6 months ago

This demonstrates a valid config:

# sudo -u www-data php occ ldap:test-config s01
The configuration is valid and the connection could be established!
# sudo -u www-data php occ ldap:check-user test
The user is still available on LDAP.

But any attempts to modify the password of an ldap user (sudo -u www-data php occ user:resetpassword test) generates the same error as provided in the initial report.

Let me know if there is anything I can do to provide better/more helpful detail.

Beerlesklopfer commented 4 months ago

I can confirm this with 29.0.3. The log is flooded with these errors, although there are no functional restrictions. It affects those users that are created as SQL/local.

{"reqId":"68bdmL8tuep3bqFHtZ1E","level":4,"time":"2024-07-08T00:16:41+02:00","remoteAddr":"2003:c8:9710:4200:64:77de:1605:1ca8","user":"PC-TECHNIK","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"Could not boot user_ldap: No LDAP provider is available","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0","version":"29.0.3.4","exception":{"Exception":"Exception","Message":"No LDAP provider is available","Code":0,"Trace":[{"file":"/[...]/nextcloud-29.0.0/lib/private/Server.php","line":1086,"function":"getLDAPProvider","class":"OC\\LDAP\\NullLDAPProviderFactory","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Utility/SimpleContainer.php","line":175,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/[...]/nextcloud-29.0.0/3rdparty/pimple/pimple/src/Pimple/Container.php","line":122,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Utility/SimpleContainer.php","line":142,"function":"offsetGet","class":"Pimple\\Container","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/ServerContainer.php","line":173,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":446,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Utility/SimpleContainer.php","line":96,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Utility/SimpleContainer.php","line":83,"function":"array_map"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":471,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":443,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Utility/SimpleContainer.php","line":96,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Utility/SimpleContainer.php","line":83,"function":"array_map"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":471,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/ServerContainer.php","line":155,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/EventDispatcher/ServiceEventListener.php","line":70,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/[...]/nextcloud-29.0.0/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":230,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/[...]/nextcloud-29.0.0/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":59,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/EventDispatcher/EventDispatcher.php","line":98,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/[...]/nextcloud-29.0.0/apps/user_ldap/lib/AppInfo/Application.php","line":143,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":45,"function":"OCA\\User_LDAP\\AppInfo\\{closure}","class":"OCA\\User_LDAP\\AppInfo\\Application","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Bootstrap/BootContext.php","line":50,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->"},{"file":"/[...]/nextcloud-29.0.0/apps/user_ldap/lib/AppInfo/Application.php","line":124,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\User_LDAP\\AppInfo\\Application","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/App/AppManager.php","line":437,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/App/AppManager.php","line":216,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/[...]/nextcloud-29.0.0/lib/private/legacy/OC_App.php","line":128,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/[...]/nextcloud-29.0.0/ocs/v1.php","line":54,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/[...]/nextcloud-29.0.0/ocs/v2.php","line":23,"args":["/[...]/nextcloud-29.0.0/ocs/v1.php"],"function":"require_once"}],"File":"/[...]/nextcloud-29.0.0/lib/private/LDAP/NullLDAPProviderFactory.php","Line":36,"message":"Could not boot user_ldap: No LDAP provider is available","exception":[],"CustomMessage":"Could not boot user_ldap: No LDAP provider is available"},"id":"668b13cf8771a"}
susnux commented 3 months ago

What is the value of ldapProviderFactory in your config?

come-nc commented 3 months ago

I cannot reproduce on latest main branch with server master. Did not test on 29.

come-nc commented 2 months ago

@mrdrmmn @Beerlesklopfer We need details on the situation to find the source of the problem because we are not able to reproduce it. Without answers I will close this ticket.