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.
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:22osqa_db=# select exists(select relname from pg_class where relname = 'forum_keyvalue' and relkind='r'); ?column? ---------- f (1 row)
– Fuiba Feb 8 at 18:29psql
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 meansOK
. – Tometzky Feb 8 at 18:58f
in?column? ---------- f
imply non-existence? As in it does not exist? – EWit Feb 8 at 19:16SELECT * 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