Getting numerous Undefined array key error messages in log regarding LDAP auth/sync

The Basics

  • Nextcloud Server version: 31.0.5
  • Operating system and version: Debian 12
  • Web server and version: Using AIO, not actually sure
  • Reverse proxy and version: Using AIO
  • PHP version: 8.3.20
  • Is this the first time you’ve seen this error? (Yes / No): No,been happening on several installs
  • When did this problem seem to first start?: As soon as LDAP is set up
  • Installation method _(e.g. AlO, NCP, Bare Metal/Archive, etc.): AIO install, LDAP/AD Integration app installed then configured
  • Are you using CloudfIare, mod_security, or similar?: No

Summary of the issue you are facing:

When setting up LDAP integration to authenticate against AD, I had set up an alternative attribute to use for the Account Name in NC. When using Sendent to sync to Exchange, it does not like the uid attribute that the integration defaults to. I specify the mail attribute to make the LDAP integration use the email address for each user as the account name within NC. This makes Sendent happy and starts to sync.

However: it appears that the LDAP integration is not happy. I get numerous error messages in the log now, sometimes as frequently as once per minute but usually every 10 minutes or so:

Error | PHP | Undefined array key "mail" at /var/www/html/apps/user_ldap/lib/Access.php#555

It would appear that the ldap scripts do not like me using the mail attribute as the internal username attribute.

Steps to replicate it (hint: details matter!):

  1. After base install of AIO, add ‘LDAP user and group backend’ app and enable
  2. Configure LDAP/AD Integration under admin settings to sync to domain controller
  3. before adding group to sync users, go to Expert and enter ‘mail’ for Internal Username Attribute. Settings should save as you change field entries.
  4. NC should start syncing users and groups as defined in the integration settings.
  5. After some time, the PHP error starts occurring in the log

Log entries

Nextcloud

{"reqId":"xFDN5FlVCCJn2MRxuNgR","level":3,"time":"2025-05-20T03:37:48+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Undefined array key \"mail\" at /var/www/html/apps/user_ldap/lib/Access.php#555","userAgent":"--","version":"31.0.5.1","data":{"app":"PHP"},"id":"682bfbda58954"}

Configuration

Nextcloud

{
    "system": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "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
            }
        ],
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "cloud.DOMAIN.biz",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "cloud.DOMAIN.biz"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "31.0.5.1",
        "overwrite.cli.url": "https:\/\/cloud.DOMAIN.biz\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "updatedirectory": "\/nc-updater",
        "loglevel": 2,
        "app_install_overwrite": [
            "nextcloud-aio"
        ],
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": 10485760,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "7": "OC\\Preview\\Krita",
            "0": "OC\\Preview\\Imaginary",
            "23": "OC\\Preview\\ImaginaryPDF"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": 30,
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "maintenance_window_start": 100,
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "documentation_url.server_logs": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/5425",
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpauth": true,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "US",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "DOMAIN": "cloud.DOMAIN.biz"
    }
}

Apps

Enabled:

  • activity: 4.0.0
  • admin_audit: 1.21.0
  • bruteforcesettings: 4.0.0
  • calendar: 5.2.4
  • circles: 31.0.0
  • cloud_federation_api: 1.14.0
  • comments: 1.21.0
  • contacts: 7.1.0
  • contactsinteraction: 1.12.0
  • dashboard: 7.11.0
  • dav: 1.33.0
  • deck: 1.15.1
  • federatedfilesharing: 1.21.0
  • federation: 1.21.0
  • files: 2.3.1
  • files_antivirus: 6.0.2
  • files_downloadlimit: 4.0.0
  • files_fulltextsearch: 31.0.0
  • files_pdfviewer: 4.0.0
  • files_reminders: 1.4.0
  • files_sharing: 1.23.1
  • files_trashbin: 1.21.0
  • files_versions: 1.24.0
  • firstrunwizard: 4.0.0
  • fulltextsearch: 31.0.0
  • fulltextsearch_elasticsearch: 31.0.0
  • logreader: 4.0.0
  • lookup_server_connector: 1.19.0
  • nextcloud-aio: 0.7.0
  • nextcloud_announcements: 3.0.0
  • notes: 4.12.0
  • notifications: 4.0.0
  • notify_push: 1.1.0
  • oauth2: 1.19.1
  • password_policy: 3.0.0
  • photos: 4.0.0-dev.1
  • privacy: 3.0.0
  • profile: 1.0.0
  • provisioning_api: 1.21.0
  • recommendations: 4.0.0
  • related_resources: 2.0.0
  • richdocuments: 8.6.5
  • sendentsynchroniser: 1.0.11
  • serverinfo: 3.0.0
  • settings: 1.14.0
  • sharebymail: 1.21.0
  • spreed: 21.0.4
  • support: 3.0.0
  • survey_client: 3.0.0
  • systemtags: 1.21.1
  • tasks: 0.16.1
  • text: 5.0.0
  • theming: 2.6.1
  • twofactor_backupcodes: 1.20.0
  • twofactor_totp: 13.0.0-dev.0
  • user_ldap: 1.22.0
  • user_status: 1.11.0
  • viewer: 4.0.0
  • weather_status: 1.11.0
  • webhook_listeners: 1.2.0
  • whiteboard: 1.0.5
  • workflowengine: 2.13.0
    Disabled:
  • app_api: 5.0.2 (installed 5.0.2)
  • encryption: 2.19.0
  • files_external: 1.23.0
  • suspicious_login: 9.0.1
  • twofactor_nextcloud_notification: 5.0.0

Follow up for anyone having this issue: looks like you need to specify the Override UUID detection setting in the Expert tab under LDAP/AD integration. I had set the first field in the Expert tab, Internal Username Attribute, to mail and that accomplished my main goal of using the email address for the internal user account name in NC. Sendent was having problems using the LDAP uid as the account name since MS Exchange does -not- use that to process logins and data exchange. By doing this, NC has a bit of a problem in that the Internal Username is now not a defined primary key. By specifying the Override UUID and setting it to the same LDAP attribute as the Internal Username, that seems to have fixed the issue.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.