nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.44k stars 4.08k forks source link

[Bug]: LDAP: `The Base DN appears to be wrong` #44896

Open arno4000 opened 7 months ago

arno4000 commented 7 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

When trying to set up a new LDAP connection, the setup wizard failes at the first steps with the error message The Base DN appears to be wrong and An error occurred. Please check the Base DN, as well as connection settings and credentials. when clicking on Test Base DN.

When executing ldapsearch from the Nextcloud Container, I can contact my LDAP server and query users. So I think there is no issue with my LDAP server or the network connection to it.

In the dev console of the browser, I can see the following messages: will not save undefined key: ldap_base will not save undefined key: ldap_dn

When starting a dev instance in a docker container on my local machine, I get an error that the LDAP server cannot be reached (which is true) and I can click on Detect Port, which does not work in my already existing instance. I am using SAML to for the user login, but I want to add LDAP, so I can automatically delete users, which are no longer existing.

I am using Nextcloud Version 27.1.7

Steps to reproduce

  1. Go to admin settings
  2. Go to LDAP/AD integration
  3. Try to set up a connection and click on Test Base DN
  4. Get errors and be unable to proceed.

Expected behavior

It is possible to set up a LDAP connection in the GUI wizard.

Installation method

Community Docker image

Nextcloud Server version

27

Operating system

Debian/Ubuntu

PHP engine version

None

Web server

Nginx

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a MINOR version (ex. 22.1 to 22.2)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "default_phone_region": "ch",
        "proxy": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 8080
        },
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": "6379",
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpsecure": "tls",
        "mail_smtpauth": false,
        "mail_smtpauthtype": "none",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "27.1.7.2",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "ldapUserCleanupInterval": "5",
        "skeletondirectory": "",
        "log_rotate_size": "5242880000",
        "loglevel": 2,
        "maintenance": false,
        "theme": "",
        "app_install_overwrite": [
            "files_downloadactivity"
        ]
    }
}

List of activated Apps

Enabled:
  - activity: 2.19.0
  - admin_audit: 1.17.0
  - announcementcenter: 6.7.0
  - bruteforcesettings: 2.7.0
  - checksum: 1.2.3
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contactsinteraction: 1.8.0
  - dav: 1.27.0
  - drawio: 2.1.4
  - external: 5.2.1
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_antivirus: 5.4.1
  - files_automatedtagging: 1.17.0
  - files_bpm: 1.2.0
  - files_downloadactivity: 1.16.0
  - files_external: 1.19.0
  - files_mindmap: 0.0.30
  - files_pdfviewer: 2.8.0
  - files_reminders: 1.0.0
  - files_retention: 1.16.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - metadata: 0.19.0
  - nextcloud_announcements: 1.16.0
  - notifications: 2.15.0
  - oauth2: 1.15.2
  - password_policy: 1.17.0
  - photos: 2.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - support: 1.10.0
  - survey_client: 1.15.0
  - suspicious_login: 5.0.0
  - systemtags: 1.17.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - twofactor_totp: 9.0.0
  - updatenotification: 1.17.0
  - user_ldap: 1.17.0
  - user_saml: 5.2.6
  - user_status: 1.7.0
  - user_usage_report: 1.11.1
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - workflowengine: 2.9.0
Disabled:
  - circles: 27.0.1 (installed 26.0.0)
  - dashboard: 7.7.0 (installed 7.5.0)
  - encryption: 2.15.0

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

arno4000 commented 6 months ago

Any news on this issue? It is very annoying to setup a fresh instance, to configure all settings and then manually transfer them over with occ. We have this issue on all our instances.