Google App Engine "Error parsing ./app.yaml: Unknown url handler type"
In case anyone else comes across this, I had the same issue. You must add TWO spaces for all subdirectories. Make sure the words are in line with "url".
Doesn't work:
- url: /
script: phpMyAdmin/index.php
secure: always
login: admin
Doesn't work:
- url: /
script: phpMyAdmin/index.php
secure: always
login: admin
WORKS:
- url: /
script: phpMyAdmin/index.php
secure: always
login: admin
Also, change the line to update the app from this:
appcfg.py -R -A my_application_id -V phpmyadmin update .
To this:
appcfg.py --oauth2 -R -A my_application_id -V phpmyadmin update .
For some odd reason, the first command asks for your email and password (my personal email didn't work). Using the second command with the --oauth2 option just works.
In my case, it was not a whitespace issue.
I originally had the app.yaml file:
runtime: nodejs12
handlers:
- url: /.*
secure: always
... more handlers here ...
which produced the error when deploying
Unknown url handler type.
<URLMap
secure=always
...
>
The docs at https://cloud.google.com/appengine/docs/standard/nodejs/config/appref#handlers_element indicated that I was missing script: auto
in my handler element.
In order to use static handlers, at least one of your handlers must contain the line script: auto or define an entrypoint element to deploy successfully.
So I updated my app.yaml:
runtime: nodejs12
handlers:
- url: /.*
secure: always
script: auto
... more handlers here ...
which deploys successfully.
Try adding a space for any sub item. PHP uses the same parser as python. In python white space is used to denote blocks.
application: phpmyadmin2121
version: phpmyadmin
runtime: php
api_version: 1
handlers:
- url: /(.*\.(ico$|jpg$|png$|gif$))
static_files: phpMyAdmin/\1
upload: phpMyAdmin/(.*\.(ico$|jpg$|png$|gif$))
application_readable: true
- url: /(.*\.(htm$|html$|css$|js$))
static_files: phpMyAdmin/\1
upload: phpMyAdmin/(.*\.(htm$|html$|css$|js$))
application_readable: true
- url: /(.*\.(php$))
script: phpMyAdmin/\1
secure: always
login: admin
- url: /(.+)
script: phpMyAdmin/index.php
secure: always
login: admin
- url: /
script: phpMyAdmin/index.php
secure: always
login: admin