Comments (18)
@andrelramos You're "fixing it" by not using postgrespool anymore.
from django-postgrespool.
I ran into this problem also. I debugged the issue a little bit and I think the problem is using the Django's postgresql_psycopg2.base.DatabaseWrapper's is_usable() method.
If there is an error in the query a rollback is to be performed. Django-postgrespool's rollback method uses DatabaseWrapper class' is_usable() method to check if the connection is usable and the rollback can be performed. How ever, the is_usable() method is internally using "SELECT 1" to check if the connection is usable but after the query error "SELECT 1" cannot be executed (postgres prints "ERROR: current transaction is aborted, commands ignored until end of transaction block"), so in this case is_usable() always returns False. And that's the reason the django-postgrespool's rollback is never executed either, and autocommit is tried to set True even when the connection is actually still in a transaction.
This can be tested by removing is_usable() check from _rollback method in django-postgrespool's DatabaseWrapper class. After that you see the real error message.
To fix this we would need to change the way rollback is checking database connection status. Either by overriding the is_usable() method or changing rollback to use some other style.
from django-postgrespool.
@kennethreitz Does https://github.com/kennethreitz/django-postgrespool/pull/29 solve the issue? Our organization has disabled postgrespool
because of this issue. It would be great if this solved it and we could merge this in. Thanks!
from django-postgrespool.
Is there still anybody maintaining this app?
from django-postgrespool.
Ran into the same problem. Been scratching my head for hours wondering what went wrong.
from django-postgrespool.
+1. Having the same issue when incorrectly attempting to create a model with a null field value.
from django-postgrespool.
@tpalsulich you nailed it. For anyone else having the same issuing when using django-postgrespool, this error is hiding a different DB error. For me, I had a table that had some NOT NULL constraints on it incorrectly, and that was bubbling up and causing this issue.
from django-postgrespool.
Same here, while insert duplicate
IntegrityError: duplicate key value violates unique constraint
from django-postgrespool.
+1 - also getting this issue, except that in my case, changing the db settings back to django.db.backends.postgresql_psycopg2
removes the error altogether (i.e. there is no underlying issue)
EDIT: Turns out that django_postgrespool seems to squash almost all DB-level exceptions and return this exception instead. Sadly, I don't have time right now to see if there's a fix.....
from django-postgrespool.
It looks like the handling of IntegrityErrors is broken in django-postgrespool after Django 1.6. The symptoms match the descriptions above, and the DB connection ends up in a bad state. All queries after an IntegrityError fail.
However, since 1.6 has connection pooling built in, just don't use django-postgrespool.
from django-postgrespool.
+1
from django-postgrespool.
+1 Anybody still monitoring this?
from django-postgrespool.
+1 Bueller?
from django-postgrespool.
I just ran into the same issue right now which was solved by removing
DATABASES['default']['ENGINE'] = 'django_postgrespool'
from my settings.py
file.
from django-postgrespool.
Ty avorio, solved my problem =D
from django-postgrespool.
If anyone sends a pull request that fixes this ( https://github.com/kennethreitz/django-postgrespool/issues/24#issuecomment-75400109 ), I will be more than happy to merge.
from django-postgrespool.
Bump
from django-postgrespool.
@CrazyPython sarcasm
from django-postgrespool.
Related Issues (17)
- DATABASE_POOL_ARGS
- 'django_postgrespool' isn't an available database backend HOT 3
- postgrespool broken with Django 1.6 ('django_postgrespool' isn't an available database backend) HOT 6
- Benchmarks HOT 1
- support for pypy HOT 1
- Pooling not working with Django 1.7 HOT 2
- The current version doesn't support Django <1.6 HOT 2
- fail to install using pip on windows HOT 1
- Celery jobs throw exceptions HOT 7
- UnicodeDecodeError while installing on Ubuntu Linux HOT 4
- Use Django 1.9+ location for postgresql backend HOT 4
- Does this project actually work? HOT 8
- Connection leak with StreamingResponse
- 'django_postgrespool' isn't an available database backend HOT 9
- Support for postgis (or arbitrary) driver? HOT 4
- SOUTH_DATABASE_ADAPTERS setting leaves GIS fields out of migrations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-postgrespool.