Opened 8 years ago

Closed 7 years ago

#4931 closed defect (fixed)

[PATCH] upgrade fail for new installation

Reported by: uray Owned by: Richard Liao
Priority: highest Component: TracTicketTemplatePlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


error message

Migrate from template files to db.
Add table tt_custom.
Traceback (most recent call last):
  File "/usr/bin/trac-admin", line 8, in <module>
    load_entry_point('Trac==0.11.1', 'console_scripts', 'trac-admin')()
  File "/usr/lib/python2.5/site-packages/trac/admin/", line 1295, in run
    return admin.onecmd(command)
  File "/usr/lib/python2.5/site-packages/trac/admin/", line 123, in onecmd
    rv = cmd.Cmd.onecmd(self, line) or 0
  File "/usr/lib/python2.5/", line 219, in onecmd
    return func(arg)
  File "/usr/lib/python2.5/site-packages/trac/admin/", line 1145, in do_upgrade
  File "/usr/lib/python2.5/site-packages/trac/", line 442, in upgrade
  File "build/bdist.linux-i686/egg/tickettemplate/", line 103, in upgrade_environment
  File "build/bdist.linux-i686/egg/tickettemplate/", line 178, in add_tt_custom
  File "/usr/lib/python2.5/site-packages/trac/db/", line 51, in execute
    return self.cursor.execute(sql)
  File "/usr/lib/python2.5/site-packages/trac/db/", line 58, in execute
    args or [])
  File "/usr/lib/python2.5/site-packages/trac/db/", line 50, in _rollback_on_error
    return function(self, *args, **kwargs)
pysqlite2.dbapi2.OperationalError: table tt_custom already exists


--- tractickettemplateplugin.orig/0.11/tickettemplate/        2008-10-13 07:24:16.000000000 +0800
+++ tractickettemplateplugin/0.11/tickettemplate/     2009-04-16 21:05:02.000000000 +0800
@@ -91,7 +91,7 @@
         row = cursor.fetchone()
         if not row:
-            current_version = 0
+            current_version = schema_version
             current_version = int(row[0])

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by ssalmine@…

Priority: normalhighest

Thanks. This fix works.

I've upgraded the priority because currently this affects all new installs. So when you checkout the plugin, it is broken.

comment:2 Changed 7 years ago by Adrian Fritz

Summary: upgrade fail for new installation[PATCH] upgrade fail for new installation

comment:3 Changed 7 years ago by Ryan J Ollos

I didn't see this issue when installing under Python 2.6, SQLite, and Trac 0.12dev-r9098.

comment:4 Changed 7 years ago by Richard Liao

Resolution: fixed
Status: newclosed

Version 0.7 has fixed this bug.

Modify Ticket

as closed The owner will remain Richard Liao.
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.