Modify

Opened 14 years ago

Closed 13 years ago

#8657 closed defect (fixed)

ProgrammingError: Cannot operate on a closed cursor

Reported by: schodet Owned by: Ryan J Ollos
Priority: normal Component: ExtendedVersionPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Seen on trac 0.11.7.

File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 450, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 227, in dispatch
  data, content_type)
File "/usr/lib/python2.6/dist-packages/trac/web/chrome.py", line 773, in render_template
  stream.render(method, doctype=doctype, out=buffer)
File "/usr/lib/pymodules/python2.6/genshi/core.py", line 183, in render
  return encode(generator, method=method, encoding=encoding, out=out)
File "/usr/lib/pymodules/python2.6/genshi/output.py", line 58, in encode
  for chunk in iterator:
File "/usr/lib/pymodules/python2.6/genshi/output.py", line 339, in __call__
  for kind, data, pos in stream:
File "/usr/lib/pymodules/python2.6/genshi/output.py", line 826, in __call__
  for kind, data, pos in stream:
File "/usr/lib/pymodules/python2.6/genshi/output.py", line 670, in __call__
  for kind, data, pos in stream:
File "/usr/lib/pymodules/python2.6/genshi/output.py", line 771, in __call__
  for kind, data, pos in chain(stream, [(None, None, None)]):
File "/usr/lib/pymodules/python2.6/genshi/output.py", line 586, in __call__
  for ev in stream:
File "/usr/lib/pymodules/python2.6/genshi/core.py", line 288, in _ensure
  for event in stream:
File "/usr/lib/pymodules/python2.6/genshi/core.py", line 288, in _ensure
  for event in stream:
File "/usr/lib/python2.6/dist-packages/trac/web/chrome.py", line 838, in _strip_accesskeys
  for kind, data, pos in stream:
File "/usr/lib/pymodules/python2.6/genshi/core.py", line 288, in _ensure
  for event in stream:
File "/usr/lib/python2.6/dist-packages/trac/web/chrome.py", line 827, in _generate
  for kind, data, pos in stream:
File "/usr/lib/pymodules/python2.6/genshi/core.py", line 288, in _ensure
  for event in stream:
File "/usr/lib/pymodules/python2.6/genshi/core.py", line 288, in _ensure
  for event in stream:
File "/usr/lib/pymodules/python2.6/genshi/filters/transform.py", line 686, in _unmark
  for mark, event in stream:
File "/usr/lib/pymodules/python2.6/genshi/filters/transform.py", line 1152, in __call__
  for subevent in self._inject():
File "/usr/lib/pymodules/python2.6/genshi/filters/transform.py", line 1042, in _inject
  content = content()
File "/usr/local/lib/python2.6/dist-packages/ExtendedVersionTracPlugin-0.0-py2.6.egg/extendedversion/milestone.py", line 83, in apply_version
  return self._version_display(req, buffer.events[1][1])
File "/usr/local/lib/python2.6/dist-packages/ExtendedVersionTracPlugin-0.0-py2.6.egg/extendedversion/milestone.py", line 90, in _version_display
  cursor.execute("SELECT version FROM milestone_version WHERE milestone=%s", (milestone,))
File "/usr/lib/python2.6/dist-packages/trac/db/util.py", line 64, in execute
  return self.cursor.execute(sql_escape_percent(sql), args)
File "/usr/lib/python2.6/dist-packages/trac/db/sqlite_backend.py", line 80, in execute
  result = PyFormatCursor.execute(self, *args)
File "/usr/lib/python2.6/dist-packages/trac/db/sqlite_backend.py", line 59, in execute
  args or [])
File "/usr/lib/python2.6/dist-packages/trac/db/sqlite_backend.py", line 51, in _rollback_on_error
  return function(self, *args, **kwargs)

As a workaround, I temporarily disabled the _version_display function:

  • extendedversion/milestone.py

     
    8686        return stream | filter
    8787
    8888    def _version_display(self, req, milestone):
     89        # XXX not working.
     90        return []
    8991        cursor = self.env.get_db_cnx().cursor()
    9092        cursor.execute("SELECT version FROM milestone_version WHERE milestone=%s", (milestone,))
    9193        row = cursor.fetchone()

Attachments (0)

Change History (2)

comment:1 Changed 13 years ago by Ryan J Ollos

Owner: changed from Malcolm Studd to Ryan J Ollos
Status: newassigned

comment:2 Changed 13 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

(In [11249]) Fixes #8657: Prevent database connection from being closed by keeping an explicit database object in scope.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.