0
1

I'm getting this error on my Django site.

My question is equivalent to this question on Stack Overflow: http://stackoverflow.com/questions/2979369/databaseerror-current-transaction-is-aborted-commands-ignored-until-end-of-tran

The answer given there was to look at the PostgreSQL logs to see what query was failing.

My question is how to find the PostgreSQL logs, or otherwise debug this issue, on WebFaction hosting?

asked 04 Mar '11, 07:26

anentropic's gravatar image

anentropic
828
accept rate: 0%


The Postgre server on our side does almost no logging, and the its logs are common for all users hosted on the same machine - this is why you do not have access to them.

Please verify that the database name/username/password that you have in your settings.py are correct (you should be able to use the 'psql' connad-line utility to connect using the same settings).

link

answered 04 Mar '11, 07:33

tie's gravatar image

tie
1.4k13
accept rate: 44%

thanks, my db settings are correct and I can connect via psql command line... is there some way to monitor the query errors occurring in django from the psql command line?

(04 Mar '11, 07:38) anentropic anentropic's gravatar image

No, you can't see the queries from the psql console, but you can use some plugin like Django Debugtoolbar to monitor all your queries generated by your application. Instructions on installing DebugToolbar can be found at http://docs.webfaction.com/software/django/troubleshooting.html#using-the-django-debug-toolbar

(04 Mar '11, 08:02) tie tie's gravatar image

thanks, DebugToolbar wouldn't help in this case as the db error is causing an (Apache) 500 error and Django doesn't get to render anything to the browser. In the end I have been able to debug it by turning suspect apps off (django-denorm) in settings.py until I could get a Django error page which showed where my sql error was. Not a universal solution...

(04 Mar '11, 08:09) anentropic anentropic's gravatar image

agreed with anentropic here. no way to debug with django debug tool bar since the page doesn't get rendered. can webfaction allow logging on account basis at least for 24 hours for development purposes?

(17 Jul '12, 08:02) pubmedly pubmedly's gravatar image

If you're getting an error 500 in the browser, then you can turn DEBUG on in your settings.py, which should render an error page to the browser. You can also look at your error logs under ~/logs/user/error_<appname>.log

(17 Jul '12, 08:15) todork todork's gravatar image

ok see this link https://docs.djangoproject.com/en/dev/ref/databases/

you can turn on this option in database settings temporarily to debug 'OPTIONS': { 'autocommit': True, }

this will show you the sql error

link

answered 17 Jul '12, 08:22

pubmedly's gravatar image

pubmedly
1
accept rate: 0%

I just had a simmilar error in an OSQA server I was trying to stand up. It turned out that I had the wrong password in the local_settings.py file for the database. Make sure you password is correct! After changing the password, make sure you restart apache, or the changes will not take effect

link

answered 24 Jul '12, 11:58

dykeag's gravatar image

dykeag
1
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×743
×84
×17

Asked: 04 Mar '11, 07:26

Seen: 5,184 times

Last updated: 24 Jul '12, 11:58

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited