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.
Elastic Beanstalk applies an application's lifecycle policy each time you create a new application version, and deletes up to 100 versions each time the lifecycle policy is applied.
AWS Elastic Beanstalk uses proven AWS features and services, such as Amazon EC2, Amazon RDS, Elastic Load Balancing, Auto Scaling, Amazon S3, and Amazon SNS, to create an environment that runs your application. The current version of AWS Elastic Beanstalk uses the Amazon Linux AMI or the Windows Server 2019.
I solved this by doing an instance reboot. Redeploy worked well after reboot.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With