0

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.

Community
  • 1
  • 1
Mustapha Aoussar
  • 5,833
  • 15
  • 62
  • 107
  • 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 08 '14 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)` – Mustapha Aoussar Feb 08 '14 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 08 '14 at 18:58
  • 1
    Doesn't the `f` in `?column? ---------- f` imply non-existence? As in it does not exist? – EWit Feb 08 '14 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 '14 at 13:10

0 Answers0