Test LDAP connection OK but login fails

Must-share information (formatted with Markdown):

  • Test server running sonarqube 9.9 LTS
  • deployed via zip file

I stood up this test server a while back, and initially logging in worked as expected. However, after coming back to this test server today, I’m unable to authenticate despite the LDAP connection still appearing as OK in the server logs (attached). When I try to log in on the webpage, after entering my credentials and hitting Enter, the progress icon spins for a while and eventually throws an error saying Authentication Failed. Strangely, I’m not seeing any kind of error in the logs when this happens, even with DEBUG level logs enabled. I’ve checked that the server is still able to reach our internal LDAP server using ldapsearch, and I’ve checked my config with our LDAP admin. My configuration is as follows:

# Enable the LDAP feature
sonar.security.realm=LDAP
sonar.authenticator.createUsers=true
sonar.security.savePassword=true
sonar.security.updateUserAttributes=true

ldap.realm=mycompany.com
ldap.url=ldap://1.2.3.4:389

ldap.bindDn=CN=service acct,CN=Users,DC=mycompany,DC=com
ldap.bindPassword=******************

# User Configuration
ldap.user.baseDn=dc=mycompany,dc=com
ldap.user.request=(&(objectClass=user)(sAMAccountName={login}))
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail

sonarlogs.zip (1.9 MB)

I’ve attached a zip of the logs directory, hopefully that proves helpful.

Hi,

I think I’ve found something starting at line 14770 of web.log:

javax.naming.PartialResultException: null
	at java.naming/com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMoreImpl(AbstractLdapNamingEnumeration.java:237)
	at java.naming/com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMore(AbstractLdapNamingEnumeration.java:189)
	at org.sonar.auth.ldap.LdapSearch.hasMore(LdapSearch.java:156)
	at org.sonar.auth.ldap.LdapSearch.findUnique(LdapSearch.java:146)
...
Caused by: javax.naming.CommunicationException: 8x8.com:389
...
Caused by: java.net.ConnectException: Connection timed out

I’m assuming your company’s LDAP server is still up & running & thus it’s likely something “helpful” has occurred on the network side.

 
Ann