Opened 17 years ago
Closed 17 years ago
#5756 closed defect (duplicate)
ProgrammingError: current transaction is aborted, commands ignored until end of transaction block
Reported by: | preston.bannister | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | devel |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
How to Reproduce
While doing a GET operation on /report/6
, Trac issued an internal error.
Note this is Trac 0.11dev as fetched directly from Subversion, using PostgreSQL 8.2.4 for the database. The SQL statement that apparently generates the error is:
'SELECT username,action FROM permission'
The same query run from psql works w/o trouble.
(I am not well acquainted with Python/Trac so may be missing something obvious.)
Request parameters:
{'id': u'6'}
System Information
Trac | 0.11dev-r5859
|
Python | 2.5.1 (r251:54863, May 2 2007, 16:53:27) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)]
|
setuptools | 0.6c5
|
psycopg2 | 2.0.5.1
|
Genshi | 0.4.3
|
Pygments | 0.8.1
|
Subversion | 1.4.3 (r23084)
|
Python Traceback
Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/web/main.py", line 434, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/web/main.py", line 217, in dispatch resp = chosen_handler.process_request(req) File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/ticket/report.py", line 100, in process_request add_link(req, 'up', req.href.report(), _('Available Reports')) File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/web/chrome.py", line 54, in add_link linkset = req.chrome.setdefault('linkset', set()) File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/web/api.py", line 167, in __getattr__ value = self.callbacks[name](self) File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/web/chrome.py", line 379, in prepare_request for category, name, text in contributor.get_navigation_items(req): File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/ticket/query.py", line 565, in get_navigation_items if 'TICKET_VIEW' in req.perm and \ File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/perm.py", line 443, in has_permission check_permission(action, self.username, context) File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/perm.py", line 359, in check_permission decision = policy.check_permission(username, action, context) File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/perm.py", line 219, in check_permission get_user_permissions(username).get(action, None) File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/perm.py", line 290, in get_user_permissions for perm in self.store.get_user_permissions(username): File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/perm.py", line 132, in get_user_permissions cursor.execute("SELECT username,action FROM permission") File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/db/util.py", line 51, in execute return self.cursor.execute(sql) File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r5859-py2.5.egg/trac/db/util.py", line 51, in execute return self.cursor.execute(sql) ProgrammingError: current transaction is aborted, commands ignored until end of transaction block
Attachments (0)
Change History (4)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
This looks like a SQL error. Change the SQL for report 6 to have the following ORDER BY clause.
ORDER BY (milestone IS NULL), milestone DESC, (status = 'closed'), (CASE status WHEN 'closed' THEN changetime ELSE (-1)*cast(p.value as integer) END) DESC
Note: This SQL works with SQLite as well as Postgres
I got the exact same problem:
Trace:
System Information: