Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#7276 closed defect (fixed)

Can't install (environment upgrade fail)

Reported by: coxx@… Owned by: Martin Scharrer
Priority: normal Component: WatchlistPlugin
Severity: normal Keywords: environment upgrade unique
Cc: Trac Release: 0.12


I can't install plugin. trac-admin <env> upgrade failed with traceback like this:

01:25:32 Trac[plugin] INFO: Watchlist table needs to be upgraded: no such table: watchlist
01:25:32 Trac[env] INFO: tracwatchlist.plugin.WatchlistPlugin upgrading...
01:25:32 Trac[plugin] INFO: Creating system table entry for watchlist plugin: No version entry in system table
01:25:32 Trac[plugin] INFO: No previous watchlist table found
01:25:32 Trac[plugin] INFO: Creating table '('watchlist',)' for WatchlistPlugin
01:25:32 Trac[plugin] INFO: Creating 'watchlist_settings' table
TypeError: __init__() got an unexpected keyword argument 'unique'
01:25:33 Trac[console] ERROR: Exception in trac-admin command:
Traceback (most recent call last):
  File "/opt/trac/lib/python2.6/site-packages/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 "/opt/trac/lib/python2.6/site-packages/trac/admin/", line 257, in default
    return cmd_mgr.execute_command(*args)
  File "/opt/trac/lib/python2.6/site-packages/trac/admin/", line 123, in execute_command
    return f(*fargs)
  File "/opt/trac/lib/python2.6/site-packages/trac/", line 790, in _do_upgrade
    self.env.upgrade(backup=no_backup is None)
  File "/opt/trac/lib/python2.6/site-packages/trac/", line 533, in upgrade
  File "/opt/trac/lib/python2.6/site-packages/trac/db/", line 77, in transaction_wrapper
  File "/opt/trac/lib/python2.6/site-packages/tracwatchlist/", line 637, in upgrade_environment
  File "/opt/trac/lib/python2.6/site-packages/tracwatchlist/", line 563, in _create_db_table
  File "/opt/trac/lib/python2.6/site-packages/tracwatchlist/", line 577, in _create_db_table2
    Column('wluser', unique=True),
TypeError: __init__() got an unexpected keyword argument 'unique'

Attachments (0)

Change History (6)

comment:1 Changed 7 years ago by Martin Scharrer

Status: newassigned

Seems to be a DB backend issue.

What DB backend are you using? (Sqlite, Postgres, MySQL, ...) What exact version of Trac are you using (incl. revision etc.)?

comment:2 Changed 7 years ago by anonymous

I'm using Trac 0.12 from pypi.

Just look at this:

Here is my solution:


    old new  
    573573        db_connector, _ = DatabaseManager(self.env)._get_connector()
    574574"Creating 'watchlist_settings' table")
    576         table = Table('watchlist_settings')[
    577                     Column('wluser', unique=True),
     576        table = Table('watchlist_settings', key='wluser')[
     577                    Column('wluser'),
    578578                    Column('settings'),
    579579                ]

comment:3 Changed 7 years ago by Martin Scharrer

Resolution: fixed
Status: assignedclosed

(In [8139]) Fixed DB table creation issue. This fixes #7276.

comment:4 Changed 7 years ago by Martin Scharrer

Thanks for the patch. I applied this changes. Feel free to reopen this ticket if the error continues.

comment:5 Changed 5 years ago by Ryan J Ollos

Your explanation and patch helped in fixing this same issue in the TracHoursPlugin ([8060]/#10308) and BacklogPlugin ([11996]). Thanks!

comment:6 Changed 5 years ago by Ryan J Ollos

Keywords: environment upgrade unique added

Modify Ticket

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