我使用bellow命令将php应用程序部署到应用程序引擎:
gcloud app deploy --promote --project test12 app-live.yaml --log-http --verbosity=debug
我的app-live.yaml文件:
runtime: php72
api_version: 1
env_variables:
VERSION: '2.0'
APP_MODE: live
GOOGLE_CLOUD_PROJECT: xx
CLOUD_STORAGE_BUCKET: xx.appspot.com
GOOGLE_APPLICATION_CREDENTIALS: data/file.json
handlers:
# Serve images as static resources.
- url: /(.+\.(gif|png|jpg|jpeg|js|css|ttf|woff2|otf|eot|svg|ttf|woff|ico|map))$
static_files: \1
upload: .+\.(gif|png|jpg|jpeg|js|css|ttf|woff2|otf|eot|svg|ttf|woff|ico|map)$
application_readable: true
http_headers:
X-file-Header: static
Access-Control-Allow-Origin: "*"
- url: /cron/(.*)
script: cron/\1
- url: /.*
script: index.php
secure: always
error_handlers:
- error_code: over_quota
file: layout/html/over_quota.html
但显示此错误:
HttpBadRequestError:访问https://appengine.googleapis.com/v1/apps/ads-clickgs/services/default/versions?alt=json的HttpError:响应:<{'status':'400','content-length':'252','x-xss-protection':'1; mode = block','x-content-type-options':'nosniff','transfer-encoding':'chunked','vary':'Origin,X-Origin,Referer','server':'ESF' ,'-content-encoding':'gzip','cache-control':'private','date':'Tue,28 Aug 2018 04:44:34 GMT','x-frame-options':'SAMEORIGIN ','alt-svc':'quic =“:443”; ma = 2592000; v =“ 44,43,39,35”','content-type':'application / json; charset = UTF-8'}>,内容<{ “错误”:{ “代码”:400, “ message”:“请更新至gcloud的最新版本。如果您直接使用API,请为version.entrypoint.shell提供一个值。该值可以为空。”, “状态”:“ INVALID_ARGUMENT” }
我在Google上进行了搜索,但未找到任何建议。
答案 0 :(得分:1)
我遇到了同样的问题,并使用:
进行了修复gcloud components update
由于我没有修改SDK安装目录的权限,因此建议我运行:(您可能要适应自己的路径)
sudo /usr/local/google-cloud-sdk/bin/gcloud components update
然后我的gcloud app deploy
命令再次起作用:)