# LDAP configuration became inaccessible after upgrade to 21

**URL:** <https://help.nextcloud.com/t/ldap-configuration-became-inaccessible-after-upgrade-to-21/121997>\
**Category:** ℹ️ Support\
**Tags:** update\_problems, ldap\
**Created:** [August 17, 2021, 7:54am UTC](https://help.nextcloud.com/t/ldap-configuration-became-inaccessible-after-upgrade-to-21/121997 "2021-08-17T07:54:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stannum](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stannum/32/2939_2.png) [@stannum](https://help.nextcloud.com/u/stannum)\
**Post date:** [August 17, 2021, 7:54am UTC](https://help.nextcloud.com/t/ldap-configuration-became-inaccessible-after-upgrade-to-21/121997/1 "2021-08-17T07:54:49Z")

</div>

After upgrade to 21 faced a problem with configured ldap settings, that setting can’t be even displayed in settings page. At the same time LDAP users can login and it seems that everything is OK with them. LDAP configuration profile is displayed in listbox but the setting behind it is not loading and can’t be edited.

Nextcloud version: 21.0.4.1  
Operating system and version: Debian GNU/Linux 10 (buster)  
nginx version: 1.14.2  
PHP version: 7.4  
Steps to replicate it:

1. Go to LDAP integration settings
2. Make sure that you have selected active LDAP integration settings profile
3. Selected profile should have editable fields with current settings, but all fields are empty

The output of your Nextcloud log in **Admin \> Logging** :

```auto
Error	core	Error: Method OC\L10N\L10NString::__toString() must return a string value	
2021-08-17T10:15:08+0300
Error	PHP	Error: vsprintf(): Too few arguments at /var/www/nextcloud/lib/private/L10N/L10NString.php#79	
2021-08-17T10:15:08+0300
Error	core	Error: Method OC\L10N\L10NString::__toString() must return a string value	
2021-08-17T10:00:07+0300
Error	PHP	Error: vsprintf(): Too few arguments at /var/www/nextcloud/lib/private/L10N/L10NString.php#79	
2021-08-17T10:00:07+0300
Error	core	Error: Method OC\L10N\L10NString::__toString() must return a string value	
2021-08-17T09:45:08+0300
Error	PHP	Error: vsprintf(): Too few arguments at /var/www/nextcloud/lib/private/L10N/L10NString.php#79	
2021-08-17T09:45:08+0300

```

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

```auto
<?php
$CONFIG = array (
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' =>
  array (
    0 => ' *****',
  ),
  'datadirectory' => '/nextcloud/data',
  'overwrite.cli.url' => 'https:// ***** /nextcloud',
  'dbtype' => 'pgsql',
  'version' => '21.0.4.1',
  'dbname' => '**',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => '**',
  'dbpassword' => '**',
  'installed' => true,
  'ldapIgnoreNamingRules' => false,
  'forcessl' => false,
  'mail_from_address' => 'file',
  'mail_smtpmode' => 'smtp',
  'mail_domain' => '***',
  'mail_smtphost' => '***',
  'mail_smtpport' => '25',
  'loglevel' => 0,
  'logtimezone' => 'Europe/Moscow',
  'theme' => '',
  'maintenance' => false,
  'singleuser' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filesystem_check_changes' => 1,
  'ldapUserCleanupInterval' => 15,
  'log_rotate_size' => 104857600,
  'trashbin_retention_obligation' => 'auto',
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'smtp-auth',
  'mail_smtppassword' => '***',
  'mysql.utf8mb4' => true,
  'updater.release.channel' => 'stable',
  'encryption.legacy_format_support' => false,
  'encryption.key_storage_migrated' => false,
  'updater.secret' => '***',
  'default_phone_region' => 'RU',
);

```

/var/log/nginx/error.log:

```auto
2021/08/17 08:33:25 [error] 716#716: *6030 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Class 'OC_JSON' not found in /var/www/nextcloud/apps/user_ldap/ajax/getConfiguration.php:30
Stack trace:
#0 {main}
  thrown in /var/www/nextcloud/apps/user_ldap/ajax/getConfiguration.php on line 30" while reading response header from upstream, client: 195.201.103.77, server: ***, request: "POST /apps/user_ldap/ajax/getConfiguration.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "***"
2021/08/17 10:29:32 [error] 716#716: *6706 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Class 'OC_JSON' not found in /var/www/nextcloud/apps/user_ldap/ajax/getConfiguration.php:30
Stack trace:
#0 {main}
  thrown in /var/www/nextcloud/apps/user_ldap/ajax/getConfiguration.php on line 30" while reading response header from upstream, client: 10.4.22.105, server: ***, request: "POST /apps/user_ldap/ajax/getConfiguration.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "***"

```

---

<div class="post-metadata">

**Author:** ![stannum](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stannum/32/2939_2.png) [@stannum](https://help.nextcloud.com/u/stannum)\
**Post date:** [August 17, 2021, 10:56am UTC](https://help.nextcloud.com/t/ldap-configuration-became-inaccessible-after-upgrade-to-21/121997/2 "2021-08-17T10:56:39Z")

</div>

This is how it looks when get to discussed LDAP settings page:

 ![2021-08-17_10-30_1](https://help.nextcloud.com/uploads/default/original/3X/c/5/c5d94e5fc1ae2f0e7839c19b70be639a285bd445.png)

This is how it looks in output from CLI:

> sudo -u www-data php7.4 /var/www/nextcloud/occ ldap:show-config

```auto
+-------------------------------+------------------------------------------------------------------------------------------------------------------------+
| Configuration | |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport | 1 |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAgentName | CN=bind user,DC=example,DC=net |
| ldapAgentPassword | *** |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackupHost | |
| ldapBackupPort | |
| ldapBase | DC=example,DC=net |
| ldapBaseGroups | DC=example,DC=net |
| ldapBaseUsers | DC=example,DC=net |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapDefaultPPolicyDN | |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | mail |
| ldapExperiencedAdmin | 0 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | |
| ldapExpertUsernameAttr | |
| ldapExtStorageHomeAttribute | |
| ldapGidNumber | gidNumber |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (&(|(objectclass=group))(|(cn=Domain Users)(cn=RCOD Admins))) |
| ldapGroupFilterGroups | Domain Users;RCOD Admins |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | group |
| ldapGroupMemberAssocAttr | uniqueMember |
| ldapHost | ldap://*** |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(&(objectCategory=person)(mail=*)(objectClass=user))(|(samaccountname=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid)))) |
| ldapLoginFilterAttributes | |
| ldapLoginFilterEmail | 1 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapMatchingRuleInChainState | unknown |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | |
| ldapPagingSize | 500 |
| ldapPort | 389 |
| ldapQuotaAttribute | |
| ldapQuotaDefault | 10 GB |
| ldapTLS | 0 |
| ldapUserAvatarRule | default |
| ldapUserDisplayName | displayname |
| ldapUserDisplayName2 | |
| ldapUserFilter | (&(objectCategory=person)(mail=*)(objectClass=user)) |
| ldapUserFilterGroups | |
| ldapUserFilterMode | 1 |
| ldapUserFilterObjectclass | person |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| turnOffCertCheck | 0 |
| turnOnPasswordChange | 0 |
| useMemberOfToDetectMembership | 1 |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------+
                                                                                                                                           

```

---

<div class="post-metadata">

**Author:** ![politas](https://help.nextcloud.com/user_avatar/help.nextcloud.com/politas/32/33448_2.png) [@politas](https://help.nextcloud.com/u/politas)\
**Post date:** [August 17, 2021, 9:20pm UTC](https://help.nextcloud.com/t/ldap-configuration-became-inaccessible-after-upgrade-to-21/121997/3 "2021-08-17T21:20:52Z")

</div>

I’m having this same problem. I “resolved” it by reverting my NGINX configuration to the NC19 version as suggested [here](https://github.com/nextcloud/server/issues/16194#issuecomment-707193575). I am not sure yet whether [this](https://github.com/nextcloud/documentation/pull/2197#issuecomment-721432337) is a better solution.  
[This](https://github.com/nextcloud/server/issues/27871) seems to be the clearest bug report.

---

<div class="post-metadata">

**Author:** ![stannum](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stannum/32/2939_2.png) [@stannum](https://help.nextcloud.com/u/stannum)\
**Post date:** [August 20, 2021, 9:46am UTC](https://help.nextcloud.com/t/ldap-configuration-became-inaccessible-after-upgrade-to-21/121997/4 "2021-08-20T09:46:48Z")

</div>

I can confirm that adding this line to nginx site configuration resolves this issue.

> <https://github.com/nextcloud/documentation/pull/2197#issuecomment-721432337>
>
> After inspecting the Nginx configs currently seen at \[https://docs.nextcloud.co…m/server/19/admin\_manual/installation/nginx.html \], I have notice that they are very redundant in some areas, and handle specific paths in special ways which are not needed, and which run the risk of needing to become more specific down the road if NextCloud adds new features, as well as not handling all static filetypes. I have reworked the configs from scratch by directly adapting the \`.htaccess\` files, and this is the result. Comments are included in the file to give rationale/explanation for why things are written in this new way, and if the maintainers decide to accept this pull request, I will leave it up to them to decide whether to include these expository comments upstream.

```auto
        rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;

```

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 13, 2024, 10:29am UTC](https://help.nextcloud.com/t/ldap-configuration-became-inaccessible-after-upgrade-to-21/121997/5 "2024-12-13T10:29:27Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 13, 2024, 10:29am UTC](https://help.nextcloud.com/t/ldap-configuration-became-inaccessible-after-upgrade-to-21/121997/6 "2024-12-13T10:29:29Z")

</div>


