Noman Amir
Noman Amir

Reputation: 953

Beanstalk: Error while updating environment with new version

I am trying to deploy a Ruby-on-Rails application to AWS Beanstalk. The war is generated using warble in Jenkins and the war file is then copied to our AWS S3 bucket.

I am using AWS Beanstalk command-line tools to create the beanstalk application, application version and the environment. The first version is deployed correctly.

Then I create a new application version, and try updating environment with the new version. The new version is not getting deployed. In the events, following error is thrown:

Encountered errors while attempting to deploy version to 1 running EC2 instances

I have tried creating everything from the scratch as well, but still the 2nd version onward above error is thrown.

Note: We are using custom AMI, this is the BS AMI which we tweaked and created image from for our use.

Can someone help me with this, please?

Thanks

Noman A.

Upvotes: 1

Views: 412

Answers (1)

Noman Amir
Noman Amir

Reputation: 953

I am answering this on the basis of my testings, so anyone looking for solutions might find it useful.

As mentioned in the question, I was using a custom beanstalk ami [Tomcat 7 stack]. The customization was done following below steps:

  1. Create Beanstalk Application, create a version for this app, and launch beanstalk environment (Not customized one, default as provided by AWS) by passing options like KeyPair so you can use the same to ssh into the instance.

  2. Note the AMI-id of the above instance and launch a regular EC2 (Not Beanstalk) instance of this AMI.

  3. Customzie the EC2 instance to your needs, and create an EBS Image of this instance once done. Stop this instance, you can terminate it later once you are happy with the image.

  4. Terminate the Beanstalk instance as well.

  5. Launch new Beanstalk environment, but this time pass this ami-id of the image created in step 3.

I have created customized beanstalk images for both tomcat 6 and 7. For my problem, I found out that the issue was happening when I was using a customized ami for tomcat 7. The update just didn't work. But when I use beanstalk default instance (not the customized image of mine), the update works fine.

However, with the tomcat 6 customized image, update works just fine. So it appears the issue is with the AWS Beanstalk Default AMI for Tomcat 7 customization.

I am marking this one as answered for now.

-Noman A.

Upvotes: 2

Related Questions