36

What does the TombstonedTaskError mean? It is being raised while trying to add a task to the queue, from a cron-job:

Traceback (most recent call last):
  File "/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 501, in __call__
    handler.get(*groups)
  File "/base/data/home/apps/.../tasks.py", line 132, in get
    ).add(queue_name = 'userfeedcheck')
  File "/base/python_lib/versions/1/google/appengine/api/labs/taskqueue/taskqueue.py", line 495, in add
    return Queue(queue_name).add(self)
  File "/base/python_lib/versions/1/google/appengine/api/labs/taskqueue/taskqueue.py", line 563, in add
    self.__TranslateError(e)
  File "/base/python_lib/versions/1/google/appengine/api/labs/taskqueue/taskqueue.py", line 619, in __TranslateError
    raise TombstonedTaskError(error.error_detail)
TombstonedTaskError

Searching the documentation only has the following to say:

exception TombstonedTaskError(InvalidTaskError)
    Task has been tombstoned.

..which isn't particularly helpful.

I couldn't find anything useful in the App Engine code either..

Bob Aman
  • 32,839
  • 9
  • 71
  • 95
dbr
  • 165,801
  • 69
  • 278
  • 343

1 Answers1

51

You've added a task with that exact name before. Although it's already run, executed task names are kept around for some time to prevent accidental duplicates. If you're assigning task names, you should be using ones that are globally unique to prevent this occurring.

Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
  • 3
    Why they are preventing from adding tasks with the same name AFTER the old task has finished? If it is that way, they should allow a way to check what tasks are in the queue. – Krzysztof Krasoń Sep 15 '11 at 08:47
  • 2
    @krzyk Because otherwise there'd be a race condition where you add a task with that name just as it finishes. The point of task names is to prevent repeat execution. – Nick Johnson Sep 15 '11 at 13:00
  • How long is "some time"? minutes? hours? days? – JJ Geewax Jul 31 '12 at 14:21
  • 2
    @jgeewax 7 days, as a rule. That's not something you should be relying on, though. – Nick Johnson Aug 22 '12 at 10:06
  • TaskAlreadyExistsError also seems to be raised sometimes. What is the difference between the two exceptions? – ema Jan 17 '14 at 10:54
  • @ema TaskAlreadyExistsError is thrown when a task is currently in the queue with that name. TombstonedTaskError is thrown when the name was used for a previously executed task. – Nick Johnson Jan 18 '14 at 23:24