1
votes

I have an App Engine Python Application which has an endpoint that puts a task in the Task Queue. - This is working fine.

I have a Task Handler Python Application which will be execute the task in the queue.

When the task handler is invoked, the below error accurs

Request failed because URL requires user login. For requests invoked within App Engine (offline requests like Task Queue, or webhooks like XMPP and Incoming Mail), the URL must require admin login (or no login).

My App Engine Python Application app.yml is below

service: dataload-test
runtime: python27
api_version: 1
threadsafe: true

handlers:
  - url: /.*
    script: main.app

  - url: /_ah/queue/deferred
    script: google.appengine.ext.deferred.deferred.application
    login: admin


libraries:
  - name: ssl
    version: latest

builtins:
  - deferred: on
  - appstats: on

env_variables:
  GAE_USE_SOCKETS_HTTPLIB : 'true'

My Task Handler Application app.yml is below

service: adobe-dataload-worker
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: load_data_worker.app
  login: admin

Any help would be appreciated

1

1 Answers

1
votes

Your wildcard - url: /.* handler is handling EVERY URL.

Put that last, or else the deferred handler will never be seen:

handlers:
  - url: /_ah/queue/deferred
    script: google.appengine.ext.deferred.deferred.application
    login: admin

  - url: /.*
    script: main.app