Opened 7 years ago

Closed 7 years ago

#5319 closed defect (invalid)

IntegrityError: duplicate key value violates unique constraint "mastertickets_pkey"

Reported by: http://matej.ceplovi.cz/ Owned by: asterix
Priority: normal Milestone:
Component: trac & wiki Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking: OS: All

Description

How to Reproduce

While doing a POST operation on /ticket/3724, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'__FORM_TOKEN': u'25a12a7488f64ff6da77d746',
 'action': u'leave',
 'cc_update': u'on',
 'cnum': u'13',
 'comment': u'',
 'field_blockedby': u'',
 'field_blocking': u'2815',
 'field_component': u'chat',
 'field_keywords': u'patch',
 'field_milestone': u'',
 'field_os': u'All',
 'field_priority': u'normal',
 'field_severity': u'normal',
 'field_summary': u'Use webkit for chat if possible',
 'field_type': u'enhancement',
 'field_version': u'hg',
 'id': u'3724',
 'replyto': u'',
 'submit': u'Submit changes',
 'ts': u'2009-10-12 14:19:09+00:00'}

User Agent was: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090911 Fedora/3.5.3-1.fc12 Firefox/3.5.3

System Information

Trac 0.11.5
Python 2.5.4 (r254:67916, Feb 18 2009, 03:17:34)
[GCC 4.3.3]
setuptools 0.6c9
psycopg2 2.0.9
Genshi 0.5.1
mod_wsgi 2.5
Pygments 1.0
Mercurial 1.3.1
jQuery: 1.2.6

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 444, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 205, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.5/site-packages/trac/ticket/web_ui.py", line 182, in process_request
    return self._process_ticket_request(req)
  File "/usr/lib/python2.5/site-packages/trac/ticket/web_ui.py", line 508, in _process_ticket_request
    self._do_save(req, ticket, action)
  File "/usr/lib/python2.5/site-packages/trac/ticket/web_ui.py", line 1014, in _do_save
    cnum=internal_cnum):
  File "/usr/lib/python2.5/site-packages/trac/ticket/model.py", line 296, in save_changes
    listener.ticket_changed(self, comment, author, old_values)
  File "build/bdist.linux-x86_64/egg/mastertickets/api.py", line 105, in ticket_changed
    links.save(author, comment, tkt.time_changed, db)
  File "build/bdist.linux-x86_64/egg/mastertickets/model.py", line 53, in save
    cursor.execute('INSERT INTO mastertickets (%s, %s) VALUES (%%s, %%s)'%sourcedest, (self.tkt.id, n))
  File "/usr/lib/python2.5/site-packages/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.5/site-packages/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
IntegrityError: duplicate key value violates unique constraint "mastertickets_pkey"


Change History (1)

comment:1 Changed 7 years ago by asterix

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

I think it's a pb with the tracMasterTicket plugin, as a workarround you have to remove all blocked by ticket IDs, and re-add the one you want to set.

Note: See TracTickets for help on using tickets.