Opened 4 years ago

Closed 4 years ago

#10230 closed defect (duplicate)

`trac-admin ... upgrade` boken on trac v1.0

Reported by: anonymous Owned by: doki_pen
Priority: normal Component: AnnouncerPlugin
Severity: critical Keywords:
Cc: Trac Release: 1.0


When installing the current branch/0.12 release on a trac v1.0 installation the DB upgrade does not work. When executing trac-admin [path] upgrade it simply exits with following output:

$ trac-admin [path] upgrade


Trac[console] ERROR: Exception in trac-admin command: 
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0dev_r11163-py2.6.egg/trac/admin/", line 107, in onecmd
    rv = cmd.Cmd.onecmd(self, line) or 0
  File "/usr/lib/python2.6/", line 218, in onecmd
    return self.default(line)
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0dev_r11163-py2.6.egg/trac/admin/", line 275, in default
    return cmd_mgr.execute_command(*args)
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0dev_r11163-py2.6.egg/trac/admin/", line 123, in execute_command
    return f(*fargs)
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0dev_r11163-py2.6.egg/trac/", line 947, in _do_upgrade
    if not self.env.needs_upgrade():
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0dev_r11163-py2.6.egg/trac/", line 655, in needs_upgrade
    if participant.environment_needs_upgrade(db):
  File "/usr/local/lib/python2.6/dist-packages/TracAnnouncer-0.12.1dev-py2.6.egg/announcer/", line 493, in environment_needs_upgrade
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0dev_r11163-py2.6.egg/trac/db/", line 107, in __getattr__
    raise AttributeError

Work around:
in file /usr/local/lib/python2.6/dist-packages/TracAnnouncer-0.12.1dev-py2.6.egg/announcer/ around line 493. change method to look like:

    def environment_needs_upgrade(self, db):
        cursor = db.cursor()
        for table in self.SCHEMA:
                cursor.execute("select count(*) from %s"
                if not db.readonly:   # added this line!
                return True
        return False

Thanks for the plugin allthough I am right now starting to have a closer look at it .)

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by seccanj

See comment on #10293.

comment:2 Changed 4 years ago by rjollos

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

Duplicate of #9742.

Add Comment

Modify Ticket

as closed The owner will remain doki_pen.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.