Google App Engine自定义运行时应用程序启动错误

时间:2018-09-24 09:30:26

标签: python docker google-app-engine google-cloud-platform

我正在尝试将docker映像部署到Google App Engine。该图像是使用Apache HTTP作为Web服务器的Django Web应用程序。以下是app.yaml内容

entrypoint: "apachectl start"
env: flex
runtime: custom
service: myservice

App Engine部署时抛出以下错误,而没有任何其他信息:

OperationError: Error Response: [9]
Application startup error:

docker镜像在Kubernetes(GKE)和本地上都可以正常工作。我什至尝试使用其他入口点-python /app/MyAPP/manage.py runserver 0.0.0.0:8080,但弹出相同的错误

我使用命令-gcloud app deploy --image-url gcr.io/my-12345/myapp:1进行部署。

如何解决此错误?我还能尝试获得有关该错误的其他信息吗?

更新
添加所有shell消息

~/appengine/myapp-py$ gcloud app deploy --image-url gcr.io/myapp-12345/myapp-gae:1 --verbosity debug
DEBUG: Running [gcloud.app.deploy] with arguments: [--image-url: "gcr.io/myapp-12345/myapp-gae:1", --verbosity: "debug"]
INFO: Refreshing access_token
DEBUG: API endpoint: [https://appengine.googleapis.com/], API version: [v1]
Services to deploy:
descriptor:      [/home/shiva.kumar/appengine/myapp-py/app.yaml]
source:          [/home/shiva.kumar/appengine/myapp-py]
target project:  [myapp-12345]
target service:  [myapp-py5]
target version:  [20180926t140734]
target url:      [https://myapp-py5-dot-myapp-12345.appspot.com]


Do you want to continue (Y/n)?  Y

DEBUG: No bucket specified, retrieving default bucket.
DEBUG: Using bucket [gs://staging.myapp-12345.appspot.com].
DEBUG: Service [appengineflex.googleapis.com] is already enabled for project [myapp-12345]
Beginning deployment of service [myapp-py5]...
WARNING: Deployment of service [myapp-py5] will ignore the skip_files field in the configuration file, because the image has already been built.
DEBUG: Converted YAML to JSON: "{
  "betaSettings": {
    "module_yaml_path": "app.yaml",
    "vm_runtime": "custom"
  },
  "env": "flex",
  "envVariables": {
    "APP_ENVIRONMENT": "gcp-gae-myapp",
    "PG_PORT_REPLICA": "5432"
  },
  "handlers": [
    {
      "script": {
        "scriptPath": "PLACEHOLDER"
      },
      "urlRegex": ".*"
    }
  ],
  "runtime": "vm"
}"
DEBUG: Operation [apps/myapp-12345/operations/55959e89-9504-4c76-884f-77aa19a71fef] not complete. Waiting to retry.
Updating service [myapp-py5] (this may take several minutes)...⠛DEBUG: Operation [apps/myapp-12345/operations/55959e89-9504-4c76-884f-77aa19a71fef] not complete. Waiting to retry.
Updating service [myapp-py5] (this may take several minutes)...⠹DEBUG: Operation [apps/myapp-12345/operations/55959e89-9504-4c76-884f-77aa19a71fef] not complete. Waiting to retry.
.....
A lot of Waiting to retry messages
.....
.....
Updating service [myapp-py5] (this may take several minutes)...⠹DEBUG: Operation [apps/myapp-12345/operations/55959e89-9504-4c76-884f-77aa19a71fef] complete. Result: {
    "metadata": {
        "user": "shiva.kumar@dummysite.com",
        "target": "apps/myapp-12345/services/myapp-py5/versions/20180926t140733",
        "@type": "type.googleapis.com/google.appengine.v1.OperationMetadataV1",
        "insertTime": "2018-09-26T08:37:39.851Z",
        "method": "google.appengine.v1.Versions.CreateVersion"
    },
    "done": true,
    "name": "apps/myapp-12345/operations/55959e89-9504-4c76-884f-77aa19a71fef",
    "error": {
        "message": "\nApplication startup error:\n",
        "code": 9
    }
}
Updating service [myapp-py5] (this may take several minutes)...failed.
DEBUG: (gcloud.app.deploy) Error Response: [9]
Application startup error:
Traceback (most recent call last):
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 848, in Execute
    resources = calliope_command.Run(cli=self, args=args)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 770, in Run
    resources = command_instance.Run(args)
  File "/usr/lib/google-cloud-sdk/lib/surface/app/deploy.py", line 90, in Run
    parallel_build=False)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 598, in RunDeploy
    flex_image_build_option=flex_image_build_option)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 407, in Deploy
    extra_config_settings)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/appengine_api_client.py", line 206, in DeployService
    poller=done_poller)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 315, in WaitForOperation
    sleep_ms=retry_interval)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 254, in WaitFor
    sleep_ms, _StatusUpdate)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 316, in PollUntilDone
    sleep_ms=sleep_ms)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/util/retry.py", line 229, in RetryOnResult
    if not should_retry(result, state):
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 310, in _IsNotDone
    return not poller.IsDone(operation)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 184, in IsDone
    encoding.MessageToPyValue(operation.error)))
OperationError: Error Response: [9]
Application startup error:

ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:

~/appengine/myapp-py$

0 个答案:

没有答案