LDAP Test basic connection fails in Bamboo Data Center with java.net.UnknownHostException

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When connecting Bamboo Data Center to LDAP and running a test connection, the test fails and the following error message is shown in the User Interface (also present in the <bamboo-home>/logs/atlassian-bamboo.log):

1 2 Test basic connection: Failed ldap02:389; nested exception is javax.naming.CommunicationException: ldap02:389 [Root exception is java.net.UnknownHostException: ldap01]

Environment

The solution has been validated in Bamboo Data Center 9.6 but may be applicable to other versions.

Diagnosis

When connecting Bamboo Data Center to an LDAP User Directory and clicking the "Test connection" button, the test fails with the following error message. When reviewing the <bamboo-home>/logs/atlassian-bamboo.log file, the same error message is present:

1 2 Test basic connection: Failed ldap02:389; nested exception is javax.naming.CommunicationException: ldap02:389 [Root exception is java.net.UnknownHostException: ldap01]

Cause

The error message indicates a failure in establishing a basic connection to an LDAP server. The specific error is a javax.naming.CommunicationException caused by a java.net.UnknownHostException. This suggests that the hostname used on LDAP server could not be resolved, which is preventing the connection to the LDAP server on port 389. Possible reasons include:

  • LDAP hostname is not added in the /etc/hosts file.

  • The hostname is incorrect or misspelled.

  • The DNS server is not configured correctly or is unreachable.

  • The network configuration does not allow DNS resolution for this hostname.

Solution

  1. Ensure that the DNS server is correctly configured and that it can resolve the LDAP hostname. You might need to add an entry in your /etc/hosts file if it's a local or private network setup.

  2. Make sure that the network connection to the LDAP server is active and that there are no firewall rules blocking access to port 389.

  3. Double-check that the hostname is correct and that there are no typos.

  4. If possible, try connecting using the IP address of the LDAP server instead of the hostname to rule out DNS issues.

  5. Ensure that the LDAP server is running and accessible.

  6. Look into any relevant logs (LDAP server logs, for example) for additional error messages that might provide more context on the failure.

Updated on March 13, 2025

Still need help?

The Atlassian Community is here for you.