Bamboo Fails to Start Elastic Instance
Problem
After configuring the AWS IAM user and access key for Bamboo, attempting to start an elastic instance fails and the following error message is displayed.
No additional information is presented and no errors show up in the Bamboo System Errors page.
Cause
- BAM-16109Getting issue details... STATUS
The following error appears in the Bamboo application log.
2015-07-02 10:28:49.679017500 2015-07-02 10:28:49,678 INFO [scheduler_Worker-2] [ElasticRunningInstancesOptimizerImpl] AWS account has 0 elastic instances started by Bamboo server(s) and has 0 spot requests pending, 0 in total. Of these, Bamboo controls 0.
2015-07-02 10:28:50.102443500 2015-07-02 10:28:50,102 ERROR [scheduler_Worker-2] [ElasticInstancesMonitorJob] Failed to adjust the number of elastic agents.
2015-07-02 10:28:50.102445500 com.atlassian.aws.AWSException: Error when starting a new instance
2015-07-02 10:28:50.102445500 at com.atlassian.bamboo.agent.elastic.server.ElasticFunctionalityFacadeImpl.startupAgents(ElasticFunctionalityFacadeImpl.java:218)
2015-07-02 10:28:50.102446500 at com.atlassian.bamboo.agent.elastic.schedule.ElasticInstancesMonitorJob.execute(ElasticInstancesMonitorJob.java:50)
2015-07-02 10:28:50.102452500 at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
2015-07-02 10:28:50.102452500 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
2015-07-02 10:28:50.102453500 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
2015-07-02 10:28:50.102453500 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
2015-07-02 10:28:50.102454500 at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
2015-07-02 10:28:50.102455500 at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
2015-07-02 10:28:50.102455500 Caused by: com.amazonaws.AmazonServiceException: The key pair 'elasticbamboo' does not exist (Service: AmazonEC2; Status Code: 400; Error Code: InvalidKeyPair.NotFound; Request ID: 662XXXX-1a90-XXXX-b2fe-565XXXXXXba)
2015-07-02 10:28:50.102458500 at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1077)
2015-07-02 10:28:50.102459500 at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:725)
2015-07-02 10:28:50.102459500 at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:460)
2015-07-02 10:28:50.102461500 at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:295)
Resolution
Create a key pair in AWS with the name 'elasticbamboo'. After creating the key pair you should be able to start elastic instances successfully.