1

I'm occasionally but quite often getting an unhandled exception in cursor.execute (django1.1/db/models/sql/query.py line 2369), using psycopg2 with postgresql.

Looks like the database drops connection in some way, so Django crashes. For unhandled exception there is a ticket in Django's bugtrack (#11015), but I'm rather interested in reasons why db drops connection, not why Django doesn't catches it.

Using django's dev. server this error never happens (it runs db requests in order, concurrency never happens), so it's like it has something to do with db requests concurrency or what.

I have no access to postgresql config. or logs.

Any suggestions welcomed, maybe some postgresql tweaking, or some thoughts on how to debug this issue.

upd: looks like this question - Django + FastCGI - randomly raising OperationalError - addresses the same problem, but no solution provided :-(

4
  • I also came across this dreaded issue. I searched exhaustively across the internet, but couldn't find a solution. Finally switched over to MySql and have been happy ever since. Commented Nov 13, 2009 at 0:41
  • What postgres version are you using? I've been using postgres and django for 6 months and postgres never went down. Commented Nov 13, 2009 at 4:20
  • I'm using PostgreSQl 8.3.7 with PostGIS, and that's why I can't switch to MySQL Commented Nov 13, 2009 at 16:20
  • Just look into the PostgreSQL logs, I assume that everything is there. Show us the Postgres logs, and django logs... all should be there :) Commented Nov 13, 2009 at 23:10

1 Answer 1

1

The problem could be mainly with Imports. Atleast thats what happened to me. I wrote my own solution after finding nothing from the web. Please check my blogpost here: Simple Python Utility to check all Imports in your project

Ofcourse this will only help you to get to the solution of the original issue pretty quickly and not the actual solution for your problem by itself.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.