Windows elastic instance in Bamboo remain in pending state on startup
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
要約
Randomly, Bamboo elastic image startup status remains in Pending state
原因
When Bamboo starts up a new elastic agent, in some occasions, AWS Elastic IP is not assigned to the Instance before the elastic agents runner start up the elastic agent.
When Bamboo elastic agent runner startup it must first download the elastic agent binaries from Atlassian S3 bucket, and without Elastic IP assigned to the instance, the process will timeout and cause the startup state to remain in Pending.
The error is found in bamboo-elastic-agent.out
log file;
JAVA_HOME: C:\opt\javahome
PATH: C:\opt\jdk-11\bin;C:\opt\git\bin;C:\Windows\system32; ...
HOME: \Users\Bamboo
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)
Exception in thread "main" java.net.ConnectException: Connection timed out: connect
at java.base/java.net.PlainSocketImpl.connect0(Native Method)
at java.base/java.net.Socket.connect(Socket.java:558)
ソリューション
Force the elastic bamboo startup to sleep for some seconds, to allow AWS assign an elastic IP to the instance
- Image Configurations → Edit the affected Image, by adding the duration to delay startup using sleep command, eg.
sleep 60
.