Opened 19 years ago
Closed 19 years ago
#2437 closed defect (worksforme)
transaction errors in postgres
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | general | Version: | 0.9 |
Severity: | major | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Plone migrated yesterday from its previous horrible tracker system to trac. The new system is running trac 0.9.1 (from svn) under mod_python with a postgres database.
We get a lot of errors like this:
Oops... Trac detected an internal error: ERROR: current transaction is aborted, commands ignored until end of transaction block SELECT username,action FROM permission Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/trac/web/modpython_frontend.py", line 206, in handler dispatch_request(mpr.path_info, mpr, env) File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 139, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 80, in dispatch req.perm = PermissionCache(self.env, req.authname) File "/usr/lib/python2.3/site-packages/trac/perm.py", line 276, in __init__ self.perms = PermissionSystem(env).get_user_permissions(username) File "/usr/lib/python2.3/site-packages/trac/perm.py", line 132, in get_user_permissions for perm in self.store.get_user_permissions(username): File "/usr/lib/python2.3/site-packages/trac/perm.py", line 213, in get_user_permissions cursor.execute("SELECT username,action FROM permission") ProgrammingError: ERROR: current transaction is aborted, commands ignored until end of transaction block SELECT username,action FROM permission
reloading the page generally seems to help, but the chances of getting this error seem to be pretty high.
I suspect this can be caused by not closing a transaction after a failed query, which leads to this error if a new requests reuses the connection from the connection pool.
Attachments (0)
Change History (3)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Are you sure you're running Trac 0.9.1? I can reproduce this with trac trunk but not with 0.9.1.
comment:3 by , 19 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
While waiting for the resolution of this problem, you should use PySqlite, as it is (now) more robust in this situation.
#2170 was also related to the above problem, I believe. The code related to session management should be cleaned-up.
For example, I still get this kind of error, but with pysqlite it's only visible in the log, not for the user: