简体   繁体   English

App Engine继续提供以前的Python版本

[英]App Engine continues to serve previous Python version

It seems recently (within the year) that when I deploy an update to an App Engine app it continues serving the previous Python code. 似乎最近(一年内)当我将更新部署到App Engine应用程序时,它将继续提供以前的Python代码。

I can go to the console and under: 我可以转到控制台并在下面:

Versions -> Debug -> Source 版本->调试->源

see that the most recent version has been deployed. 查看是否已部署了最新版本。 And when it errors out, the link given in the log points to the new source, but based on unambiguous results, it is the old source that is in fact serving. 而且,当出现错误时,日志中给出的链接指向新的源,但是基于明确的结果,实际上是在使用旧源。 This has been happening on multiple apps and the only solution has been to wait a day and try again. 这已在多个应用程序上发生,唯一的解决方案是等待一天,然后重试。

The command I am using to deploy from the local Windows development environment is: 我用来从本地Windows开发环境进行部署的命令是:

gcloud app deploy --project xxxxxxxxxx --version 1

I have tried bumping the version number but the results are the same. 我尝试增加版本号,但结果是相同的。

What could I be missing? 我可能会缺少什么?

Further attempts: I changed the deploy command to: 进一步尝试:我将deploy命令更改为:

gcloud app deploy --project xxxxxxxx --promote --stop-previous-version

I removed the version switch so that App Engine would create its own version numbering. 我删除了版本开关,以便App Engine可以创建自己的版本编号。 The results are the same: the previous version continues to serve. 结果是相同的:以前的版本继续可用。

Just to verify, I added a logging line: 为了验证,我添加了一条日志行:

logging.info('Last edit: 5/28/2018 11:08')
client_id = os.environ['CLIENT_ID']
logging.info('CLIENT_ID = ' + str(client_id))

The first line was added, the other two are old. 添加了第一行,其他两行很旧。 In the log trace, it shows output from the second log, not the first. 在日志跟踪中,它显示第二个日志的输出,而不是第一个日志的输出。 What is truly strange is that the line number in the log indicates the middle line, so it is displaying the new source, but executing the old. 真正奇怪的是,日志中的行号指示中间行,因此它显示新的源,但执行旧的。

I am using the original App Engine SDK for Python. 我正在使用Python的原始App Engine SDK。 Evidently, you have to run locally in order to generate the .pyc file. 显然,您必须在本地运行才能生成.pyc文件。 It was working locally, but running into problems on the web. 它在本地运行,但是在网络上遇到了问题。 So I made some tweaks to fix the problem, but did not try to run locally afterwards. 因此,我做了一些调整来解决此问题,但之后没有尝试在本地运行。 So although the uploaded .py was new, the .pyc was old. 因此,尽管上载的.py是新的,但.pyc是旧的。

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

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