Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 571
Ryan Coleman Avatar asked Aug 02 '26 02:08

Ryan Coleman


1 Answers

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/(.*)
like image 148
Stephen Rauch Avatar answered Aug 04 '26 14:08

Stephen Rauch