What causes Internal server error on accessing some questions?
After upgrading to 0.7.50 we get and internal server error on loading some questions:
Upgrade steps:
pip install --upgrade askbot
python manage.py migrate --list
python manage.py migrate
python manage.py syncdb --migrate
python manage.py collectstatic
plus:
python manage.py generate_post_snippets
The error
list index out of range
Request Method: GET
Django Version: 1.5.12
Python Version: 2.7.6
Installed Applications:
('longerusername',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.humanize',
'django.contrib.sitemaps',
'askbot',
'askbot.deps.django_authopenid',
'south',
'askbot.deps.livesettings',
'keyedcache',
'robots',
'django_countries',
'djcelery',
'djkombu',
'followit',
'tinymce',
'group_messaging',
'compressor',
'django.contrib.messages')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
'askbot.middleware.forum_mode.ForumModeMiddleware',
'askbot.middleware.cancel.CancelActionMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'askbot.middleware.view_log.ViewLogMiddleware',
'askbot.middleware.spaceless.SpacelessMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
113. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view
91. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/askbot/views/readers.py" in question
513. user=request.user
File "/usr/local/lib/python2.7/dist-packages/askbot/models/question.py" in get_post_data_for_question_view
1087. post_data = self.get_cached_post_data(user=user, sort_method=sort_method)
File "/usr/local/lib/python2.7/dist-packages/askbot/models/question.py" in get_cached_post_data
1195. post_data = self.get_post_data(sort_method)
File "/usr/local/lib/python2.7/dist-packages/askbot/models/question.py" in get_post_data
1245. first_rev = post.get_earliest_revision()
File "/usr/local/lib/python2.7/dist-packages/askbot/models/post.py" in get_earliest_revision
1506. rev = self.revisions.order_by('revision')[0]
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in __getitem__
231. return list(qs)[0]
Exception Type: IndexError at /question/198/from-windows-xp-to-windows-7/
Exception Value: list index out of range
Comments