为什么AWS Elastic Beanstalk会继续提供旧的应用版本?

时间:2022-08-25 08:36:31

I have developed an app on Django and configured to deploy it on AWS Elastic Beanstalk. An earlier version of the app had admin enabled. I have disabled the same in the new app.

我在Django上开发了一个应用程序,并配置为在AWS Elastic Beanstalk上部署它。该应用的早期版本已启用管理员。我在新的应用程序中禁用了相同的功能。

Here is the url.py of the app.

这是应用程序的url.py.

from django.conf.urls import patterns, include, url
#from django.contrib import admin
#from django.contrib import admin.site.urls
#admin.autodiscover()
urlpatterns = patterns('',
    # Examples:
    url(r'^$', 'firstapp.views.home', name='home'),
    url(r'^jd/', include('jd.urls')),
   # url(r'^admin/', include('admin.site.urls')),
)

But when I browse the app's URL the app served is still the older version. I ssh-ed into the server and have checked the files. The files are those of the older app. The AWS EB console shows the new app version as deployed to environment. I also downloaded the code from AWS EB panel and the code belongs to the new app.

但是当我浏览应用程序的URL时,所提供的应用程序仍然是旧版本。我ssh-ed到服务器并检查了文件。这些文件是旧应用程序的文件。 AWS EB控制台显示部署到环境的新应用程序版本。我还从AWS EB面板下载了代码,代码属于新应用程序。

The URL of Elastic Beanstalk env is: http://secondapp-env.elasticbeanstalk.com/

Elastic Beanstalk env的URL是:http://secondapp-env.elasticbeanstalk.com/

The admin panel can be accessed here: http://secondapp-env.elasticbeanstalk.com/admin/ Ideally this url should result in a 404.

可以在此处访问管理面板:http://secondapp-env.elasticbeanstalk.com/admin/理想情况下,此网址应为404。

The problem is that in the entire AWS EB console I see the new version of app as deployed and serving (I have tried both by pushing code using git aws.push as well as uploading on the aws eb console) however the actual code residing on ec2 server is still the one the older version of app.

问题是,在整个AWS EB控制台中,我看到新版本的应用程序已部署并投放(我已尝试使用git aws.push推送代码以及在aws eb控制台上传)但是实际代码位于ec2服务器仍然是旧版本的应用程序。

How can I force upload the code? Is there a delay in actual deployment of code (Although it has been over an hour since I deployed the new version and the code is quite small)

如何强制上传代码?代码的实际部署是否存在延迟(尽管自部署新版本以来已经超过一个小时且代码非常小)

2 个解决方案

#1


0  

If the AWS Management Console is showing your new AWS Elastic Beanstalk app version as deployed, this should in fact always be the case, everything else would be a critical error on the AWS side and is a bit doubtful accordingly.

如果AWS管理控制台显示您部署的新AWS Elastic Beanstalk应用程序版本,实际上应该始终如此,其他所有内容都将成为AWS方面的严重错误,因此有点可疑。

From that angle I'd expect you might not be looking at the correct resources one way or the other - for example, could it be that you have accidentally deployed one version to a different region? (Looking at the wrong region probably happens to almost everyone at some point when working with AWS ;)

从这个角度来看,我希望您可能不会以某种方式查看正确的资源 - 例如,您是否意外地将一个版本部署到不同的区域? (在使用AWS时,在某些时候几乎每个人都可能会看到错误的区域;)

Of course, you can't have two deployed apps with the identical environment URL, so one would need to be deployed with a different one in fact (maybe Elastic Beanstalk has chosen one automatically, which can happen depending on the deployment scenario) - here are a few things to try:

当然,您不能拥有两个具有相同环境URL的已部署应用程序,因此实际上需要部署一个不同的应用程序(可能Elastic Beanstalk已自动选择一个,这可能会发生,具体取决于部署方案) - 这里有几件事要尝试:

  1. verify that the environment URL of the new one you are seeing is in fact the one you want it to be and not an automatically generated one
  2. 验证您所看到的新环境的URL实际上是您想要的环境URL,而不是自动生成的环境URL
  3. given this is just a test deployment, I'd simply delete the new one and would expect the old one to still be available at that URL
  4. 鉴于这只是一个测试部署,我只是删除新的,并期望旧的仍然可以在该URL

Both would confirm the suspicion that you are running two environments in fact, finding the other one should be simple at that point.

两者都会证实你怀疑你正在运行两个环境,发现另一个环境应该很简单。

Good luck!

祝你好运!

#2


0  

It's quite possible that you are referencing two different files or structures.

你很可能引用了两个不同的文件或结构。

Depending on the API you are using, a lot of them have npm build features into them. It is possible you are editing the "raw" code, not building, and then deploying the same built files. If this is the case, you will need to run your build tool: gulp, webpack or grunt, and then deploy again.

根据您使用的API,很多都具有npm构建功能。您可能正在编辑“原始”代码,而不是构建,然后部署相同的构建文件。如果是这种情况,您将需要运行构建工具:gulp,webpack或grunt,然后再次部署。

#1


0  

If the AWS Management Console is showing your new AWS Elastic Beanstalk app version as deployed, this should in fact always be the case, everything else would be a critical error on the AWS side and is a bit doubtful accordingly.

如果AWS管理控制台显示您部署的新AWS Elastic Beanstalk应用程序版本,实际上应该始终如此,其他所有内容都将成为AWS方面的严重错误,因此有点可疑。

From that angle I'd expect you might not be looking at the correct resources one way or the other - for example, could it be that you have accidentally deployed one version to a different region? (Looking at the wrong region probably happens to almost everyone at some point when working with AWS ;)

从这个角度来看,我希望您可能不会以某种方式查看正确的资源 - 例如,您是否意外地将一个版本部署到不同的区域? (在使用AWS时,在某些时候几乎每个人都可能会看到错误的区域;)

Of course, you can't have two deployed apps with the identical environment URL, so one would need to be deployed with a different one in fact (maybe Elastic Beanstalk has chosen one automatically, which can happen depending on the deployment scenario) - here are a few things to try:

当然,您不能拥有两个具有相同环境URL的已部署应用程序,因此实际上需要部署一个不同的应用程序(可能Elastic Beanstalk已自动选择一个,这可能会发生,具体取决于部署方案) - 这里有几件事要尝试:

  1. verify that the environment URL of the new one you are seeing is in fact the one you want it to be and not an automatically generated one
  2. 验证您所看到的新环境的URL实际上是您想要的环境URL,而不是自动生成的环境URL
  3. given this is just a test deployment, I'd simply delete the new one and would expect the old one to still be available at that URL
  4. 鉴于这只是一个测试部署,我只是删除新的,并期望旧的仍然可以在该URL

Both would confirm the suspicion that you are running two environments in fact, finding the other one should be simple at that point.

两者都会证实你怀疑你正在运行两个环境,发现另一个环境应该很简单。

Good luck!

祝你好运!

#2


0  

It's quite possible that you are referencing two different files or structures.

你很可能引用了两个不同的文件或结构。

Depending on the API you are using, a lot of them have npm build features into them. It is possible you are editing the "raw" code, not building, and then deploying the same built files. If this is the case, you will need to run your build tool: gulp, webpack or grunt, and then deploy again.

根据您使用的API,很多都具有npm构建功能。您可能正在编辑“原始”代码,而不是构建,然后部署相同的构建文件。如果是这种情况,您将需要运行构建工具:gulp,webpack或grunt,然后再次部署。