Opened 12 years ago

Closed 12 years ago

#10230 closed defect (duplicate)

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

Reported by: anonymous Owned by: Robert Corsaro
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 12 years ago by Roberto Longobardi

See comment on #10293.

comment:2 Changed 12 years ago by Ryan J Ollos

Resolution: duplicate
Status: newclosed

Duplicate of #9742.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Robert Corsaro.
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.