I have a pretty simple application. One of the things I do is when someone creates a new widget, I add a task to a task queue to get a qr code image for the widget and save it in the blob.
I have a queue defined as:
queue:
- name: workqueue
target: worker
rate: 5/s
I have a backend defined as:
backends:
- name: worker
options: dynamic
class: B1
snippet of app.yaml:
handlers:
- url: /tasks/fetchimage
script: worker.py
login: admin
In my code, when the user creates the widget the following is called:
taskqueue.add(#queue_name="workqueue",
url="/tasks/fetchimage",
method="GET",
params={"design_id": design_id})
With “queue_name=”workqueue” commented out, everything works fine (uses the default queue which does not go to the backend). If I remove the comment, I get the following error in the logs:
0.1.0.2 – – [04/Jan/2012:19:05:29 -0800] “GET /tasks/fetchimage?design_id=9034 HTTP/1.1” 302 0
…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).
Am I missing something? I assume app.yaml settings apply to backends. Is this assumption incorrect?
You should remove
login: adminfrom the backend handler, and make sure the backend is private if you don’t want users to be able to access that url.See the backends documentation for more details.