Modify

Opened 7 years ago

Closed 18 months ago

#1863 closed defect (wontfix)

Error: columns ticket, time, field are not unique

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

Description

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 t.id 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 priority.name=priority)
WHERE COALESCE(t.id,'')!='0'
ORDER BY COALESCE(t.priority,'')='',priority.value,t.id
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/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", 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/web_ui.py", line 109, in process_request
    path_info)
  File "build/bdist.linux-i686/egg/datamover/ticket.py", line 69, in process_admin_request
  File "build/bdist.linux-i686/egg/datamover/util.py", line 52, in copy_ticket
  File "/usr/lib/python2.4/site-packages/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.4/site-packages/trac/db/sqlite_backend.py", line 56, in execute
    args or [])
  File "/usr/lib/python2.4/site-packages/trac/db/sqlite_backend.py", 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 7 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.

-dt

comment:2 Changed 7 years ago by anonymous

  • Severity changed from critical to major

comment:3 Changed 6 years ago by Michael

hi,

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\xmlrpclib.py", line 1147, in __call__
    return self.__send(self.__name, args)
  File "C:\Python25\lib\xmlrpclib.py", line 1437, in __request
    verbose=self.__verbose
  File "C:\Python25\lib\xmlrpclib.py", line 1201, in request
    return self._parse_response(h.getfile(), sock)
  File "C:\Python25\lib\xmlrpclib.py", line 1340, in _parse_response
    return u.close()
  File "C:\Python25\lib\xmlrpclib.py", 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 6 years ago by coderanger

  • Component changed from DatamoverPlugin to XmlRpcPlugin
  • Owner changed from coderanger to athomas

Wrong component.

comment:5 Changed 6 years ago by athomas

  • Component changed from XmlRpcPlugin to DatamoverPlugin
  • Owner changed from athomas to coderanger

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 5 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 18 months ago by rjollos

  • Resolution set to wontfix
  • Status changed from new to closed

This plugin is deprecated. Please use the TracMigratePlugin.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.