In Google App Engine, there is a limitation of 60 seconds for a url to response. When you want to do some batch process, you might turn to use Task Queue where the limitation for a single request is 10 minutes and has some retry functionality.
If you run from local dev server, the error you got is Task task1 failed to execute.
While if you run from the production server, you might get this error:
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).
As the error message tells us, the main reason is about the request URL that kicks off a Task Queue.
Say, if you are saying in the app.yaml file,
- url: /admin/.*
Then you have a URL handler /admin/update_index which kicks off a Task Queue in the handler.
You will get this error because in order to use Task Queue, the request handler URL must require admin login ( which will bypass the user login required process when the Task Queue is trying to run, but in order to hit the URL, you still have to be the admin user of the app) or does not require login.
Both way would fix this problem. The solution depends on how you want to protect this Task Queue URL.
If you already say login:admin for that URL, but still got the same error ( which is in my case :) ). You might forget to add following codes into the app.yaml file:
– deferred: on
This is the case where you are using defer library to kick off a Task. So to solve the problem, you will have to add these two lines.
Also, you might also need to check the order of urls you defined in the app.yaml file if all above do not resolve your problem.
A coming URL request will always hit the first URL defined in app.yaml.
If you have following:
- url: /.*
All URL will fall into main.app.
You better do it in the reverse order of the above code.