Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I installed OSQA and I synchronized (syncdb and migrate) the databases and I restarted Apache. In the browser I got the HTTP Status 200 Error and in the project logs I got a lot of errors with this message:

DatabaseError: current transaction is aborted, commands ignored until end of transaction block

I also found these errors in PostgreSQL's logs:

LOG:  statement: SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_EMPTY_QUESTION_BODY' 
ERROR:  relation "forum_keyvalue" does not exist at character 85
STATEMENT:  SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_EMPTY_QUESTION_BODY' 
LOG:  statement: SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_MIN_NUMBER_OF_TAGS' 
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_MIN_NUMBER_OF_TAGS' 
LOG:  statement: SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_MAX_NUMBER_OF_TAGS' 
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_MAX_NUMBER_OF_TAGS' 
LOG:  statement: SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_EMPTY_QUESTION_BODY' 
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_EMPTY_QUESTION_BODY' 
LOG:  statement: SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'MIN_USERNAME_LENGTH' 
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'MIN_USERNAME_LENGTH' 
LOG:  statement: SELECT "forum_badge"."id" FROM "forum_badge"
ERROR:  current transaction is aborted, commands ignored until end of transaction block

I searched for a solution to the problem on StackOverflow and I found it:

To get rid of the error, roll back the last (erroneous) transaction after you've fixed your code:

from django.db import transaction transaction.rollback()

This solution doesn't work for me.
I running my application on Python2.7, Django-1.3.7 and PostgreSQL 9.1.11. Any help is appreciated! Thank you very much and sorry for my bad english.

share|improve this question
1  
Can you verify that the table forum_keyvalue exists in the database? Because the first error you list says that it can't find the table. –  EWit Feb 8 at 18:22
    
Thank you EWit, the table exists: osqa_db=# select exists(select relname from pg_class where relname = 'forum_keyvalue' and relkind='r'); ?column? ---------- f (1 row) –  Fuiba Feb 8 at 18:29
    
Maybe Django created your tables in wrong database. Connect to your database using psql and just use \d+ forum_keyvalue. If it is there then your application is connecting to wrong database. Also: HTTP status 200 is not an error - it means OK. –  Tometzky Feb 8 at 18:58
1  
Doesn't the f in ?column? ---------- f imply non-existence? As in it does not exist? –  EWit Feb 8 at 19:16
    
Can you run: SELECT * FROM forum_keyvalue; using ./manage.py dbshell? Since it is also possible that the table exists but is in an unused database. –  EWit Feb 10 at 13:10
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.