简体   繁体   中英

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

I am trying to deploy a very simple webpage via Google app engine but am unable to deploy the app due to some error with my yaml file.

Error:

(gcloud.app.deploy) An error occurred while parsing file: [/home/google_gcp/parkwaypoc/app.yaml] Unable to assign value 'python27 api_version' to attribute 'runtime': Value 'python27 api_version' for runtime does not match expression '^(?:((gs://[a-z0-9-._/]+)|([az][a-z0-9-]{0,29})))$'

My App.yaml file:

 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/(.*)

I've searched others with the same issue which hint at issues with whitespaces so they were removed but I haven't been able to resolve.

The yaml file was copied directly from Google here: https://cloud.google.com/appengine/docs/standard/python/getting-started/hosting-a-static-website#uploading_your_files_to_google_app_engine

Sorry i'm a bit new to this.

Regards, Ryan

Your app.yaml is NOT a direct cut and paste from the indicated link . The posted yaml is hosed and does not parse correctly as yaml.

Try:

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/(.*)

I had the same issue. Check your yaml file for extra spaces in front of the lines. I had that issue when I copy pasted from the Google link. I removed the extra indents and it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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