【问题标题】:ERROR: An app.yaml (or appengine-web.xml) file is required to deploy this directory as an App Engine application错误:需要 app.yaml(或 appengine-web.xml)文件才能将此目录部署为 App Engine 应用程序
【发布时间】:2020-11-26 02:15:49
【问题描述】:

当我尝试通过 Cloud Build 将 Python 代码部署到 Google App Engine (GAE) 时,我收到以下错误消息:

ERROR: An app.yaml (or appengine-web.xml) file is required to deploy this directory as an App Engine application
ERROR: (gcloud.app.deploy) [/workspace] could not be identified as a valid source directory or file.
ERROR: build step 0 "gcr.io/google.com/cloudsdktool/cloud-sdk" failed: step exited with non-zero status

有人能解释一下导致这个错误的原因吗?

【问题讨论】:

  • 详细信息在哪里?
  • 你能分享更多关于你的代码树、你的构建步骤......
  • 结构是源码,app.yaml和cloudbuild.yaml

标签: python google-app-engine google-cloud-platform google-cloud-build google-cloud-sdk


【解决方案1】:

App Engine 中的 Python 应用是使用 app.yaml 配置的,其中包含 CPU、内存、网络和磁盘资源、缩放以及包括环境变量在内的其他常规设置。通过查看此错误消息,您的 app.yaml 似乎丢失了。您可以在此处阅读有关如何配置应用程序的更多信息:Configuring your App with app.yaml

【讨论】:

  • .yaml 是否已检查语法错误?我同意上面的用户。我们需要查看: - 您的 app.yaml 文件, - 您正在使用哪个 Google App Engine(标准或 Flex)? - 您正在运行哪个 Python? - 你是如何部署它的? - 昨天@guillaume-blaquiere 指出的您的代码目录结构如果您使用此信息更新您的问题,我们可以为您提供指导。
  • runtime: python3 api_version: 1 threadsafe: true handlers: - url: / script: ether-api.py
  • 我使用的是appengine标准和python3
猜你喜欢
  • 2021-07-12
  • 2017-06-23
  • 1970-01-01
  • 2021-05-23
  • 2020-07-10
  • 2017-02-02
  • 2011-07-01
  • 1970-01-01
  • 2021-07-10
相关资源
最近更新 更多