Google-App-Engine

App Engine Flex 未能配置資源

  • March 13, 2018

在過去的兩天裡,我們遇到了部署問題。之前完美部署的應用程序。我們沒有對app.yaml.

做平常的事情,比如gcloud app deploy app.yaml

service: subscriber
runtime: nodejs
env: flex

env_variables:
 SCRIPT: subscriber.js
 LOG_LEVEL: info

health_check:
 enable_health_check: false

resources:
 memory_gb: 4

automatic_scaling:
 min_num_instances: 1
 max_num_instances: 40
 cpu_utilization:
   target_utilization: 0.75

建構照常進行,但最終失敗並出現錯誤:

34b3438ad618: Layer already exists
de5e96f3b52d: Layer already exists
21df82f90a72: Layer already exists
0529bceacd9f: Layer already exists
3578a2f7453e: Pushed
94aa0c608f65: Pushed
latest: digest: sha256:3addb3a35b43dc5c45ebc86ad10c7f8c7b4408c781095fd819bd94ac8d7b497b size: 2417
DONE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Updating service [subscriber] (this may take several minutes)...failed.                                                                                                                                                        
ERROR: (gcloud.app.deploy) Error Response: [13] App Engine Flex failed to configure resources.

Gcloud版本:

gcloud version
Google Cloud SDK 189.0.0
alpha 2017.09.15
beta 2017.09.15
bq 2.0.29
core 2018.02.12
gcloud 
gsutil 4.28
kubectl 

這可能與已啟用enable_health_check: false的應用程序的參數相關的最新版本相關。split_health_checks

您能否嘗試使用enable_health_check: true或執行命令進行部署:

gcloud app update --no-split-health-checks?

根據文件

更新後的執行狀況檢查更加精細,允許您使用單獨的檢查來確認您的 App Engine 實例正在執行(實時)並準備好提供內容(就緒)。預設情況下啟用這些健康檢查 。

這基本上意味著不需要包含enable_health_check: False. 如果您不想使用舊版執行狀況檢查,請省略這兩行。

另一方面,如果您想使用舊版執行狀況檢查,請執行以下命令:

gcloud app update --no-split-health-checks

並將健康檢查部分添加到您的配置文件中:

health_check:
 enable_health_check: True

 check_interval_sec: 5

 timeout_sec: 4
 unhealthy_threshold: 2
 healthy_threshold: 2

引用自:https://serverfault.com/questions/898586