Error in reloading the post object from database
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/trace.py", line 240, in trace_task R = retval = fun(args, *kwargs)
File "/home/ubuntu/.virtualenvs/lawayo/local/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__ return self.run(args, *kwargs)
File "/home/ubuntu/public_html/lawayo.com/lawayo/askbot/tasks.py", line 216, in send_instant_notifications_about_activity_in_post post = Post.objects.get(id=post.id)
File "/home/ubuntu/.virtualenvs/lawayo/local/lib/python2.7/site-packages/Django-1.5-py2.7.egg/django/db/models/manager.py", 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/query.py", 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.
Comments
From where did you download the Askbot code? What database is used and if it's MySQL - which storage engine?
Code is downloaded from the repository: https://github.com/ASKBOT/askbot-devel Database used is PostgreSQL
Thanks, could you tell what you're doing exactly to reproduce this?
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.