Cannot connect LDAP/AD after upgrade NC 19.0.3 to 20.0.1

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via 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:


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


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 20.0.1
Operating system and version: FreeBSD nextcloud2 11.3-RELEASE-p14
Apache or nginx version: nginx/1.18.0
PHP version: PHP 7.4.11

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y
LDAP/AD cannot detect port of the LDAP server, not show any error.

Based on my personal experiences, an answer will most likely faster being provided, if you describe your problem IN DETAIL in more than one sentence.

How do you know that the port of the LDAP server cannot be evaluated, if you only provide a screenshot with empty fields and you aren’t providing any error message or excerpt from the Nextcloud log file?!

really i cannot see any logs (i check in /var/log/nextcloud/nexcloud.log and http://IP_add/settings/admin/logging)
I have filled out all information, but cannot press continue or Advance or expert.

What happens if you press the “Test Base DN” button first to test the server access?


if using NC 19.0.1, can showing any issue configure on the LDAP/AD

sudo -u www php /usr/local/www/nextcloud/occ app:check-code user_ldap
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see
An unhandled exception has been thrown:
Error: Undefined constant ‘T_DOUBLE_COLON’ in /usr/local/www/nextcloud/3rdparty/nikic/php-parser/lib/PhpParser/Lexer.php:385
Stack trace:
#0 /usr/local/www/nextcloud/3rdparty/nikic/php-parser/lib/PhpParser/Lexer.php(38): PhpParser\Lexer->createTokenMap()
#1 /usr/local/www/nextcloud/3rdparty/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php(39): PhpParser\Lexer->__construct()
#2 /usr/local/www/nextcloud/3rdparty/nikic/php-parser/lib/PhpParser/ParserFactory.php(23): PhpParser\Lexer\Emulative->__construct()
#3 /usr/local/www/nextcloud/lib/private/App/CodeChecker/CodeChecker.php(60): PhpParser\ParserFactory->create()
#4 /usr/local/www/nextcloud/core/Command/App/CheckCode.php(95): OC\App\CodeChecker\CodeChecker->__construct()
#5 /usr/local/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\App\CheckCode->execute()
#6 /usr/local/www/nextcloud/3rdparty/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run()
#7 /usr/local/www/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand()
#8 /usr/local/www/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun()
#9 /usr/local/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#10 /usr/local/www/nextcloud/console.php(100): OC\Console\Application->run()
#11 /usr/local/www/nextcloud/occ(11): require_once(’/usr/local/www/…’)
#12 {main}root@nextcloud2:/usr/local/www/nextcloud/apps-pkg/user_ldap/ajax #

Run the following (your “nextcloud” directory may be different):

sudo -u www-data php /opt/nextcloud/occ app:check-code user_ldap

If you see something like this, you have an issue that has been discussed in another thread:

Analysing /opt/nextcloud/apps/user_ldap/ajax/deleteConfiguration.php
 5 errors
    line   30: OC_JSON - Static method of deprecated class must not be called
    line   31: OC_JSON - Static method of deprecated class must not be called
    line   32: OC_JSON - Static method of deprecated class must not be called
    line   37: OC_JSON - Static method of deprecated class must not be called
    line   40: OC_JSON - Static method of deprecated class must not be called

See: for more information.

Have you been able to resolve this? I am in the same situation on nextcloud 21, php-8.

user_ldap app is non-conformant. Any LDAP request on already configured LDAP connection fails. If I try to remove the LDAP setting and create a new one I end up with spinning ‘Detect Port’. No logs.

I have solved this problem already
try this one: LDAP / AD integration Nextcloud 18.0.1

Thank you. I must admit that I did not find exact root cause. After upgrading to NC 21.0.1 the issue disappeared.

yes, It is also a solution