Support intro
Sorry to hear you’re facing problems. 
The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.
If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.
Getting help
In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.
Before clicking submit: Please check if your query is already addressed via the following resources:
- Official documentation (searchable and regularly updated)
- How to topics and FAQs
- Forum search
(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).
The Basics
- Nextcloud Server version :
32
- Operating system and version:
- FreeBSD 14-RELEASE-p4
- Web server and version (e.g, Apache 2.4.25):
Apache 2.4.65
- Reverse proxy and version _(e.g. nginx 1.27.2)
haproxy 3.2.6
- PHP version (e.g, 8.3):
PHP 8.4.13
- Is this the first time you’ve seen this error? (Yes / No):
- Yes
- When did this problem seem to first start?
After Upgrade to verison 32
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
CLI
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
No
Summary of the issue you are facing:
CLI commands report Lost connection to LDAP server.
Steps to replicate it (hint: details matter!):
-
php occ files:scan --all --unscanned --generate-metadata
In LDAP.php line 367:
Lost connection to LDAP server.
files:scan [–output [OUTPUT]] [-p|–path PATH] [–generate-metadata [GENERATE-METADATA]] [–all] [–unscanned] [–shallow] [–home-only] [–] [<user_id>…]
Nextcloud
Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.
{"reqId":"ZWkRStqOUFL9wn0v1QeS","level":2,"time":"2025-10-09T19:30:03+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"Main LDAP not reachable, connecting to backup: Lost connection to LDAP server.","userAgent":"--","version":"32.0.0.13","exception":{"Exception":"OC\\ServerNotAvailableException","Message":"Lost connection to LDAP server.","Code":0,"Trace":[{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/LDAP.php","line":405,"function":"processLDAPError","class":"OCA\\User_LDAP\\LDAP","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***",-1,"Can't contact LDAP server"]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/LDAP.php","line":287,"function":"postFunctionCall","class":"OCA\\User_LDAP\\LDAP","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/LDAP.php","line":44,"function":"invokeLDAPMethod","class":"OCA\\User_LDAP\\LDAP","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/Connection.php","line":750,"function":"bind","class":"OCA\\User_LDAP\\LDAP","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/Connection.php","line":644,"function":"bind","class":"OCA\\User_LDAP\\Connection","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/Connection.php","line":234,"function":"establishConnection","class":"OCA\\User_LDAP\\Connection","type":"->","args":[]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/Connection.php","line":242,"function":"init","class":"OCA\\User_LDAP\\Connection","type":"->","args":[]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/Access.php","line":1118,"function":"getConnectionResource","class":"OCA\\User_LDAP\\Connection","type":"->","args":[]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/Access.php","line":1294,"function":"executeSearch","class":"OCA\\User_LDAP\\Access","type":"->","args":["(&(&(|(objectclass=person))(|(|(memberof=CN=NextCloud Admins,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1120))(|(memberof=CN=NextCloud Users,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1119))))(displayname=*)(displayname=*))","DC=dweimer,DC=me",["entryuuid","nsuniqueid","objectguid","guid","ipauniqueid","And 6 more entries, set log level to debug to see all entries"],500,0]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/Access.php","line":985,"function":"search","class":"OCA\\User_LDAP\\Access","type":"->","args":["(&(&(|(objectclass=person))(|(|(memberof=CN=NextCloud Admins,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1120))(|(memberof=CN=NextCloud Users,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1119))))(displayname=*)(displayname=*))","DC=dweimer,DC=me",["entryuuid","nsuniqueid","objectguid","guid","ipauniqueid","And 6 more entries, set log level to debug to see all entries"],null,0]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/Access.php","line":894,"function":"searchUsers","class":"OCA\\User_LDAP\\Access","type":"->","args":["(&(&(|(objectclass=person))(|(|(memberof=CN=NextCloud Admins,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1120))(|(memberof=CN=NextCloud Users,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1119))))(displayname=*)(displayname=*))",["entryuuid","nsuniqueid","objectguid","guid","ipauniqueid","And 6 more entries, set log level to debug to see all entries"],null,null]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/User_LDAP.php","line":235,"function":"fetchListOfUsers","class":"OCA\\User_LDAP\\Access","type":"->","args":["(&(&(|(objectclass=person))(|(|(memberof=CN=NextCloud Admins,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1120))(|(memberof=CN=NextCloud Users,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1119))))(displayname=*)(displayname=*))",["entryuuid","nsuniqueid","objectguid","guid","ipauniqueid","And 6 more entries, set log level to debug to see all entries"],null,null]},{"file":"/usr/local/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":161,"function":"getUsers","class":"OCA\\User_LDAP\\User_LDAP","type":"->","args":["",null,null]},{"file":"/usr/local/www/nextcloud/lib/private/User/Manager.php","line":267,"function":"getUsers","class":"OCA\\User_LDAP\\User_Proxy","type":"->","args":["",null,null]},{"file":"/usr/local/www/nextcloud/apps/files/lib/Command/Scan.php","line":203,"function":"search","class":"OC\\User\\Manager","type":"->","args":[""]},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":326,"function":"execute","class":"OCA\\Files\\Command\\Scan","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/usr/local/www/nextcloud/core/Command/Base.php","line":218,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Application.php","line":1078,"function":"run","class":"OC\\Core\\Command\\Base","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Application.php","line":324,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"OCA\\Files\\Command\\Scan"},{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Application.php","line":175,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/usr/local/www/nextcloud/lib/private/Console/Application.php","line":187,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/usr/local/www/nextcloud/console.php","line":90,"function":"run","class":"OC\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"}]},{"file":"/usr/local/www/nextcloud/occ","line":33,"args":["/usr/local/www/nextcloud/console.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/apps/user_ldap/lib/LDAP.php","Line":367,"message":"Main LDAP not reachable, connecting to backup: {msg}","exception":{},"CustomMessage":"Main LDAP not reachable, connecting to backup: Lost connection to LDAP server."}}
Web Browser
If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.
No issues through web interface. Users can login, LDAP configuration page reports successful connection tests
Web server / Reverse Proxy
The output of your Apache/nginx/system log in /var/log/____:
No errors logged in Apache or PHP on system.
Configuration
Nextcloud
The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):
php occ ldap:show-config
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Configuration | s01 |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport | 1 |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAdminGroup | |
| ldapAgentName | CN=Service NextCloud,CN=Users,DC=dweimer,DC=me |
| ldapAgentPassword | *** |
| ldapAttributeAddress | |
| ldapAttributeAnniversaryDate | |
| ldapAttributeBiography | |
| ldapAttributeBirthDate | |
| ldapAttributeFediverse | |
| ldapAttributeHeadline | |
| ldapAttributeOrganisation | |
| ldapAttributePhone | |
| ldapAttributePronouns | |
| ldapAttributeRole | |
| ldapAttributeTwitter | |
| ldapAttributeWebsite | |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackgroundHost | |
| ldapBackgroundPort | |
| ldapBackupHost | ldaps://sambabdc.dweimer.me |
| ldapBackupPort | 636 |
| ldapBase | DC=dweimer,DC=me |
| ldapBaseGroups | DC=dweimer,DC=me |
| ldapBaseUsers | DC=dweimer,DC=me |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapConnectionTimeout | 15 |
| ldapDefaultPPolicyDN | |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | mail |
| ldapExperiencedAdmin | 0 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | |
| ldapExpertUsernameAttr | |
| ldapExtStorageHomeAttribute | |
| ldapGidNumber | gidnumber |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (&(|(objectclass=group))(|(cn=NextCloud Admins)(cn=NextCloud Users))) |
| ldapGroupFilterGroups | NextCloud Admins;NextCloud Users |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | group |
| ldapGroupMemberAssocAttr | member |
| ldapHost | ldaps://samba.dweimer.me |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(&(|(objectclass=person))(|(|(memberof=CN=NextCloud Admins,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1120))(|(memberof=CN=NextCloud Users,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1119))))(|(samaccountname=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid))(|(mail=%uid)(memberOf=%uid)))) |
| ldapLoginFilterAttributes | mail;memberOf |
| ldapLoginFilterEmail | 1 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapMatchingRuleInChainState | unknown |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | |
| ldapPagingSize | 500 |
| ldapPort | 636 |
| ldapQuotaAttribute | |
| ldapQuotaDefault | |
| ldapTLS | 0 |
| ldapUserAvatarRule | default |
| ldapUserDisplayName | displayname |
| ldapUserDisplayName2 | |
| ldapUserFilter | (&(|(objectclass=person))(|(|(memberof=CN=NextCloud Admins,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1120))(|(memberof=CN=NextCloud Users,OU=Groups,DC=dweimer,DC=me)(primaryGroupID=1119)))) |
| ldapUserFilterGroups | NextCloud Admins;NextCloud Users |
| ldapUserFilterMode | 0 |
| ldapUserFilterObjectclass | person |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| markRemnantsAsDisabled | 0 |
| turnOffCertCheck | 1 |
| turnOnPasswordChange | 0 |
| useMemberOfToDetectMembership | 1 |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Apps
The output of occ app:list (if possible).
Tips for increasing the likelihood of a response
- Use the
preformatted textformatting option in the editor for all log entries and configuration output. - If screenshots are useful, feel free to include them.
- If possible, also include key error output in text form so it can be searched for.
- Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.