appengine flex部署失败,错误代码为400

在过去的几个月中,我已经成功部署到应用程序引擎。 我正在尝试将相同的应用程序部署到另一个作为我的临时环境创build的项目中。

代码是完全一样的,app.yaml只更改为反映新的数据库和redis连接,我作为环境variables传递。

build设进展顺利,但最终我得到以下

"metadata": { "target": "apps/freesat-stage-project/services/default/versions/athiqtest4", "method": "google.appengine.v1.Versions.CreateVersion", "user": "[email protected]", "insertTime": "2017-11-08T11:11:59.089Z", "ephemeralMessage": "Deployment failed. Attempting to cleanup deployment artifacts.", "@type": "type.googleapis.com/google.appengine.v1.OperationMetadataV1" }, "done": true, "name": "apps/freesat-stage-project/operations/2e41e4e5-b9bd-42fb-9fd3-319ec322458b", "error": { "message": "Deployment Manager operation failed, name: operation-1510139527034-55d76c211f490-1fcc927b-d3b3b590, error: [{\"code\":\"RESOURCE_ERROR\",\"location\":\"/deployments/aef-default-athiqtest4/resources/aef-default-athiqtest4-00ahs\",\"message\":\"{\\\"ResourceType\\\":\\\"compute.v1.httpsHealthCheck\\\",\\\"ResourceErrorCode\\\":\\\"400\\\",\\\"ResourceErrorMessage\\\":{\\\"code\\\":400,\\\"errors\\\":[{\\\"domain\\\":\\\"global\\\",\\\"message\\\":\\\"Invalid value for field 'resource.checkIntervalSec': '0'. Must be greater than or equal to 1\\\",\\\"reason\\\":\\\"invalid\\\"},{\\\"domain\\\":\\\"global\\\",\\\"message\\\":\\\"Invalid value for field 'resource.timeoutSec': '0'. Must be greater than or equal to 1\\\",\\\"reason\\\":\\\"invalid\\\"},{\\\"domain\\\":\\\"global\\\",\\\"message\\\":\\\"Invalid value for field 'resource.unhealthyThreshold': '0'. Must be greater than or equal to 1\\\",\\\"reason\\\":\\\"invalid\\\"},{\\\"domain\\\":\\\"global\\\",\\\"message\\\":\\\"Invalid value for field 'resource.healthyThreshold': '0'. Must be greater than or equal to 1\\\",\\\"reason\\\":\\\"invalid\\\"}],\\\"message\\\":\\\"Invalid value for field 'resource.checkIntervalSec': '0'. Must be greater than or equal to 1\\\",\\\"statusMessage\\\":\\\"Bad Request\\\",\\\"requestPath\\\":\\\"https://www.googleapis.com/compute/v1/projects/freesat-stage-project/global/httpsHealthChecks\\\",\\\"httpMethod\\\":\\\"POST\\\"}}\"}, {\"code\":\"RESOURCE_ERROR\",\"location\":\"/deployments/aef-default-athiqtest4/resources/aef-default-athiqtest4-hcs\",\"message\":\"{\\\"ResourceType\\\":\\\"compute.v1.httpsHealthCheck\\\",\\\"ResourceErrorCode\\\":\\\"400\\\",\\\"ResourceErrorMessage\\\":{\\\"code\\\":400,\\\"errors\\\":[{\\\"domain\\\":\\\"global\\\",\\\"message\\\":\\\"Invalid value for field 'resource.checkIntervalSec': '0'. Must be greater than or equal to 1\\\",\\\"reason\\\":\\\"invalid\\\"},{\\\"domain\\\":\\\"global\\\",\\\"message\\\":\\\"Invalid value for field 'resource.timeoutSec': '0'. Must be greater than or equal to 1\\\",\\\"reason\\\":\\\"invalid\\\"},{\\\"domain\\\":\\\"global\\\",\\\"message\\\":\\\"Invalid value for field 'resource.unhealthyThreshold': '0'. Must be greater than or equal to 1\\\",\\\"reason\\\":\\\"invalid\\\"},{\\\"domain\\\":\\\"global\\\",\\\"message\\\":\\\"Invalid value for field 'resource.healthyThreshold': '0'. Must be greater than or equal to 1\\\",\\\"reason\\\":\\\"invalid\\\"}],\\\"message\\\":\\\"Invalid value for field 'resource.checkIntervalSec': '0'. Must be greater than or equal to 1\\\",\\\"statusMessage\\\":\\\"Bad Request\\\",\\\"requestPath\\\":\\\"https://www.googleapis.com/compute/v1/projects/freesat-stage-project/global/httpsHealthChecks\\\",\\\"httpMethod\\\":\\\"POST\\\"}}\"}]", "code": 13 } 

}我的app.yaml厕所如下

  runtime: custom env: flex env_variables: REDIS_HOST: 10.154.0.3 REDIS_PORT: 6379 DB_NAME: freesat DB_USER: freesat-stage DB_PASS: password DB_HOST: /cloudsql/freesat-stage-project:europe-west2:freesat-stage GS_BUCKET_NAME: freesat-content DJANGO_CONF: conf.production JANRAIN_CLIENT_ID: clientid JANRAIN_SECRET: secret DOTMAILER_API_USER: [email protected] DOTMAILER_API_PASS: pass health_check: enable_health_check: False automatic_scaling: min_num_instances: 4 max_num_instances: 15 cpu_utilization: target_utilization: 0.4 beta_settings: cloud_sql_instances: 'freesat-stage-project:europe-west2:freesat-stage' resources: cpu: 2 memory_gb: 2 

我无法理解错误信息。 任何帮助将是appreicated。

新创build的App Engine项目现在使用更新的拆分运行状况检查 。

这意味着您试图在app.yaml中使用enable_health_check禁用传统运行状况检查是造成问题的原因。

因此,您可以从yaml文件中删除旧的health_check设置,或者通过运行gcloud命令gcloud beta app update --no-split-health-checks --project [YOUR_PROJECT_ID]禁用项目的新分割运行状况检查(并继续使用旧式运行状况检查) gcloud beta app update --no-split-health-checks --project [YOUR_PROJECT_ID]来解决问题。