4

Please tell me to deploy my project for GAE.

I can not deploy my project because of the following error.

%appcfg.py update app.yaml dispatch.yaml worker.yaml
(omissions)
appcfg.py: error: Error parsing ./dispatch.yaml: Unexpected attribute 'dispatch' for object of type AppInfoExternal.
in "./dispatch.yaml", line 4, column 1.

This project has the following yaml files in direct project folder.

app.yaml

dipatch.yaml

worker.yaml

The following is dispatch.yaml.

application: my-app

dispatch:
- url: "*/worker/*"
  module: worker

The following is worker.yaml.

application: my-app
module: worker
api_version: 1
threadsafe: false
version: uno
runtime: python27
instance_class: B1
manual_scaling:
    instances: 1
handlers:
- url: /_ah/start
    script: my-worker.app
prk2
  • 147
  • 2
  • 9

6 Answers6

2

Also, make sure you run appcfg.py update_dispatch, which is a separate command from update

GAEfan
  • 11,244
  • 2
  • 17
  • 33
1

Wrong indenting. Should be:

application: my-app

dispatch:
  - url: "*/worker/*"
    module: worker
GAEfan
  • 11,244
  • 2
  • 17
  • 33
  • 1
    I think you are **strict**, but no spaces indentation in this case doesn't seems to be required. See this http://stackoverflow.com/a/17014973/338986, also [google doesn't seem to be bothered](https://developers.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_About_app_yaml). – hiroshi Jul 02 '14 at 02:36
  • well, in the `dispatch.yaml` docs, Google uses indentation: https://developers.google.com/appengine/docs/python/modules/routing#dispatch_file The error you received refers to `line 4, column 1`, which is the line that should be indented. – GAEfan Jul 02 '14 at 02:45
1

First of all, dispatch.yaml doesn't seem to be allowed to be an argument of appcfg.py update. The error message must indicate that.

Try:

appcfg.py update app.yaml worker.yaml

Also, dispatch.yaml are not an application config, but the dispatch file. So you may not allowed to write attributes other than dispatch.

hiroshi
  • 6,871
  • 3
  • 46
  • 59
1

modules included in dispatch must come before the dispatch.yaml in appcfg.py update, so correct command is:

appcfg.py update app.yaml worker.yaml dispatch.yaml
0

I got a similar problem in latest gcp deployment, i.e, using gcloud command.

I got rid of application from dispatch.yaml and this error was gone.

Uday Reddy
  • 1,337
  • 3
  • 16
  • 38
0

I just ran into an identical error message and eventually what I discovered is that Google requires the dispatch file to be called dispatch.yaml.

My file was something like web.dispatch.yaml, which Google does not like. Renaming my file to dispatch.yaml did the trick.

plowman
  • 13,335
  • 8
  • 53
  • 53