Error in reloading the post object from database

asked 2014-05-24 12:52:07 -0600

saumishr gravatar image

updated 2014-05-24 12:53:08 -0600

I have setup Celery to send notifications asynchronously.

In send_instant_notifications_about_activity_in_post Post object is reloaded and got this error.

2014-05-24 22:35:47,659: ERROR/MainProcess] Task askbot.tasks.send_instant_notifications_about_activity_in_post[3c31870b-14f0-4d9a-9429-6c8040f5426d] raised unexpected: DoesNotExist("Post matching query does not exist. Lookup parameters were {'id': 8}",) Traceback (most recent call last):

File "/home/ubuntu/.virtualenvs/lawayo/local/lib/python2.7/site-packages/celery/app/", line 240, in trace_task R = retval = fun(args, *kwargs)

File "/home/ubuntu/.virtualenvs/lawayo/local/lib/python2.7/site-packages/celery/app/", line 437, in __protected_call__ return, *kwargs)

File "/home/ubuntu/public_html/", line 216, in send_instant_notifications_about_activity_in_post post = Post.objects.get(

File "/home/ubuntu/.virtualenvs/lawayo/local/lib/python2.7/site-packages/Django-1.5-py2.7.egg/django/db/models/", line 143, in get return self.get_query_set().get(args, *kwargs)

File "/home/ubuntu/.virtualenvs/lawayo/local/lib/python2.7/site-packages/Django-1.5-py2.7.egg/django/db/models/", line 401, in get (self.model._meta.object_name, kwargs))

Exception: Post matching query does not exist. Lookup parameters were {'id': 8

ID is being retrieved from the object itself just to reload the object, still fetch failed. Please help.

edit retag flag offensive close merge delete


From where did you download the Askbot code? What database is used and if it's MySQL - which storage engine?

Evgeny gravatar imageEvgeny ( 2014-05-26 13:55:50 -0600 )edit

Code is downloaded from the repository: Database used is PostgreSQL

saumishr gravatar imagesaumishr ( 2014-05-26 16:20:36 -0600 )edit

Thanks, could you tell what you're doing exactly to reproduce this?

Evgeny gravatar imageEvgeny ( 2014-05-26 16:23:58 -0600 )edit

User commented on one of the answers and a task to send notification was scheduled. When the task was supposed to be executed, I got this error. Tried it again but couldn't reproduce it. Looks like some inconsistency was there between the post object passed to the celery task and actual object in the DB.

saumishr gravatar imagesaumishr ( 2014-05-26 16:29:23 -0600 )edit