简体   繁体   English

如何在 AWS Elastic Beanstalk 上强制应用程序版本

[英]How to force application version on AWS Elastic Beanstalk

I'm trying to deploy a new version of my Python/Django application using eb deploy .我正在尝试使用eb deploy我的 Python/Django 应用程序的新版本。

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.问题是eb deploy以某种方式搞砸了版本,我不知道如何覆盖它。 The application I upload is working fine, only the version number is not correct, hence, Elastic Beanstalk marks it as Degraded .我上传的应用程序运行良好,只是版本号不正确,因此 Elastic Beanstalk 将其标记为Degraded

When executing eb deploy, I get this error:执行 eb deploy 时,出现此错误:

"Incorrect application version "app-cca6-160820_155843" (deployment 161). Expected version "app-598b-160820_152351" (deployment 159). " “不正确的应用程序版本“app-cca6-160820_155843”(部署 161)。预期版本“app-598b-160820_152351”(部署 159)。

The same says in the health status at AWS Console. AWS 控制台的健康状态也是如此。

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?所以,我的问题如下:如何强制 Elastic Beanstalk 使上传的应用程序版本成为当前版本,以便它不会抱怨?

I've realised that the problem was that Elastic Beanstalk, for some reasons, kept the unsuccessfully deployed versions under .elasticbeanstalk.我意识到问题在于 Elastic Beanstalk 由于某些原因将未成功部署的版本保留在 .elasticbeanstalk 下。 The solution, at least in my case, was to remove those temporal (or whatever you call them) versions of the application.至少在我的情况下,解决方案是删除应用程序的那些临时(或任何您称之为)的版本。

Maybe the problem is this:也许问题是这样的:

AWS Elastic Beanstalk Docker Does not support Multi-Stage Build AWS Elastic Beanstalk Docker 不支持多阶段构建

If yes, I solved using an unamed stage for the multi-stage Dockerfile.如果是,我解决了对多阶段 Dockerfile 使用未命名阶段的问题。 Chek that link for the solution.检查该链接以获取解决方案。 However next time I suggest you to post the last-100-rows of logs.但是下次我建议您发布最后 100 行的日志。 The problem can be not clear watching Events log.看事件日志可以看不清楚问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM