Bamboo server or remote agent fails to startup due to misconfigured hosts file

Still need help?

The Atlassian Community is here for you.

Ask the community

Summary

The Bamboo fails to start and shows the following error in the $BAMBOO_HOME/logs/atlassian-bamboo.log 

2017-11-07 11:59:24,393 WARN [localhost-startStop-1] [InetAddressBean] Cannot determine local host name; using "localhost".
java.net.UnknownHostException: myhostname: myhostname: Name or service not known
        at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
        at com.atlassian.bamboo.configuration.InetAddressBean.getLocalCanonicalHostName(InetAddressBean.java:40)
        at com.atlassian.bamboo.setup.DefaultBootstrapManager.<clinit>(DefaultBootstrapManager.java:54)
        ...
Caused by: java.net.UnknownHostException: myhostname: Name or service not known
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
        ...

Or the Bamboo Remote Agent may fail to start and shows the following error in the $BAMBOO_AGENT_HOME/atlassian-bamboo-agent.log 

INFO | jvm 3 | 2023/01/11 20:13:16 | 2023-01-11 20:13:16,144 WARN [AgentRunnerThread] [InetAddressBean] Cannot determine local host name; using "null".
INFO | jvm 3 | 2023/01/11 20:13:16 | java.net.UnknownHostException: ip-XX-XX-X-XX: ip-XX-XX-X-XX: Temporary failure in name resolution
 

Diagnosis

Check the $BAMBOO_HOME/logs/atlassian-bamboo.log (Bamboo Server) or $BAMBOO_AGENT_HOME/atlassian-bamboo-agent.log (Bamboo Remote Agent) for name resolution errors described above coming from the threads localhost-startStop-1  or AgentRunnerThread  during startup.

Cause

Misconfiguration in the hosts file means that Java is unable to resolve the address of the hostname  of the server. 

Solution

  1. Stop Bamboo

  2. Make sure that your hosts file is configured correctly:

    127.0.0.1          localhost
    255.255.255.255    broadcasthost
    ::1                localhost
  3. Make sure there is no firewall blocking Bamboo.
  4. Try to ping the myhostname (whatever Bamboo complains about in the above error). Bamboo should be able to resolve that hostname.

  5. Once the server hosting Bamboo can resolve the name, you can start Bamboo.

Last modified on Jul 6, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.