Ask Your Question
1

Internal Server Error after Newest Update.

asked 2012-07-30 07:49:21 -0500

Toms gravatar image Toms
661 18 6 34

updated 2012-07-30 12:39:29 -0500

Hi,

I've updated askbot just now, and get the internal server error when I visit my site. The main page is somehow working, but everything else not. I think reason for working main page is probably caching.

With the same scheme I've updated last week and everything was fine.

I've Ubuntu with apache server.

Please help.

Commands I've used:

git fetch origin master:master-updated
git checkout master
git merge master-updated
git commit -m 'merged with the development repository'

then I've restarted apache.

How to get the previous (working) version?

here the full process:

# git fetch origin master:master-updated
remote: Counting objects: 162, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 96 (delta 80), reused 96 (delta 80)
Unpacking objects: 100% (96/96), done.
From git://github.com/ASKBOT/askbot-devel
   5e3f780..2aac331  master     -> master-updated
root@myserver:/home/mydjangoinstall# git checkout master
M       askbot/locale/en/LC_MESSAGES/django.mo
M       askbot/locale/en/LC_MESSAGES/django.po
M       askbot/locale/ru/LC_MESSAGES/django.mo
M       askbot/locale/ru/LC_MESSAGES/django.po
Already on 'master'
Your branch is ahead of 'origin/master' by 8 commits.
root@myserver:/home/mydjangoinstall# git merge master-updated
Updating 5e3f780..2aac331
Fast-forward
 askbot/doc/source/changelog.rst                    |    1 +
 askbot/doc/source/contributors.rst                 |    1 +
 askbot/forms.py                                    |   99 ++++++++++++++++----
 .../0126_add_field__auth_user__is_fake.py          |   19 ++++
 askbot/models/__init__.py                          |   20 ++++
 askbot/skins/common/media/js/post.js               |   27 ++++++
 askbot/skins/common/media/js/utils.js              |    1 +
 .../skins/common/templates/widgets/edit_post.html  |   41 +++++++-
 askbot/skins/default/media/style/style.css         |    4 +-
 askbot/skins/default/media/style/style.less        |   35 ++++++-
 askbot/skins/default/templates/answer_edit.html    |    2 +-
 askbot/skins/default/templates/macros.html         |    3 +-
 .../templates/question/new_answer_form.html        |    2 +-
 askbot/skins/default/templates/question_edit.html  |    3 +-
 .../skins/default/templates/widgets/ask_form.html  |    3 +-
 askbot/tests/form_tests.py                         |   27 ++++++
 askbot/urls.py                                     |    5 +
 askbot/views/commands.py                           |   23 +++++
 askbot/views/writers.py                            |   17 +++-
 19 files changed, 301 insertions(+), 32 deletions(-)
 create mode 100644 askbot/migrations/0126_add_field__auth_user__is_fake.py
root@myserver:/home/mydjangoinstall# git add <fixed files>
-bash: syntax error near unexpected token `newline'
root@myserver:/home/mydjangoinstall# git commit -m 'merged with the development repos                                                                                        itory'
# On branch master
# Your branch is ahead of 'origin/master' by 13 commits.
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   askbot/locale/en/LC_MESSAGES/django.mo
#       modified:   askbot/locale/en/LC_MESSAGES/django.po
#       modified:   askbot/locale/ru/LC_MESSAGES/django.mo
#       modified:   askbot/locale/ru/LC_MESSAGES/django.po
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       askbot/locale/ru/LC_MESSAGES/django.po.BackUP.24.07.2012
#       askbot/locale/ru/LC_MESSAGES/django.po.BackUp.25.07.2012
no changes added to commit (use "git add" and/or "git commit -a")
root@myserver:/home/mydjangoinstall# service apache2 reload
 * Reloading web server config apache2                                   [ OK ]
root@myserver:/home/mydjangoinstall# service apache2 restart
 * Restarting web server apache2                                             [ OK]

Edit:

nothing changes after using:

python manage.py migrate

output:

root@myserver:/home/mydjangoinstall# python manage.py migrate

************************
*                      *
*   Askbot self-test   *
*                      *
************************

Your output encoding is not UTF-8, there may be issues with the software when anything is printed to the terminal or log files
Running migrations for django_authopenid:
- Nothing to migrate.
 - Loading initial data for django_authopenid.
No fixtures found.
Running migrations for askbot:
- Nothing to migrate.
 - Loading initial data for askbot.
No fixtures found.
root@myserver:/home/mydjangoinstall# service apache2 reload
 * Reloading web server config apache2        [ OK ]

When I click on some questions I get the internal error.

Edit 2:

Debug Mode:

Environment:


Request Method: GET
Request URL: http://mywebsite.com/vopros/29/testquestion/

Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
['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']
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')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/core/handlers/base.py" in get_response
  178.                 response = middleware_method(request, response)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/contrib/sessions/middleware.py" in process_response
  36.                 request.session.save()
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/contrib/sessions/backends/db.py" in save
  61.         sid = transaction.savepoint(using=using)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/transaction.py" in savepoint
  162.     return connection.savepoint()
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/backends/__init__.py" in savepoint
  223.         self._savepoint(sid)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/backends/__init__.py" in _savepoint
  70.         self.cursor().execute(self.ops.savepoint_create_sql(sid))
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/backends/util.py" in execute
  34.             return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/backends/postgresql_psycopg2/base.py" in execute
  44.             return self.cursor.execute(query, args)

Exception Type: DatabaseError at /vopros/29/testquestion/
Exception Value: current transaction is aborted, commands ignored until end of transaction block

Edit 3:

Error on the main page in debug mode

Exception Type: DatabaseError at /
Exception Value: column auth_user.is_fake does not exist
LINE 1: ... "auth_user"."date_joined", "auth_user"."status", "auth_user...

Edit 4

postgresql log data:

2012-07-30 12:10:12 UTC ERROR:  column auth_user.is_fake does not exist at character 298
2012-07-30 12:10:12 UTC STATEMENT:  SELECT "auth_user"."id", "auth_user"."username", "auth_user"."first_name$
2012-07-30 12:10:18 UTC ERROR:  column auth_user.is_fake does not exist at character 298
2012-07-30 12:10:18 UTC STATEMENT:  SELECT "auth_user"."id", "auth_user"."username", "auth_user"."first_name$
2012-07-30 12:10:22 UTC ERROR:  column auth_user.is_fake does not exist at character 298

The solution was @Evgeny 's commnet:

For some reason migration 126 failed. Try

python manage.py migrate askbot 0125 --fake
python manage.py migrate
delete close flag offensive retag edit

Comments

Can you try with the debug mode on, and post your stacktrace ?

bgenevaux ( 2012-07-30 09:57:34 -0500 )edit

@bgenevaux see my Edit 2. Thank you

Toms ( 2012-07-30 10:09:57 -0500 )edit

Could be an error in the merging. Search for consecutive angular brackets in your files.

Evgeny ( 2012-07-30 10:19:44 -0500 )edit

@Evgeny could you check, the Edit 3? Probably that is the reason? Some hint how to solve it?

Toms ( 2012-07-30 11:31:09 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-07-30 09:26:06 -0500

Evgeny gravatar image Evgeny flag of Chile
11009 50 84 182
http://askbot.org/

Maybe it's because you forgot to run migrations?

python manage.py migrate
link publish delete flag offensive edit

Comments

Hi Evgeny! unfortunately nothing happens. See my edit

Toms ( 2012-07-30 09:54:12 -0500 )edit
1

For some reason migration 126 failed. Try

python manage.py migrate askbot 0125 --fake
python manage.py migrate

Then you look inside the database and check whether the column exists. Look in DB error log - see which query failed and why.

Evgeny ( 2012-07-30 11:32:55 -0500 )edit

@Evgeny Thank You very much!! You are a godsend! :) Your last comment is the solution.

Toms ( 2012-07-30 12:36:42 -0500 )edit
1

answered 2012-07-30 10:19:46 -0500

bgenevaux gravatar image bgenevaux flag of France
189 1 6 13

I had this problem some time ago during a migration, it came from psycopg2 (the transaction began, but was neither commited nor rollbacked because there was a problem)

For me, it solved itself with another migration with some sql manipulations (but it was because the db I had to migrate was from 1 year ago with mysql ...)

Actually, I can't say anything other than try to find what failed in your queries, sorry ...

link publish delete flag offensive edit

Comments

Thank you for your hint!

Toms ( 2012-07-30 12:41:21 -0500 )edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: 2012-07-30 07:49:21 -0500

Seen: 153 times

Last updated: Jul 30 '12