英文:
I suddenly can no longer deploy my GoLang app to Google AppEngine
问题
从一天到另一天,我突然无法将我的 GoLang 项目部署到 AppEngine。我在日志中收到以下错误消息:
Step #2 - "build": Status: Downloaded newer image for eu.gcr.io/gae-runtimes/buildpacks/google-gae-18/go/builder:go_20230305_RC00
Step #2 - "build": eu.gcr.io/gae-runtimes/buildpacks/google-gae-18/go/builder:go_20230305_RC00
Step #2 - "build": ==> ANALYZING
Step #2 - "build": ERROR: failed to initialize analyzer: getting previous image: getting config file for image "eu.gcr.io/staticform/app-engine-tmp/app/www/ttl-18h:latest": GET https://storage.googleapis.com/eu.artifacts.staticform.appspot.com/containers/images/sha256:af3ff480dc0053108a52bf8b7ec3e45893e4e97c507102ff524b07bc01e03249?access_token=REDACTED: unexpected status code 404 Not Found: <?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Details>No such object: eu.artifacts.staticform.appspot.com/containers/images/sha256:af3ff480dc0053108a52bf8b7ec3e45893e4e97c507102ff524b07bc01e03249</Details></Error>
Finished Step #2 - "build"
ERROR
ERROR: build step 2 "eu.gcr.io/gae-runtimes/buildpacks/google-gae-18/go/builder:go_20230305_RC00" failed: step exited with non-zero status: 1
起初,我以为 Go 1.11 最终被停用了,但切换到 1.19 并没有解决问题。似乎使用新的服务名称部署可以正常工作,但更新现有服务则不行,即使我更改了服务版本。
我用两个 GoLang 项目进行了测试(其中一个没有任何更改)。我的 Java 项目可以正常部署。
这是我的部署命令:
gcloud app deploy --project=staticform --version=1 app.yaml
更新:
这是我的 app.yaml
文件:
runtime: go111
automatic_scaling:
min_idle_instances: 0
max_instances: 1
handlers:
- url: /.*
script: auto
secure: always
- url: /admin/.*
script: auto
secure: always
login: admin
英文:
From one day to another I suddenly could no longer deploy my GoLang project to AppEngine. I get this error message in the log:
Step #2 - "build": Status: Downloaded newer image for eu.gcr.io/gae-runtimes/buildpacks/google-gae-18/go/builder:go_20230305_RC00
Step #2 - "build": eu.gcr.io/gae-runtimes/buildpacks/google-gae-18/go/builder:go_20230305_RC00
Step #2 - "build": ===> ANALYZING
Step #2 - "build": ERROR: failed to initialize analyzer: getting previous image: getting config file for image "eu.gcr.io/staticform/app-engine-tmp/app/www/ttl-18h:latest": GET https://storage.googleapis.com/eu.artifacts.staticform.appspot.com/containers/images/sha256:af3ff480dc0053108a52bf8b7ec3e45893e4e97c507102ff524b07bc01e03249?access_token=REDACTED: unexpected status code 404 Not Found: <?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Details>No such object: eu.artifacts.staticform.appspot.com/containers/images/sha256:af3ff480dc0053108a52bf8b7ec3e45893e4e97c507102ff524b07bc01e03249</Details></Error>
Finished Step #2 - "build"
ERROR
ERROR: build step 2 "eu.gcr.io/gae-runtimes/buildpacks/google-gae-18/go/builder:go_20230305_RC00" failed: step exited with non-zero status: 1
First I thought Go 1.11 was finally deactivated but changing to 1.19 didn't solve the problem. It seems deploying with a new service name works but updating an existing service does not. Even when I change the service version.
I tested it with two of my GoLang projects (one without any changes). My Java projects deploy fine.
Here is my command to deploy:
gcloud app deploy --project=staticform --version=1 app.yaml
Update:
Here is my app.yaml
:
runtime: go111
automatic_scaling:
min_idle_instances: 0
max_instances: 1
handlers:
- url: /.*
script: auto
secure: always
- url: /admin/.*
script: auto
secure: always
login: admin
答案1
得分: 1
事实证明,我所需要的只是--no-cache
选项。我不知道为什么,也不在乎。;)
因此,使用以下命令进行部署成功:
gcloud app deploy --project=staticform --version=1 --no-cache app.yaml
英文:
As it turned out all I needed was the --no-cache
option. I don't know why, and I don't care.
So with this command the deployment was successful:
gcloud app deploy --project=staticform --version=1 --no-cache app.yaml
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论