Reputation: 2299
I'm using AppEngine's deferred.defer, roughly based on this example.
It works fine in my development environment, but in my deployed version the tasks starts, then fails silently, then retries. I can see the task in the tasks view, and the only hint of an error is in the task's Previous Run tab it says:
Last http response code 404
But I dont know what that 404 refers to.
I have logging.info statements in the function being passed to deferred, but nothing is being written to the log. I've wrapped the whole thing in a try/except block, to logging.error any errors, but still nothing shows in the logs.
It looks like there is something preventing the task from ever starting, but I dont know what. I've added the built-in to my app.yaml:
application: xxx
version: xxx
runtime: python
api_version: 1
builtins:
- deferred: on
handlers:
...
How do I debug this?
Thanks
Upvotes: 0
Views: 702
Reputation: 2299
Turns out the tasks was trying to run on my default version, even though it was being called from a different version (thanks for the hint to check that Nick).
It's an easy fix. When first calling deferred I do
version = os.environ['CURRENT_VERSION_ID'].split('.')[0]
deferred.defer(<fn_name>, <fn_variable>, _target=version)
Thanks
tom
Upvotes: 3