Login Failed: Could not get user object for DN, Maybe the LDAP entry has no set display name attribute?

Nextcloud version (eg, 20.0.5): 24.0.11, used as App in univention
Operating system and version (eg, Ubuntu 20.04): docker, ubuntu 20.04.6 LTS
Apache or nginx version (eg, Apache 2.4.25): 2.4.41
PHP version (eg, 7.4): 7.4.3

The issue you are facing:
User Logon fails. It is reported “Invalid username or password”.
Looking at the log:watch it is stated
Warning user_ldap LDAP Login: Could not get user object for DN 2023-06-09T10:16:34+00:00
uid=hemp… Maybe the LDAP entry has no set display name attribute?
Credentials are good as logon on other apps possible

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. more often seen after creating new user, but also for some existing users
  2. Login to nextcloud with valid credentials
  3. Logon failed with error message above

The output of your Nextcloud log in Admin > Logging:

{"reqId":"Np5gz4PQT8mRIMaqdHpd","level":2,"time":"2023-06-09T10:16:34+00:00","remoteAddr":"xx.xx.xx.xx","user":"--","app":"user_ldap","method":"POST","url":"/nextcloud/login","message":"LDAP Login: Could not get user object for DN uid=hemp.... Maybe the LDAP entry has no set display name attribute?","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0","version":"24.0.11.1","data":{"app":"user_ldap"},"id":"6482fcea506ba"}
**Formatted:** 
|Level|App|Message||Time|
| --- | --- | --- | --- | --- |
|Warning|no app in context|Login failed: hemp (Remote IP: xx.xx.xx.xx)||

2023-06-09T12:16:34+0200
Warning user_ldap LDAP Login: Could not get user object for DN uid=hemp... Maybe the LDAP entry has no set display name attribute?

2023-06-09T12:16:34+0200
Warning user_ldap LDAP Login: Could not get user object for DN uid=hemp... Maybe the LDAP entry has no set display name attribute?

2023-06-09T12:16:34+0200

The output of your Apache/nginx/system log in /var/log/____:

apache2/error.log
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using xy.xy.xy.xy. Set the 'ServerName' directive globally to suppress this message
[Fri Jun 09 11:10:02.927403 2023] [mpm_prefork:notice] [pid 62] AH00163: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations

no entries in access.log for this action

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{“reqId”:“Np5gz4PQT8mRIMaqdHpd”,“level”:2,“time”:“2023-06-09T10:16:34+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“user_ldap”,“method”:“POST”,“url”:“/nextcloud/login”,“message”:“LDAP Login: Could not get user object for DN uid=hemp… Maybe the LDAP entry has no set display name attribute?”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0”,“version”:“24.0.11.1”,“data”:{“app”:“user_ldap”}}
{“reqId”:“Np5gz4PQT8mRIMaqdxxd”,“level”:2,“time”:“2023-06-09T10:16:34+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“user_ldap”,“method”:“POST”,“url”:“/nextcloud/login”,“message”:“LDAP Login: Could not get user object for DN uid=hemp… Maybe the LDAP entry has no set display name attribute?”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0”,“version”:“24.0.11.1”,“data”:{“app”:“user_ldap”}}
{“reqId”:“Np5gz4PQT8mRIMaqdxxd”,“level”:2,“time”:“2023-06-09T10:16:34+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”, “method”:“POST”,“url”:“/nextcloud/login”,“message”:“Login failed: hempelk (Remote IP: )”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0”,“version”:“24.0.11.1”,“data”:}


Checked already 
https://help.nextcloud.com/t/ldap-login-could-not-get-user-object-for-dn-proper-dn-here-maybe-the-ldap-entry-has-no-set-display-name-attribute/104479
but did not help.