我突然无法将我的GoLang应用部署到Google AppEngine。

huangapple go评论86阅读模式
英文:

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 - &quot;build&quot;: Status: Downloaded newer image for eu.gcr.io/gae-runtimes/buildpacks/google-gae-18/go/builder:go_20230305_RC00
Step #2 - &quot;build&quot;: eu.gcr.io/gae-runtimes/buildpacks/google-gae-18/go/builder:go_20230305_RC00
Step #2 - &quot;build&quot;: ===&gt; ANALYZING
Step #2 - &quot;build&quot;: ERROR: failed to initialize analyzer: getting previous image: getting config file for image &quot;eu.gcr.io/staticform/app-engine-tmp/app/www/ttl-18h:latest&quot;: GET https://storage.googleapis.com/eu.artifacts.staticform.appspot.com/containers/images/sha256:af3ff480dc0053108a52bf8b7ec3e45893e4e97c507102ff524b07bc01e03249?access_token=REDACTED: unexpected status code 404 Not Found: &lt;?xml version=&#39;1.0&#39; encoding=&#39;UTF-8&#39;?&gt;&lt;Error&gt;&lt;Code&gt;NoSuchKey&lt;/Code&gt;&lt;Message&gt;The specified key does not exist.&lt;/Message&gt;&lt;Details&gt;No such object: eu.artifacts.staticform.appspot.com/containers/images/sha256:af3ff480dc0053108a52bf8b7ec3e45893e4e97c507102ff524b07bc01e03249&lt;/Details&gt;&lt;/Error&gt;
Finished Step #2 - &quot;build&quot;
ERROR
ERROR: build step 2 &quot;eu.gcr.io/gae-runtimes/buildpacks/google-gae-18/go/builder:go_20230305_RC00&quot; 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. 我突然无法将我的GoLang应用部署到Google AppEngine。

So with this command the deployment was successful:

gcloud app deploy --project=staticform --version=1 --no-cache app.yaml

huangapple
  • 本文由 发表于 2023年3月15日 00:54:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/75736163.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定