Vote count:
0
Running Django 1.6, Postgres, and Celery I had this error in a python script ran by celery:
ProgrammingError: column bot_data_threadvault.search_index does not exist.
Traceback (most recent call last):
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
return self.run(*args, **kwargs)
File "/home/forums/forums-forums/bot_server/bot_data/get_unanswered_threads.py", line 38, in get_unanswered_threads
database_update(thread_batch)
File "/home/forums/forums-forums/bot_server/bot_data/get_unanswered_threads.py", line 50, in database_update
obj = query_set.get(thread_id=thread['thread_id'])
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 301, in get
num = len(clone)
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 77, in __len__
self._fetch_all()
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 854, in _fetch_all
self._result_cache = list(self.iterator())
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
for row in compiler.results_iter():
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
for rows in self.execute_sql(MULTI):
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/forums/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
ProgrammingError: column bot_data_threadvault.search_index does not exist
LINE 1: ..._user_id", "bot_data_threadvault"."unanswered", "bot_data_...
~
The code from this error in the script is:
query_set = ThreadVault.objects.all();
obj = query_set.get(thread_id=thread['thread_id']).
I don't understand what would cause this error because if thread['thread_id'](which is from a json object returned by a api) was a blank or non int value, I would get a different exception.
The script would have this error each time it ran in iteration in Celery. Only when I bounced the celery daemon did the script began to run again without this error.
Any ideas what caused this error and why bouncing the celery daemon caused it to resolve?
asked 43 secs ago
Aucun commentaire:
Enregistrer un commentaire