Modify

Opened 8 years ago

Closed 7 years ago

Last modified 4 years ago

#6320 closed defect (duplicate)

trac-admin get error message so can't go on

Reported by: rue@… Owned by: Colin Guthrie
Priority: normal Component: WorkLogPlugin
Severity: normal Keywords: ProgrammingError, closed, cursor
Cc: Trac Release: 0.11

Description (last modified by Ryan J Ollos)

Once I execute the trac-admin command , the error messages shown as below.have you seen that?

Upgrading Database
Creating work_log table
Traceback (most recent call last):
  File "/usr/bin/trac-admin", line 8, in <module>
    load_entry_point('Trac==0.11.6', 'console_scripts', 'trac-admin')()
  File "/usr/lib/python2.6/site-packages/Trac-0.11.6-py2.6.egg/trac/admin/console.py", line 1321, in run
    return admin.onecmd(command)
  File "/usr/lib/python2.6/site-packages/Trac-0.11.6-py2.6.egg/trac/admin/console.py", line 138, in onecmd
    rv = cmd.Cmd.onecmd(self, line) or 0
  File "/usr/lib/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/usr/lib/python2.6/site-packages/Trac-0.11.6-py2.6.egg/trac/admin/console.py", line 1159, in do_upgrade
    self.__env.upgrade(backup=do_backup)
  File "/usr/lib/python2.6/site-packages/Trac-0.11.6-py2.6.egg/trac/env.py", line 464, in upgrade
    participant.upgrade_environment(db)
  File "build/bdist.linux-i686/egg/worklog/api.py", line 184, in upgrade_environment
  File "build/bdist.linux-i686/egg/worklog/api.py", line 129, in do_db_upgrade
pysqlite2.dbapi2.ProgrammingError: Cannot operate on a closed cursor.

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by Ryan J Ollos

Description: modified (diff)

I've seen users in other threads with similar issues say that moving the database connection code into the try block fixes similar issues, but I'm not sure why that would be the case:

try:
    db = self.env.get_db_cnx()
    cursor = db.cursor()
    cursor.execute('SELECT MAX(version) FROM wiki WHERE name=%s', (user_manual_wiki_title,))
    ...

comment:2 Changed 7 years ago by Colin Guthrie

I saw similar issues when doing updates to 0.12 over the weekend. I fixed the issues in 0.12 but will try and find time to have a play with this in 0.11 too and push a fix.

comment:3 Changed 7 years ago by Colin Guthrie

Resolution: duplicate
Status: newclosed

So this is actually a duplicate of #6902 (or rather the other way round as this one is newer!), but it's been fixed now so all should be well. Sorry for the delay.

comment:4 Changed 4 years ago by Ryan J Ollos

Keywords: ProgrammingError closed cursor added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Colin Guthrie.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.