3
votes

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-._/]+)|([a-z][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

2

2 Answers

1
votes

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

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.