ldap_write_support icon indicating copy to clipboard operation
ldap_write_support copied to clipboard

ldap_write_support not working with nextcloud 29.0.0.19

Open mrdrmmn opened this issue 1 year ago β€’ 11 comments

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 avatar May 19 '24 19:05 mrdrmmn

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.

mrdrmmn avatar May 19 '24 22:05 mrdrmmn

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"}

Beerlesklopfer avatar Jul 07 '24 22:07 Beerlesklopfer

What is the value of ldapProviderFactory in your config?

susnux avatar Aug 19 '24 15:08 susnux

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

come-nc avatar Aug 19 '24 15:08 come-nc

@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.

come-nc avatar Sep 17 '24 09:09 come-nc

I have the same error with 1.12.0 and NC 30.0.5. Looking at occ config:list "ldap_write_support": { "types": "", "createPreventFallback": "1", "enabled": "yes", "installed_version": "1.12.0" } The configuration of LDAP don't have any "Writting" section in the LDAP integration

Image

There is no reference to ldapProviderFactory in occ config:list or the config.php file.

ajdelgado avatar Jan 26 '25 17:01 ajdelgado

So, occ config:system:get ldapProviderFactory returns nothing?

There is a repair step on enable user_ldap which should set it, so that’s weird. Did you install user_ldap a long time ago?

Maybe try to disable it and enable it again?

come-nc avatar Jan 27 '25 10:01 come-nc

I have the same error with 1.12.0 and NC 30.0.5. Looking at occ config:list "ldap_write_support": { "types": "", "createPreventFallback": "1", "enabled": "yes", "installed_version": "1.12.0" } The configuration of LDAP don't have any "Writting" section in the LDAP integration

Image

There is no reference to ldapProviderFactory in occ config:list or the config.php file.

Hello, same issue as ajdelgado can't find the write section

php occ config:system:get ldapProviderFactory
OCA\User_LDAP\LDAPProviderFactory

Worked fine a long time ago so i have a config from occ config:list

"ldap_write_support": {
            "createPreventFallback": "1",
            "createRequireActorFromLdap": "1",
            "enabled": "yes",
            "hasAvatarPermission": "1",
            "installed_version": "1.12.0",
            "template.user": "MyLdapStringGoesHere",
            "types": ""
        },

Tried to disable, enable, even remove and reinstall app

RomualdLewandoski avatar Feb 04 '25 09:02 RomualdLewandoski

@RomualdLewandoski Do you have the same error in the logs or another one?

come-nc avatar Feb 04 '25 16:02 come-nc

@RomualdLewandoski Do you have the same error in the logs or another one?

Hello, no i don't find the same error, the only one i had whas :

{"reqId":"PqkAP90yO87BAZDe8DwA","level":3,"time":"2025-02-04T09:54:01+00:00","remoteAddr":"X.X.X.X","user":"MyUSer","app":"jsresourceloader","method":"GET","url":"/index.php/settings/admin/ldap","message":"Could not find resource ldap_write_support/js/ldap_write_suppport-admin-settings.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36","version":"30.0.0.14","data":{"app":"jsresourceloader"},"id":"67a34b096bae7"}

Also was unable to edit how member is created so failed to set password

{"reqId":"pxsmo5x1AzKqg1Pplkzj","level":3,"time":"2025-02-04T10:36:47+00:00","remoteAddr":"X.X.X.X","user":"MyUSer","app":"ldap_write_support","method":"POST","url":"/ocs/v2.php/cloud/users","message":"Failed to set password for user MyUser using ldap_exop_passwd","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36","version":"30.0.0.14","data":{"app":"ldap_write_support","ldap_error":"Confidentiality required"},"id":"67a34b096b969"}

Who seems to be more linked with #844 sorry

RomualdLewandoski avatar Feb 05 '25 11:02 RomualdLewandoski

Can you upgrade the application and retest?

come-nc avatar Feb 18 '25 12:02 come-nc