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

If you use Django with PostgresSQL, you might have encountered such an error before. In my experience, it is due to the following:

    1. You were messing around in shell and tripped it. To resolve this, see this answer: http://stackoverflow.com/questions/7753016/djangopostgres-current-transaction-is-aborted-commands-ignored-until-end-of
    2. You made changes to your models which you’ve forgotten to run ./manage.py schemamigrate <app_name> –auto and ./manage.py migrate <app_name>. Conversely, you could try ./manage.py syncdb
    3. Failing which, you can look in the logs of your postgres. For me the path is /usr/local/var/postgres/server.log. Look for the offending SQL entry and delete that record from your test database (it is a test database right?)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s