【问题标题】:Error while trying to deploy app on google app engine尝试在谷歌应用引擎上部署应用时出错
【发布时间】:2026-02-14 19:25:06
【问题描述】:

我正在努力在具有灵活运行时的谷歌应用引擎上部署 python 3.6 脚本。我无法部署它,这是我得到的错误:

Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: [4] Timed out waiting for the app infrastructure to become healthy.

所以我检查了gcloud app deploy --verbosity debug 出了什么问题,我得到了这个解释:

Updating service [default] (this may take several minutes)...|DEBUG: Operation [apps/[Project ID]/operations/2d76a22c-64d7-4e2e-95ee-7c01ee09d42a] not complete. Waiting to retry.

我一直在谷歌搜索并试图找到一个解决方案,我能得到的最接近的是我的 app.yaml 文件有问题。现在,我第一次使用 .yaml 文件,所以我复制了 google 文档中的那个文件,只是将入口点更改为我的脚本。

runtime: python
env: flex
entrypoint: python main.py

runtime_config:
  python_version: 3.6

# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml
manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

我不知道自己做错了什么,非常感谢帮助在应用引擎上设置此脚本!

【问题讨论】:

    标签: python-3.x google-app-engine google-cloud-platform gcloud app.yaml


    【解决方案1】:

    请耐心等待。有时它需要比其他时间更长的时间。如果有错误,它会告诉你。如果有很多更新的文件,上传并保存它们需要一段时间。有时,您必须重试,因为它可能由于后端原因而失败

    【讨论】:

    • 哈哈,我想耐心是一种美德是有原因的:D