Bamboo remote agent fails to start up due to UnknownHostException
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.
Summary
Remote agent is not able to start up and the following exception can be seen in the <bamboo-agent-home>/atlassian-bamboo-agent.log file:
INFO | jvm 1 | 2022/08/03 20:24:30 | 2022-08-03 20:24:30,623 INFO [WrapperSimpleAppMain] [RemoteAgentHttpClientFactory] Creating a new HTTP client...
INFO | jvm 1 | 2022/08/03 20:24:31 | 2022-08-03 20:24:30,998 INFO [WrapperSimpleAppMain] [AgentContext] Authenticating against Bamboo server at https://my-bamboo.net/agentServer/
INFO | jvm 1 | 2022/08/03 20:24:31 | Exiting due to fatal exception.
INFO | jvm 1 | 2022/08/03 20:24:31 | java.net.UnknownHostException: my-bamboo.net
INFO | jvm 1 | 2022/08/03 20:24:31 | at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
INFO | jvm 1 | 2022/08/03 20:24:31 | at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
INFO | jvm 1 | 2022/08/03 20:24:31 | at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1330)
INFO | jvm 1 | 2022/08/03 20:24:31 | at java.net.InetAddress.getAllByName0(InetAddress.java:1283)
INFO | jvm 1 | 2022/08/03 20:24:31 | at java.net.InetAddress.getAllByName(InetAddress.java:1199)
INFO | jvm 1 | 2022/08/03 20:24:31 | at java.net.InetAddress.getAllByName(InetAddress.java:1127)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
INFO | jvm 1 | 2022/08/03 20:24:31 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.initFingerprint(AgentContext.java:123)
INFO | jvm 1 | 2022/08/03 20:24:31 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.initServerSession(AgentContext.java:109)
INFO | jvm 1 | 2022/08/03 20:24:31 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.run(AgentContext.java:96)
INFO | jvm 1 | 2022/08/03 20:24:31 | at com.atlassian.bamboo.agent.bootstrap.RemoteAgentBootstrap.run(RemoteAgentBootstrap.java:109)
INFO | jvm 1 | 2022/08/03 20:24:31 | at com.atlassian.bamboo.agent.bootstrap.RemoteAgentBootstrap.main(RemoteAgentBootstrap.java:56)
INFO | jvm 1 | 2022/08/03 20:24:31 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2022/08/03 20:24:31 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO | jvm 1 | 2022/08/03 20:24:31 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 1 | 2022/08/03 20:24:31 | at java.lang.reflect.Method.invoke(Method.java:498)
INFO | jvm 1 | 2022/08/03 20:24:31 | at com.atlassian.bamboo.agent.bootstrap.AgentBootstrap.main(AgentBootstrap.java:21)
INFO | jvm 1 | 2022/08/03 20:24:31 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2022/08/03 20:24:31 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO | jvm 1 | 2022/08/03 20:24:31 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 1 | 2022/08/03 20:24:31 | at java.lang.reflect.Method.invoke(Method.java:498)
INFO | jvm 1 | 2022/08/03 20:24:31 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:349)
INFO | jvm 1 | 2022/08/03 20:24:31 | at java.lang.Thread.run(Thread.java:750)
Environment
All Bamboo versions.
Diagnosis
The remote agent is unable to resolve Bamboo's Base URL. In the example above the hostname is my-bamboo.net. Try pinging Bamboo's hostname from the server where the agent is installed. For example:
ping my-bamboo.net
- If you are able to ping Bamboo's hostname from the server where the agent is installed but the agent continues to fail with UnknownHostException check if you're using a forward proxy on that server to reach Bamboo. It may be necessary to configure the remote agent to use the forward proxy as well.
Cause
This is likely a DNS problem. If the remote agent cannot reach Bamboo because it's unable to resolve its hostname the connection between the agent and Bamboo cannot be established.
Solution
Solution 1
- Update the appropriate DNS records to include the Bamboo Base URL/ address that the remote agent needs to use to connect to Bamboo.
- Restart the remote agent.
Solution 2
Update the hosts file on the server where the remote agent is running:
Operating System Location Linux /etc/hosts Windows C:\Windows\System32\drivers\etc\hosts Ensure the correct IP address and hostname the agent needs to use to connect to Bamboo are added to the file. For example:
<IP address> <hostname> 192.168.1.123 my-bamboo-net
Restart the remote agent.
Solution 3
Configure the remote agent to use a forward proxy in order to reach Bamboo by following the steps outlined inside this page: