Opened 11 years ago

Closed 5 years ago

#1863 closed defect (wontfix)

Error: columns ticket, time, field are not unique

Reported by: dilshod@… Owned by: Noah Kantrowitz
Priority: normal Component: DatamoverPlugin
Severity: major Keywords:
Cc: Trac Release: 0.10


I am trying to move tickets across trac environments and I get the following error:

IntegrityError: columns ticket, time, field are not unique

I have a guess at what the problem might be. Lets say A is the originating env. and B is the destination. The ids of the tickets in A also exist in B. I think the datamover plug in does not created new ids that's why it is failing.

Here is more debugging info:

2007-07-26 12:25:32,010 Trac[ticket] DEBUG: DatamoverTicketModule: Source is None (all)
2007-07-26 12:25:32,011 Trac[ticket] DEBUG: DatamoverTicketModule: Running query 'id!=0'
2007-07-26 12:25:32,016 Trac[query] DEBUG: Query SQL: SELECT AS id,t.summary AS summary,t.owner AS owner,t.type AS type,t.status AS status,t.priority AS priority,t.milestone AS milestone,t.time AS time,t.changetime AS changetime,priority.value AS priority_value
FROM ticket AS t
  LEFT OUTER JOIN enum AS priority ON (priority.type='priority' AND
ORDER BY COALESCE(t.priority,'')='',priority.value,
2007-07-26 12:25:32,021 Trac[ticket] DEBUG: DatamoverTicketModule: Results: [1, 2, 3, 4, 5, 9, 11, 13, 14, 15, 16, 17, 18, 19, 6, 7, 8, 10, 12]
2007-07-26 12:25:32,042 Trac[main] ERROR: columns ticket, time, field are not unique
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/", line 387, in dispatch_request
  File "/usr/lib/python2.4/site-packages/trac/web/", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/TracWebAdmin-0.1.2dev_r4429-py2.4.egg/webadmin/", line 109, in process_request
  File "build/bdist.linux-i686/egg/datamover/", line 69, in process_admin_request
  File "build/bdist.linux-i686/egg/datamover/", line 52, in copy_ticket
  File "/usr/lib/python2.4/site-packages/trac/db/", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.4/site-packages/trac/db/", line 56, in execute
    args or [])
  File "/usr/lib/python2.4/site-packages/trac/db/", line 48, in _rollback_on_error
    return function(self, *args, **kwargs)
IntegrityError: columns ticket, time, field are not unique

Attachments (0)

Change History (7)

comment:1 Changed 11 years ago by dilshod@…

hello, this is a follow-up.

I found out what the problem was. Apparently, in env. B there were records in ticket_change with IDs that didn't exist in ticket. And the datamover was correctly creating new IDs. However, I am not sure how this out-of-sync situation arose. This may have happened by datamover itself. Previously I used datamover to 'move' tickets to env. A from B, but I guess it left some data hunging in env. B.


comment:2 Changed 11 years ago by anonymous

Severity: criticalmajor

comment:3 Changed 10 years ago by Michael


i have had this problem, when i tried to use the xmlrrpc plugin to automatic update tickets by a python xmlrpc client. When tickets were updated too fast this problem arised:

    self.server.ticket.update(id, comment, attributes, notify)
  File "C:\Python25\lib\", line 1147, in __call__
    return self.__send(self.__name, args)
  File "C:\Python25\lib\", line 1437, in __request
  File "C:\Python25\lib\", line 1201, in request
    return self._parse_response(h.getfile(), sock)
  File "C:\Python25\lib\", line 1340, in _parse_response
    return u.close()
  File "C:\Python25\lib\", line 787, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 2: "'columns ticket, time, field are not unique' while executing 'ticket.update()'">

when i limit the ticket update speed to 1 second the problem disappeared.

comment:4 Changed 10 years ago by Noah Kantrowitz

Component: DatamoverPluginXmlRpcPlugin
Owner: changed from Noah Kantrowitz to Alec Thomas

Wrong component.

comment:5 Changed 10 years ago by Alec Thomas

Component: XmlRpcPluginDatamoverPlugin
Owner: changed from Alec Thomas to Noah Kantrowitz

The ticket description seems unrelated to XmlRpcPlugin, while comment:3 does. These seem to be separate, but related, issues. Changing the component back.

comment:6 Changed 9 years ago by gregorkappler

I can confirm this bug.

It arises with XMLRPC communication, creating some 2000 tickets rapidly. It started to be problematic, when I used MasterTicketPlugin to set the blockedby field of the tickets.

I guess that MasterTicketPlugin is updating the blocking attribute of the ticket the new one is depending on.

I worked around the bug by catching the exception, waiting a sec, whenever I catch one, then try to create the same ticket again. This seems to work.

Thanks, Gregor

comment:7 Changed 5 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

This plugin is deprecated. Please use the TracMigratePlugin.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.