Ticket #7276 (closed defect: fixed)

Opened 3 years ago

Last modified 8 months ago

Can't install (environment upgrade fail)

Reported by: coxx@imarto.net Assigned to: martin_s
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

Change History

06/22/10 14:51:36 changed by martin_s

  • status changed from new to assigned.

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.)?

06/22/10 15:54:38 changed by anonymous

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.orig      2010-05-21 14:46:36.000000000 +0000
+++ plugin.py   2010-06-22 01:51:46.000000000 +0000
@@ -573,8 +573,8 @@
         db_connector, _ = DatabaseManager(self.env)._get_connector()
         self.env.log.info("Creating 'watchlist_settings' table")

-        table = Table('watchlist_settings')[
-                    Column('wluser', unique=True),
+        table = Table('watchlist_settings', key='wluser')[
+                    Column('wluser'),
                     Column('settings'),
                 ]

06/22/10 16:58:55 changed by martin_s

  • status changed from assigned to closed.
  • resolution set to fixed.

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

06/22/10 17:00:06 changed by martin_s

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

09/16/12 02:03:30 changed by rjollos

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

09/17/12 01:43:35 changed by rjollos

  • keywords set to environment upgrade unique.

Add/Change #7276 (Can't install (environment upgrade fail))




Change Properties
Action