1

I have task deferred in appengine python its a simple call with all task_info strings, list of strings. It works well for any no of tasks.

               deferred.defer(fetch_service, 
                              _queue = "queue_name",
                              _countdown = task_counter * 4,
                              **task_info  )

I observed a weird behaviour, when I access some endpoints or UI in different URL or different modules, this deferred calls start to fail. Every differed call throws same issue.

File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/deferred/deferred.py", line 145, in run
    raise PermanentTaskFailure(e)
PermanentTaskFailure: None.fetch_service forbidden in unpickling

Looking for any help, or others who faced same issue.

sandeep koduri
  • 500
  • 2
  • 15

2 Answers2

4

This problem is specific to the GAE python scaffold provided by Google. There's a whitelist of methods that are allowed to be pickled.

If you add your fetch_service method to the _PICKLE_CLASS_WHITELIST in base/api_fixers.py list, it will work.

jrsm
  • 133
  • 1
  • 6
1

The PermanentTaskFailure exception indicates that a task failed, and will never succeed.

This typically means some invalid condition is encountered when the GAE infra attempts to schedule the task.

The None.fetch_service string in the error message points to an invalid reference: None doesn't have a fetch_service attribute.

This could indicate the task execution is attempted in a module which doesn't have access to the fetch_service object. I'd check the imports in the module displaying the error.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97