繁体   English   中英

app.yaml文件 - 无法为属性'runtime'赋值'python27 api_version':

[英]app.yaml file - Unable to assign value 'python27 api_version' to attribute 'runtime':

我试图通过谷歌应用程序引擎部署一个非常简单的网页,但由于我的yaml文件有些错误,我无法部署该应用程序。

错误:

(gcloud.app.deploy)解析文件时发生错误:[/ home / google_gcp / parkwaypoc / app.yaml]无法为属性'runtime'赋值'python27 api_version':运行时值'python27 api_version'不匹配表达式'^(?:((gs:// [a-z0-9 -._ /] +)|([az] [a-z0-9-] {0,29})))$'

我的App.yaml文件:

 runtime:python27
 api_version:1
 threadsafe:true

 handlers:- url:/
   static_files:www/index.html
   upload:www/index.html

 - url:/(.*)
   static_files:www/\1
   upload:www/(.*)

我用相同的问题搜索了其他人,暗示了空白问题所以他们被删除但我无法解决。

yaml文件是直接从Google复制的: https//cloud.google.com/appengine/docs/standard/python/getting-started/hosting-a-static-website#uploading_your_files_to_google_app_engine

对不起,我对此有点新鲜。

问候,瑞恩

您的app.yaml 不是 指定链接的直接剪切和粘贴。 已发布的yaml已被清除,并且无法正确解析为yaml。

尝试:

runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html

- url: /(.*)
  static_files: www/\1
  upload: www/(.*)

我遇到过同样的问题。 检查您的yaml文件,以获取行前面的额外空格。 当我从Google链接复制粘贴时,我遇到了这个问题。 我删除了额外的缩进,它工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM