Edgewall Software
Modify

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 johan@…, 17 years ago

I got the exact same problem:

Trace:

File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/web/main.py", line 406, in dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/web/main.py", line 216, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/ticket/report.py", line 100, in process_request
  add_link(req, 'up', req.href.report(), _('Available Reports'))
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/web/chrome.py", line 54, in add_link
  linkset = req.chrome.setdefault('linkset', set())
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/web/api.py", line 167, in __getattr__
  value = self.callbacks[name](self)
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/util/compat.py", line 129, in newfunc
  return func_(*(args + fargs), **dict(kwargs, **fkwargs))
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/web/chrome.py", line 379, in prepare_request
  for category, name, text in contributor.get_navigation_items(req):
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/ticket/web_ui.py", line 127, in get_navigation_items
  if 'TICKET_CREATE' in req.perm:
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/perm.py", line 442, in has_permission
  decision = PermissionSystem(self.env). \
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/perm.py", line 359, in check_permission
  decision = policy.check_permission(username, action, context)
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/perm.py", line 218, in check_permission
  return PermissionSystem(self.env). \
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/perm.py", line 290, in get_user_permissions
  for perm in self.store.get_user_permissions(username):
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/perm.py", line 132, in get_user_permissions
  cursor.execute("SELECT username,action FROM permission")
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/db/util.py", line 51, in execute
  return self.cursor.execute(sql)
File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5892-py2.3.egg/trac/db/util.py", line 51, in execute
  return self.cursor.execute(sql)

System Information:

User Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Trac: 	0.11dev-r5892
Python: 	2.3.4 (#1, May 2 2007, 19:26:00) [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)]
setuptools: 	0.6c6
psycopg2: 	2.0.6 (dt ext pq3)
Genshi: 	0.4.2
Subversion: 	1.4.4 (r25188)
jQuery:	1.1.3.1

comment:2 by Dave Gynn <dgynn@…>, 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

comment:3 by johan@…, 17 years ago

I can confirm that it works on Postgres.

comment:4 by Christian Boos, 17 years ago

Resolution: duplicate
Status: newclosed

See #5543.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.