【问题标题】:Downgrade App engine flexible to app engine standard environment将 App Engine 灵活降级为 App Engine 标准环境
【发布时间】:2020-11-23 23:53:12
【问题描述】:

我在应用引擎弹性环境上的费用很高,所以我决定降级到应用引擎标准环境。我已经用推荐的 NodeJS 编写了我的应用程序。

我有一个 app.yaml 文件,看起来像这样 -

runtime: nodejs
env: flex

所以我认为只要注释掉这一行,我的应用就会从 flex 环境恢复到标准环境,并且会停止计费,但是在 - gcloud deploy app 开始抛出错误。

runtime: nodejs
# env: flex

错误 -

    starting build "570f00c9-e462-4f2e-8314-ea75df68e590"

FETCHSOURCE
BUILD
Starting Step #0 - "fetcher"
Step #0 - "fetcher": Already have image (with digest): gcr.io/cloud-builders/gcs-fetcher
Step #0 - "fetcher": Fetching manifest gs://staging.myapp.appspot.com/ae/2ee45089-8d39-47ad-85f5-f9489c54badc/manifest.json.
Step #0 - "fetcher": Processing 9 files.
Step #0 - "fetcher": ******************************************************
Step #0 - "fetcher": Status:                      SUCCESS
Step #0 - "fetcher": Started:                     2020-08-03T23:42:00Z
Step #0 - "fetcher": Completed:                   2020-08-03T23:42:00Z
Step #0 - "fetcher": Requested workers:    200
Step #0 - "fetcher": Actual workers:         9
Step #0 - "fetcher": Total files:            9
Step #0 - "fetcher": Total retries:          0
Step #0 - "fetcher": GCS timeouts:           0
Step #0 - "fetcher": MiB downloaded:         0.10 MiB
Step #0 - "fetcher": MiB/s throughput:       0.71 MiB/s
Step #0 - "fetcher": Time for manifest:    213.58 ms
Step #0 - "fetcher": Total time:             0.36 s
Step #0 - "fetcher": ******************************************************
Finished Step #0 - "fetcher"
Starting Step #1 - "prep"
Step #1 - "prep": Already have image (with digest): gcr.io/cloud-builders/gcloud
Finished Step #1 - "prep"
Starting Step #2 - "detector"
Step #2 - "detector": Pulling image: us.gcr.io/gae-runtimes/buildpacks/nodejs12/builder:nodejs12_20200711_12_18_2_RC00
Step #2 - "detector": nodejs12_20200711_12_18_2_RC00: Pulling from gae-runtimes/buildpacks/nodejs12/builder
Step #2 - "detector": 5e0f2488a094: Already exists
Step #2 - "detector": 07013743b8c6: Already exists
Step #2 - "detector": 3c2cba919283: Already exists
Step #2 - "detector": 3d34396a5442: Already exists
Step #2 - "detector": 541e48a6a2b5: Already exists
Step #2 - "detector": 34f928489dc6: Already exists
Step #2 - "detector": 64208d02cb2c: Already exists
Step #2 - "detector": 1b7c7906717c: Already exists
Step #2 - "detector": 610bcfea19fe: Already exists
Step #2 - "detector": fbad6c6a4dc9: Already exists
Step #2 - "detector": 9c961dbc83b2: Already exists
Step #2 - "detector": 584a50f27d83: Pulling fs layer
Step #2 - "detector": 229c810fe4b6: Pulling fs layer
Step #2 - "detector": 67f333b251cc: Pulling fs layer
Step #2 - "detector": 67d3732ac306: Pulling fs layer
Step #2 - "detector": fa3555d01e5c: Pulling fs layer
Step #2 - "detector": 7cadee99477d: Pulling fs layer
Step #2 - "detector": 8f7829806b7c: Pulling fs layer
Step #2 - "detector": f6cfa6a7f25d: Pulling fs layer
Step #2 - "detector": c5269ff7ab58: Pulling fs layer
Step #2 - "detector": 52a8b2fcfc34: Pulling fs layer
Step #2 - "detector": b59bca8d4380: Pulling fs layer
Step #2 - "detector": 06f428a8446f: Pulling fs layer
Step #2 - "detector": d77ba4498082: Pulling fs layer
Step #2 - "detector": 2979886df2cc: Pulling fs layer
Step #2 - "detector": afbfc3e27982: Pulling fs layer
Step #2 - "detector": 27046f732e4e: Pulling fs layer
Step #2 - "detector": 7a4302826804: Pulling fs layer
Step #2 - "detector": eb078dded89c: Pulling fs layer
Step #2 - "detector": c661568c601b: Pulling fs layer
Step #2 - "detector": 8b4f47d49eb8: Pulling fs layer
Step #2 - "detector": 4f4fb700ef54: Pulling fs layer
Step #2 - "detector": 67d3732ac306: Waiting
Step #2 - "detector": fa3555d01e5c: Waiting
Step #2 - "detector": 7cadee99477d: Waiting
Step #2 - "detector": 8f7829806b7c: Waiting
Step #2 - "detector": f6cfa6a7f25d: Waiting
Step #2 - "detector": c5269ff7ab58: Waiting
Step #2 - "detector": 52a8b2fcfc34: Waiting
Step #2 - "detector": b59bca8d4380: Waiting
Step #2 - "detector": 06f428a8446f: Waiting
Step #2 - "detector": d77ba4498082: Waiting
Step #2 - "detector": 2979886df2cc: Waiting
Step #2 - "detector": afbfc3e27982: Waiting
Step #2 - "detector": 27046f732e4e: Waiting
Step #2 - "detector": 7a4302826804: Waiting
Step #2 - "detector": eb078dded89c: Waiting
Step #2 - "detector": c661568c601b: Waiting
Step #2 - "detector": 8b4f47d49eb8: Waiting
Step #2 - "detector": 4f4fb700ef54: Waiting
Step #2 - "detector": 584a50f27d83: Verifying Checksum
Step #2 - "detector": 584a50f27d83: Download complete
Step #2 - "detector": 229c810fe4b6: Verifying Checksum
Step #2 - "detector": 229c810fe4b6: Download complete
Step #2 - "detector": fa3555d01e5c: Verifying Checksum
Step #2 - "detector": fa3555d01e5c: Download complete
Step #2 - "detector": 584a50f27d83: Pull complete
Step #2 - "detector": 7cadee99477d: Verifying Checksum
Step #2 - "detector": 7cadee99477d: Download complete
Step #2 - "detector": 229c810fe4b6: Pull complete
Step #2 - "detector": 67d3732ac306: Verifying Checksum
Step #2 - "detector": 67d3732ac306: Download complete
Step #2 - "detector": 67f333b251cc: Verifying Checksum
Step #2 - "detector": 67f333b251cc: Download complete
Step #2 - "detector": 8f7829806b7c: Verifying Checksum
Step #2 - "detector": 8f7829806b7c: Download complete
Step #2 - "detector": c5269ff7ab58: Verifying Checksum
Step #2 - "detector": c5269ff7ab58: Download complete
Step #2 - "detector": f6cfa6a7f25d: Verifying Checksum
Step #2 - "detector": f6cfa6a7f25d: Download complete
Step #2 - "detector": 52a8b2fcfc34: Verifying Checksum
Step #2 - "detector": 52a8b2fcfc34: Download complete
Step #2 - "detector": 06f428a8446f: Verifying Checksum
Step #2 - "detector": 06f428a8446f: Download complete
Step #2 - "detector": b59bca8d4380: Verifying Checksum
Step #2 - "detector": b59bca8d4380: Download complete
Step #2 - "detector": 2979886df2cc: Verifying Checksum
Step #2 - "detector": 2979886df2cc: Download complete
Step #2 - "detector": d77ba4498082: Verifying Checksum
Step #2 - "detector": d77ba4498082: Download complete
Step #2 - "detector": afbfc3e27982: Verifying Checksum
Step #2 - "detector": afbfc3e27982: Download complete
Step #2 - "detector": 27046f732e4e: Verifying Checksum
Step #2 - "detector": 27046f732e4e: Download complete
Step #2 - "detector": eb078dded89c: Verifying Checksum
Step #2 - "detector": eb078dded89c: Download complete
Step #2 - "detector": 7a4302826804: Verifying Checksum
Step #2 - "detector": 7a4302826804: Download complete
Step #2 - "detector": c661568c601b: Verifying Checksum
Step #2 - "detector": c661568c601b: Download complete
Step #2 - "detector": 4f4fb700ef54: Verifying Checksum
Step #2 - "detector": 4f4fb700ef54: Download complete
Step #2 - "detector": 67f333b251cc: Pull complete
Step #2 - "detector": 8b4f47d49eb8: Verifying Checksum
Step #2 - "detector": 8b4f47d49eb8: Download complete
Step #2 - "detector": 67d3732ac306: Pull complete
Step #2 - "detector": fa3555d01e5c: Pull complete
Step #2 - "detector": 7cadee99477d: Pull complete
Step #2 - "detector": 8f7829806b7c: Pull complete
Step #2 - "detector": f6cfa6a7f25d: Pull complete
Step #2 - "detector": c5269ff7ab58: Pull complete
Step #2 - "detector": 52a8b2fcfc34: Pull complete
Step #2 - "detector": b59bca8d4380: Pull complete
Step #2 - "detector": 06f428a8446f: Pull complete
Step #2 - "detector": d77ba4498082: Pull complete
Step #2 - "detector": 2979886df2cc: Pull complete
Step #2 - "detector": afbfc3e27982: Pull complete
Step #2 - "detector": 27046f732e4e: Pull complete
Step #2 - "detector": 7a4302826804: Pull complete
Step #2 - "detector": eb078dded89c: Pull complete
Step #2 - "detector": c661568c601b: Pull complete
Step #2 - "detector": 8b4f47d49eb8: Pull complete
Step #2 - "detector": 4f4fb700ef54: Pull complete
Step #2 - "detector": Digest: sha256:268a9ef00dd901e5f207edd928a7e0ee18c1b62d7868b03211e566eb1c90296c
Step #2 - "detector": Status: Downloaded newer image for us.gcr.io/gae-runtimes/buildpacks/nodejs12/builder:nodejs12_20200711_12_18_2_RC00
Step #2 - "detector": us.gcr.io/gae-runtimes/buildpacks/nodejs12/builder:nodejs12_20200711_12_18_2_RC00
Step #2 - "detector": ======== Output: google.nodejs.yarn-gcp-build@0.9.0 ========
Step #2 - "detector": yarn.lock not found.
Step #2 - "detector": ======== Output: google.nodejs.yarn@0.9.0 ========
Step #2 - "detector": yarn.lock not found.
Step #2 - "detector": ======== Results ========
Step #2 - "detector": skip: google.nodejs.yarn-gcp-build@0.9.0
Step #2 - "detector": fail: google.nodejs.yarn@0.9.0
Step #2 - "detector": pass: google.nodejs.appengine@0.9.0
Step #2 - "detector": ======== Output: google.nodejs.npm-gcp-build@0.9.0 ========
Step #2 - "detector": gcp-build script not found in package.json.
Step #2 - "detector": ======== Results ========
Step #2 - "detector": skip: google.nodejs.npm-gcp-build@0.9.0
Step #2 - "detector": pass: google.nodejs.npm@0.9.0
Step #2 - "detector": pass: google.nodejs.appengine@0.9.0
Step #2 - "detector": Resolving plan... (try #1)
Step #2 - "detector": 2 of 3 buildpacks participating
Step #2 - "detector": google.nodejs.npm       0.9.0
Step #2 - "detector": google.nodejs.appengine 0.9.0
Finished Step #2 - "detector"
Starting Step #3 - "analyzer"
Step #3 - "analyzer": Already have image (with digest): us.gcr.io/gae-runtimes/buildpacks/nodejs12/builder:nodejs12_20200711_12_18_2_RC00
Step #3 - "analyzer": ERROR: failed to initialize cache: failed to create image cache: accessing cache image "us.gcr.io/myapp/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache:latest": connect to repo store 'us.gcr.io/myapp/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache:latest': GET https://us.gcr.io/v2/myapp/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache/manifests/latest: DENIED: Permission denied for "latest" from request "/v2/myapp/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache/manifests/latest". 
Finished Step #3 - "analyzer"
ERROR
ERROR: build step 3 "us.gcr.io/gae-runtimes/buildpacks/nodejs12/builder:nodejs12_20200711_12_18_2_RC00" failed: step exited with non-zero status: 1

【问题讨论】:

  • 完全删除该行以查看问题是否消失。它可能类似于skip_files:,GAE 解释器无法将其识别为注释。另外,确保在部署时给它一个新版本
  • 没有改变同样的错误。而且我也确实更改了运行时:nodej10,但无论有没有它都没有工作。
  • 在部署时尝试使用--no-promote --no-stop-previous-version 标志。如果可行,请停止和/或删除旧版本。
  • Aaah 同样的错误伙计...无论如何我可以只上传 yaml 文件而不是整个应用程序吗?
  • 您能否使用 --log-http 和 --verbosity=debug 标志添加 gcloud app deploy 命令的输出? (记得编辑任何私人数据)

标签: google-app-engine gcloud


【解决方案1】:

要尝试的事情:

  1. 使用runtime: nodejs12 # (or nodejs10),而不仅仅是runtime: nodejs

  2. 删除# env:

  3. 部署时使用--no-promote --no-stop-previous-version 标志。如果可行,请停止和/或删除旧版本。

  4. 确保您已登录:gcloud auth login ...

【讨论】:

  • 谢谢,但它没有用。我都试过了,但都没有成功。
  • 没错。这就是为什么我说要使用runtime: nodejs12。使用runtime: nodejs12runtime: nodejs10 时会出现什么错误?
  • 好吧,所以使用 nodejs10 我得到了巨大的错误线,但使用 nodejs12 我得到了以下错误 - --- 文件上传完成。更新服务 [默认]...失败。错误:(gcloud.app.deploy)错误响应:[9] Cloud build 570f00c9-e462-4f2e-8314-ea75df68e590 状态:FAILURE 构建错误详细信息:构建错误详细信息不可用。完整的构建日志:console.cloud.google.com/cloud-build/builds/…
  • 哦,我已经检查过我收到了权限被拒绝错误,为什么?一周前它工作正常。
猜你喜欢
  • 1970-01-01
  • 2021-10-11
  • 2018-03-12
  • 2018-07-01
  • 2016-09-26
  • 2019-01-30
  • 1970-01-01
  • 2017-11-16
  • 1970-01-01
相关资源
最近更新 更多