Python端点快速启动应用程序引擎部署错误

Python端点快速启动应用程序引擎部署错误,python,google-app-engine,google-cloud-endpoints,Python,Google App Engine,Google Cloud Endpoints,我试图按照找到的分步教程进行操作,但部署不起作用,总是返回错误响应:[13]出现内部错误 我没有更改示例代码本身中的任何内容。正如我所说,我只是仔细地遵循了链接教程。当我尝试gcloud app deploy时,它失败并返回上述错误 使用gcloud app deploy--verbosity debug会带来一些stacktrace,但没有任何有用的意义。为了完整起见,我复制了以下内容: Updating service [default] (this may take several min

我试图按照找到的分步教程进行操作,但部署不起作用,总是返回
错误响应:[13]出现内部错误

我没有更改示例代码本身中的任何内容。正如我所说,我只是仔细地遵循了链接教程。当我尝试
gcloud app deploy
时,它失败并返回上述错误

使用
gcloud app deploy--verbosity debug
会带来一些stacktrace,但没有任何有用的意义。为了完整起见,我复制了以下内容:

Updating service [default] (this may take several minutes)...failed.
DEBUG: (gcloud.app.deploy) Error Response: [13] An internal error occurred
Traceback (most recent call last):
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 791, in Execute
    resources = calliope_command.Run(cli=self, args=args)
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 756, in Run
    resources = command_instance.Run(args)
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/surface/app/deploy.py", line 65, in Run
    parallel_build=False)
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 587, in RunDeploy
    flex_image_build_option=flex_image_build_option)
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 395, in Deploy
    extra_config_settings)
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/appengine_api_client.py", line 188, in DeployService
    message=message)
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 244, in WaitForOperation
    sleep_ms=retry_interval)
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 266, in WaitFor
    sleep_ms=sleep_ms)
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/googlecloudsdk/core/util/retry.py", line 222, in RetryOnResult
    if not should_retry(result, state):
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 260, in _IsNotDone
    return not poller.IsDone(operation)
  File "/Users/jamesmiranda/Documents/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 169, in IsDone
    encoding.MessageToPyValue(operation.error)))
OperationError: Error Response: [13] An internal error occurred
ERROR: (gcloud.app.deploy) Error Response: [13] An internal error occurred
下面是app.yaml(与示例git完全相同,但APPID除外):

到目前为止,我一直在尝试:

  • 将python版本更改为python 2(python_版本:2)
  • 在app.yaml中包含一些要跳过的文件(从标准env中的端点框架复制)

    跳过文件:

    -^(.*/)?#..*$

    -^(.*/)?.*$

    -^(.*/)?.\.py[co]$

    -^(.*/)?.*/RCS/*$

    -^(.*/)?\..*$

    -^(.*/)?setuptools/script\(dev\).tmpl$

  • 尝试了来自的解决方法

    gcloud配置集应用/使用\u不推荐\u准备为真

什么都没用。我做错了什么

注:

  • 它可以根据信息在本地正常工作
  • 一切都在GAE标准环境下工作
  • 我没有发现端点本身有任何问题(我可以在API资源管理器中看到它的部署),但应用程序部署没有以任何方式工作

如果您使用的app.yaml文件与您在问题中复制的文件完全相同,则您输入的名称和配置id中似乎有错误。根据问题中提供的信息,您的app.yaml应该是:

runtime: python
env: flex
entrypoint: gunicorn -b :$PORT main:app

runtime_config:
  python_version: 3

# [START configuration]
endpoints_api_service:
  # The following values are to be replaced by information from the output of
  # 'gcloud endpoints services deploy openapi-appengine.yaml' command.
  name:  "echo-api.endpoints.MYAPPID.cloud.goog"
  config_id: "2018-01-09r1"
 # [END configuration]
"my-project-id.appspot.com"
请注意,您没有在引号内输入name和config_id的值,也不应该在括号内输入config_id

我自己也试过,效果不错。如果它仍然不适合您,可能您的名字不正确,因为格式似乎是:

  • “示例project.appspot.com”
因此,如果您的项目id是,即我的项目id,那么您的名称将如下所示:

runtime: python
env: flex
entrypoint: gunicorn -b :$PORT main:app

runtime_config:
  python_version: 3

# [START configuration]
endpoints_api_service:
  # The following values are to be replaced by information from the output of
  # 'gcloud endpoints services deploy openapi-appengine.yaml' command.
  name:  "echo-api.endpoints.MYAPPID.cloud.goog"
  config_id: "2018-01-09r1"
 # [END configuration]
"my-project-id.appspot.com"

如果您使用的app.yaml文件与您在问题中复制的文件完全相同,则您输入的名称和配置id中似乎有错误。根据问题中提供的信息,您的app.yaml应该是:

runtime: python
env: flex
entrypoint: gunicorn -b :$PORT main:app

runtime_config:
  python_version: 3

# [START configuration]
endpoints_api_service:
  # The following values are to be replaced by information from the output of
  # 'gcloud endpoints services deploy openapi-appengine.yaml' command.
  name:  "echo-api.endpoints.MYAPPID.cloud.goog"
  config_id: "2018-01-09r1"
 # [END configuration]
"my-project-id.appspot.com"
请注意,您没有在引号内输入name和config_id的值,也不应该在括号内输入config_id

我自己也试过,效果不错。如果它仍然不适合您,可能您的名字不正确,因为格式似乎是:

  • “示例project.appspot.com”
因此,如果您的项目id是,即我的项目id,那么您的名称将如下所示:

runtime: python
env: flex
entrypoint: gunicorn -b :$PORT main:app

runtime_config:
  python_version: 3

# [START configuration]
endpoints_api_service:
  # The following values are to be replaced by information from the output of
  # 'gcloud endpoints services deploy openapi-appengine.yaml' command.
  name:  "echo-api.endpoints.MYAPPID.cloud.goog"
  config_id: "2018-01-09r1"
 # [END configuration]
"my-project-id.appspot.com"

打字错误?我真丢脸。很明显,现在一切都好了。打字错误?我真丢脸。显然,现在一切正常。