Modify ↓
#7276 closed defect (fixed)
Can't install (environment upgrade fail)
Reported by: | Owned by: | Martin Scharrer | |
---|---|---|---|
Priority: | normal | Component: | WatchlistPlugin |
Severity: | normal | Keywords: | environment upgrade unique |
Cc: | Trac Release: | 0.12 |
Description
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/console.py", line 107, in onecmd rv = cmd.Cmd.onecmd(self, line) or 0 File "/usr/lib/python2.6/cmd.py", line 218, in onecmd return self.default(line) File "/opt/trac/lib/python2.6/site-packages/trac/admin/console.py", line 257, in default return cmd_mgr.execute_command(*args) File "/opt/trac/lib/python2.6/site-packages/trac/admin/api.py", line 123, in execute_command return f(*fargs) File "/opt/trac/lib/python2.6/site-packages/trac/env.py", line 790, in _do_upgrade self.env.upgrade(backup=no_backup is None) File "/opt/trac/lib/python2.6/site-packages/trac/env.py", line 533, in upgrade with_transaction(self)(participant.upgrade_environment) File "/opt/trac/lib/python2.6/site-packages/trac/db/api.py", line 77, in transaction_wrapper fn(ldb) File "/opt/trac/lib/python2.6/site-packages/tracwatchlist/plugin.py", line 637, in upgrade_environment self._create_db_table(db) File "/opt/trac/lib/python2.6/site-packages/tracwatchlist/plugin.py", line 563, in _create_db_table self._create_db_table2(db) File "/opt/trac/lib/python2.6/site-packages/tracwatchlist/plugin.py", 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 14 years ago by
Status: | new → assigned |
---|
comment:2 Changed 14 years ago by
I'm using Trac 0.12 from pypi.
Just look at this: http://trac.edgewall.org/changeset/9406/trunk/trac/db/schema.py
Here is my solution:
-
plugin.py
old new 573 573 db_connector, _ = DatabaseManager(self.env)._get_connector() 574 574 self.env.log.info("Creating 'watchlist_settings' table") 575 575 576 table = Table('watchlist_settings' )[577 Column('wluser' , unique=True),576 table = Table('watchlist_settings', key='wluser')[ 577 Column('wluser'), 578 578 Column('settings'), 579 579 ]
comment:3 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 Changed 14 years ago by
Thanks for the patch. I applied this changes. Feel free to reopen this ticket if the error continues.
comment:5 Changed 12 years ago by
Your explanation and patch helped in fixing this same issue in the TracHoursPlugin ([8060]/#10308) and BacklogPlugin ([11996]). Thanks!
comment:6 Changed 12 years ago by
Keywords: | environment upgrade unique added |
---|
Note: See
TracTickets for help on using
tickets.
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.)?