47

I am trying to use the EB CLI to deploy an application into an environment but I seem to be getting strange errors. Is there a way to empty out previous application versions so I can upload a fresh application?

The message I see after I execute eb deploy.

Update environment operation is complete, but with errors. For more information, see troubleshooting documentation.

I am currently getting this error:

Incorrect application version found on all instances. Expected version [app version]

The logs file also seems to be getting deleted for some reason.

Gerardo BLANCO
  • 5,590
  • 1
  • 16
  • 35
Sunwoo Yang
  • 1,213
  • 2
  • 12
  • 22

8 Answers8

33

I solved this by doing an instance reboot. Redeploy worked well after reboot.

enter image description here

Gerardo BLANCO
  • 5,590
  • 1
  • 16
  • 35
Jeff Gu Kang
  • 4,749
  • 2
  • 36
  • 44
  • 3
    Thank you it did the trick! For those who dont see this pane, see instruction for enabling enhanced health monitoring – S.Daineko Aug 06 '20 at 19:14
15

The operation completed but there were errors means that your deployment did not succeed. When an application update is unsuccessful eb will keep using the last good version. So if the last good version is 48 but this deployment is 55 and eb is expecting 54, then that "error" will be present... More of a warning than an error.

Something in your application is causing the application update to fail... Use the GUI to get the full logs which will reveal the error... Fix the error and when your deployment is successful your "Incorrect application version" error will resolve.

hephalump
  • 5,860
  • 1
  • 22
  • 23
5

I found out that the issue was due to incompleteness of the permissions granted to the codepipeline/deployment service role.

You should grant UpdateApplicationversion permission to the associated elastic beanstalk resources for the role that you use to deploy your app.

informeto
  • 162
  • 2
  • 14
2

Changing the application/package version in package.json and redeploying it worked for me.

1

I faced the same problem and the cause was 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 for example 1800

or upgrade the instance type to work faster

Dharman
  • 30,962
  • 25
  • 85
  • 135
Majali
  • 480
  • 7
  • 11
1

I was getting this error in my EB application

Incorrect application version found on all instances. Expected version "Sample Application"

As @shiva prasad reddy puchala mentioned, changing the application version in the package.json solved this issue for me.

enter image description here

0

Rebuilding the environment and deploying the new application version should solve the issue.

palden
  • 29
  • 3
0

Also faced this problem, and also the real problem seems to be a previous one, in my case I have CodeDeploy lacking permission on Cloud Watch, which made the deployment fail.

I can see both problems in the events section of Elastic Beanstalk.

doper
  • 33
  • 7