UnknownHostException for AWS private host results in startup failure
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Problem
Bamboo will not start due to UnknownHostException for the AWS private hostname. An error like below can be found in the <bamboo-home>/logs/atlassian-bamboo.log
:
2016-02-05 16:34:50,686 FATAL [finishsetupBackgroundThread] [BambooContainer] Cannot start bamboo
java.lang.RuntimeException: java.net.UnknownHostException: ip-10-1-0-112: ip-10-1-0-112: unknown error
at com.atlassian.security.auth.trustedapps.UIDGenerator.generateUID(UIDGenerator.java:71)
at com.atlassian.security.auth.trustedapps.BaseEncryptionProvider.generateUID(BaseEncryptionProvider.java:18)
at com.atlassian.bamboo.container.startup.InitialiseTrustedAppsOnStartup.run(InitialiseTrustedAppsOnStartup.java:41)
at com.atlassian.bamboo.container.BambooContainer.start(BambooContainer.java:252)
at com.atlassian.bamboo.upgrade.UpgradeLauncher.upgradeAndStartBamboo(UpgradeLauncher.java:153)
at com.atlassian.bamboo.ww2.actions.setup.FinishSetupAction.execute(FinishSetupAction.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
at org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:57)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.UnknownHostException: ip-10-1-0-112: ip-10-1-0-112: unknown error
at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
at com.atlassian.security.auth.trustedapps.UIDGenerator.generateUID(UIDGenerator.java:25)
... 13 more
Caused by: java.net.UnknownHostException: ip-10-1-0-112: unknown error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
... 14 more
Cause
/etc/hosts
file is misconfigured missing the private IP for localhost:
127.0.0.1 localhost localhost.localdomain
Resolution
- Stop Bamboo
Add private hostname to localhost domain in
/etc/hosts
file for the host shown in the error log (e.g. ip-10-1-0-112):127.0.0.1 localhost localhost.localdomain ip-10-1-0-112
- Start Bamboo