How to force application version on AWS Elastic Beanstalk

Question:

I’m trying to deploy a new version of my Python/Django application using eb deploy.

It unfortunately fails due to unexpected version of the application. The problem is that somehow eb deploy screwed up the version and I don’t know how to override it. The application I upload is working fine, only the version number is not correct, hence, Elastic Beanstalk marks it as Degraded.

When executing eb deploy, I get this error:

“Incorrect application version “app-cca6-160820_155843” (deployment
161). Expected version “app-598b-160820_152351” (deployment 159). “

The same says in the health status at AWS Console.

So, my question is the following: How can I force Elastic Beanstalk to make the uploaded application version the current one so it doesn’t complain?

Asked By: 0x4ndy

||

Answers:

I’ve realised that the problem was that Elastic Beanstalk, for some reasons, kept the unsuccessfully deployed versions under .elasticbeanstalk. The solution, at least in my case, was to remove those temporal (or whatever you call them) versions of the application.

Answered By: 0x4ndy

Maybe the problem is this:

AWS Elastic Beanstalk Docker Does not support Multi-Stage Build

If yes, I solved using an unamed stage for the multi-stage Dockerfile. Chek that link for the solution. However next time I suggest you to post the last-100-rows of logs. The problem can be not clear watching Events log.

Answered By: Giacomo Brunetta

I also faced same issue and deleted the wrong application versions. And increased the command timeout.

Default max deployment time -Command timeout- is 600 (10 minutes)

Go to Your Environment → Configuration → Deployment preferences → Command timeout

Increase the Deployment preferences higher like 1800 and then try to deploy the previous working application version. It will work.

Answered By: Kowsigan Atsayam