Modify

Opened 4 years ago

Closed 3 years ago

Last modified 2 months ago

#6320 closed defect (duplicate)

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

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

Description (last modified by rjollos)

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 3 years ago by rjollos

  • 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 3 years ago by coling

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 3 years ago by coling

  • Resolution set to duplicate
  • Status changed from new to closed

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 2 months ago by rjollos

  • Keywords ProgrammingError closed cursor added

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from coling. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.