Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine Node.js App - “Error parsing app.yaml: Unknown url handler type”

I recently set up a Node.js app in Google App Engine and it is running fine. I tried to add handlers so that all the requests to website can be redirected to https URLs. Below is my app.yaml file

# [START runtime]
runtime: nodejs
vm: true
# [END runtime]

# Temporary setting to keep gcloud from uploading node_modules
skip_files:
- ^node_modules$

# [START handlers]
handlers:
- url: /.*
  secure: always
# [END handlers]

When I tried to run the upload script, gcloud preview app deploy app.yaml, it throws below exception:

ERROR: (gcloud.preview.app.deploy) An error occurred while parsing file: [/Users/rakesharidasan/BackwaterBreaks-UI-Release/app.yaml]
Unknown url handler type in  line 14, column 17 (end of # [END handlers]).

I could see similar questions in StackOverflow, but many of them were related to indentation or white space issues. I believe my app.yaml got right indentation and I checked it through few online parsers eg - http://codebeautify.org/yaml-validator

The upload script will still run if I remove the handlers part from yaml.

Any ideas what goes wrong here?

like image 317
Rakes Avatar asked Dec 30 '15 15:12

Rakes


1 Answers

The handler section must also specify a handler type, in this case a script or the main entry point to your app

Example:

- url: /.*
  script: app.js
  secure: always
like image 95
Jeffrey Godwyll Avatar answered Sep 25 '22 00:09

Jeffrey Godwyll