21

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?

Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159
0x4ndy
  • 1,216
  • 1
  • 12
  • 25
  • I would try deleting all application versions through the EB online interface. Also, make sure you are deploying the correct GIT version. JMHO – WayBehind Aug 27 '16 at 20:55
  • 1
    I would really be in favour of not creating a new application. It's a production environment and I don't want to have a downtime because of such thing. – 0x4ndy Aug 27 '16 at 21:25
  • I think you have some issues with your GIT versioning. Every time you have a new app version and deploy, EB will automatically create a new EB version and you can see them all through your browser when you go to you EB on AWS. Just check what app versions you have on AW. – WayBehind Aug 27 '16 at 21:41
  • OK, let's see there's an issue with GIT versioning. I see what version I currently have in EB and I see what version is uploaded. Also, I see what version is expected. How do I fix this? – 0x4ndy Aug 27 '16 at 22:35
  • Do you always run git update and git commit before you deploy? – WayBehind Aug 27 '16 at 23:09
  • Yes. I always do it as it's required by eb deploy to work. – 0x4ndy Sep 17 '16 at 16:18
  • Have you tried to play with `--version VERSION` and `--label LABEL` options of `eb deploy`? – abcdn Mar 11 '17 at 07:06

2 Answers2

13

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.

Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159
0x4ndy
  • 1,216
  • 1
  • 12
  • 25
  • 1
    Sorry, got stuck at the same point as you. When you say under .elasticbeanstalk, do you mean the .zip files in S3 bucket ? Thanks! – Jaswanth Manigundan Feb 13 '18 at 01:48
  • Yes, I removed the old stuff from .elasticbeanstalk folder. I don't remember now but apart from zipped applications, there might be a file holding versions, but I wouldn't say for sure. – 0x4ndy Feb 14 '18 at 07:17
  • 1
    Thanks. Did what you suggested and also restarted the instance. Worked like a charm. After deep diving into the docs, it turns out the version pointer is the one creating the problem. – Jaswanth Manigundan Feb 14 '18 at 11:55
  • 1
    @aolchawa Where is this folder. I cant find it. Can you please explain a bit ? – AMBasra Oct 28 '19 at 11:59
  • @AMBasra oh that was 3 years ago, no way I can remember that. However, try to just search it by find ~/ -name ".ekasticbeanstalk" – 0x4ndy Oct 28 '19 at 20:20
  • please, I am in this situation now, I can't find the .elasticbeanstalk folder, did you setup aws config? – KINGSLEY OKPARA Feb 22 '21 at 11:47
  • 1
    You can do this EBS console. In the left hand menu, under your application name, there is a section called 'Application versions'. – F_SO_K May 18 '21 at 16:17
0

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.

Giacomo Brunetta
  • 1,409
  • 3
  • 18
  • 38