First time here? Check out the FAQ!

Why do I need to run fix_revisionless_posts frequently?

  • retag add tags

We have recently set up an Askbot instance, which mostly works well, but frequently some questions appear to become corrupted, and I have to run fix_revisionless_posts to make that question work again.

Here is the output from running that command. I’m glad to provide whatever info you need to debug further.

root@help:/home/help# python fix_revisionless_posts WARNING!!! You are using a 'locmem' (local memory) caching backend, which is OK for a low volume site running on a single-process server. For a multi-process configuration it is neccessary to have a production cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently see outdated content on your site.

System check identified some issues:

WARNINGS: django_authopenid.UserPasswordQueue.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField. HINT: ForeignKey(unique=True) is usually better served by a OneToOneField. group_messaging.SenderList.recipient: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField. HINT: ForeignKey(unique=True) is usually better served by a OneToOneField. have 1 corrupted posts

mpearrow's avatar
asked 2016-03-08 09:03:29 -0600
edit flag offensive 0 remove flag close merge delete


What database are you using and what are the version of Django and Askbot you have?

Evgeny's avatar Evgeny (2016-03-09 05:22:25 -0600) edit

Django 1.8.10 and django.db.backends.postgresql_psycopg2 for database.

mpearrow's avatar mpearrow (2016-03-09 07:23:07 -0600) edit

A bit more information: here is the stack trace from the error (had to paste in an "answer" instead of a comment)

mpearrow's avatar mpearrow (2016-03-18 13:12:31 -0600) edit

@mpearrow have you resolved this? The missing revision occurs when there is some exception after the post is created and before revision is created.

Evgeny's avatar Evgeny (2016-06-15 06:09:44 -0600) edit
add a comment see more comments

1 Answer

Internal Server Error: /question/245/test-message-please-ignore/
Traceback (most recent call last):
 File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/", line 132, in get_response
   response = wrapped_callback(request, *callback_args, **callback_kwargs)
 File "/usr/local/lib/python2.7/dist-packages/django/utils/", line 110, in _wrapped_view
   response = view_func(request, *args, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/askbot/views/", line 536, in question
 File "/usr/local/lib/python2.7/dist-packages/askbot/models/", line 1150, in get_post_data_for_question_view
   post_data = self.get_cached_post_data(user=user, sort_method=sort_method)
 File "/usr/local/lib/python2.7/dist-packages/askbot/models/", line 1235, in get_cached_post_data
   post_data = self.get_post_data(sort_method)
 File "/usr/local/lib/python2.7/dist-packages/askbot/models/", line 1294, in get_post_data
   first_rev = post.get_earliest_revision()
 File "/usr/local/lib/python2.7/dist-packages/askbot/models/", line 1601, in get_earliest_revision
   rev = self.revisions.order_by('revision')[0]
 File "/usr/local/lib/python2.7/dist-packages/django/db/models/", line 201, in __getitem__
   return list(qs)[0]
IndexError: list index out of range

I can re-create this error consistently by pasting the following into the body of the question and submitting:

Traceback (most recent call last):
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/core/handlers/", line 139, in get_response
    response = response.render()
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/template/", line 105, in render
    self.content = self.rendered_content
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/template/", line 82, in rendered_content
    content = template.render(context)
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/template/", line 140, in render
    return self._render(context)
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/template/", line 134, in _render
    return self.nodelist.render(context)
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/template/", line 840, in render
    bit = self.render_node(node, context)
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/template/", line 854, in render_node
    return node.render(context)
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/templatetags/", line 106, in render
    url = self.url(context)
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/contrib/staticfiles/templatetags/", line 12, in url
    return staticfiles_storage.url(path)
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/contrib/staticfiles/", line 134, in url
    hashed_name = self.hashed_name(clean_name).replace('\\', '/')
  File "/home/deploy/.virtualenvs/toolbox/local/lib/python2.7/site-packages/django/contrib/staticfiles/", line 91, in hashed_name
    (clean_name, self))
ValueError: The file 'components/ginkgo-breeze/jquery/dist/jquery.min.js' could not be found with < object at 0x555a350>.
mpearrow's avatar
answered 2016-03-18 13:13:37 -0600, updated 2016-03-18 13:23:39 -0600
edit flag offensive 0 remove flag delete link


@mpearrow sorry for getting back late - what input should be posted to reproduce this? I could not understand that from your answer above. I was unable to reproduce the issue by posting a copy in the second pre-formatted sample. The code I've tested with is from the tip of the master branch at github.

Evgeny's avatar Evgeny (2016-06-15 06:10:57 -0600) edit
add a comment see more comments