Google App Engine Python:部署时yaml配置文件中出现错误 [英] Google App Engine Python: Error in yaml config file when deploying

查看:52
本文介绍了Google App Engine Python:部署时yaml配置文件中出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google App Engine和Python37环境. 今天尝试部署微服务时收到错误消息:
我运行命令:

I'm using Google App Engine, Python37 environment. I got an error message when trying to deploy a microservice today:
I run the command:

gcloud app deploy app.yaml

得到错误:

...
File upload done.
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: script field for handler '/.*' 
must be set to 'auto' for runtime python37.
PS C:\path_to_app> gcloud app deploy app.yaml
...

我的app.yaml是:

My app.yaml is:

service: service_name
runtime: python37

handlers:
- url: /.*
script: main.py

它与我最近部署的其他微服务看起来完全一样,只是服务名称不同.
我尝试重新部署已经运行的服务,并收到相同的错误消息.
因此,我仔细检查了app.yaml参考文档: https://cloud.google .com/appengine/docs/standard/python3/config/appref
但是我既无法找出问题所在,也不能解释为什么以前使用过的同一个yaml文件不再起作用.

有谁知道最近几天在Google App Engine上可能出什么问题或可以更改什么?

预先感谢.

It looks exactly the same from other microservices that I have deployed recently, just the service name is different.
I tried to re-deploy a services that is already running and got same error message.
So I double check app.yaml reference document: https://cloud.google.com/appengine/docs/standard/python3/config/appref
But I couldn't find out what is wrong neither why the same yaml file that had worked before doesn't work anymore.

Does anyone know what can be wrong or maybe what can be changed on Google App Engine in the last days?

Thanks in advance.

推荐答案

根据适用于Python 3.7的AppEngine文档

脚本元素唯一接受的值是自动

The only accepted value for the script element is auto

以下是文档中的示例条目:

Below is a sample entry from the documentation:

handlers:
- url: /images
  static_dir: static/images

- url: /.*
  secure: always
  redirect_http_response_code: 301
  script: auto

这篇关于Google App Engine Python:部署时yaml配置文件中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆