Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#7644 closed defect (wontfix)

IntegrityError: columns ticket, name are not unique

Reported by: vincent Owned by:
Priority: normal Milestone:
Component: ticket system Version: 0.11.1
Severity: blocker Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

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

(please provide additional details here)

Request parameters:

{'__FORM_TOKEN': u'c683ff76f2e831283da0e92d',
 'field_billable': u'1',
 'field_blockedby': u'',
 'field_blocking': u'',
 'field_cc': u'',
 'field_checkbox_billable': u'1',
 'field_component': u'component1',
 'field_description': u'',
 'field_estimatedhours': u'0',
 'field_hours': u'0',
 'field_keywords': u'',
 'field_milestone': u'',
 'field_owner': u'',
 'field_priority': u'major',
 'field_reporter': u'vincent',
 'field_status': u'new',
 'field_summary': u'fdsg dfg sdfg dsg dfg',
 'field_type': u'defect',
 'field_version': u'',
 'submit': u'Create ticket'}

User Agent was: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1

System Information

Trac 0.11.1
Python 2.4.4 (#1, Apr 5 2007, 20:09:06)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]
setuptools 0.6c8
SQLite 3.3.8
pysqlite 2.3.2
Genshi 0.5.1
mod_python 3.2.10
Subversion 1.4.2 (r22196)
jQuery: 1.2.6

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/web_ui.py", line 171, in process_request
    return self._process_newticket_request(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/web_ui.py", line 380, in _process_newticket_request
    self._do_create(req, ticket) # (redirected if successful)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/web_ui.py", line 956, in _do_create
    ticket.insert()
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/model.py", line 189, in insert
    "VALUES (%s,%s,%s)", [(tkt_id, name, self[name])
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/db/util.py", line 57, in executemany
    return self.cursor.executemany(sql_escape_percent(sql), args)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/db/sqlite_backend.py", line 63, in executemany
    args or [])
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/db/sqlite_backend.py", line 50, in _rollback_on_error
    return function(self, *args, **kwargs)
IntegrityError: columns ticket, name are not unique

Attachments (0)

Change History (3)

comment:1 by anonymous, 16 years ago

There where only one other existant ticket and the title where differents

comment:2 by Remy Blank, 16 years ago

Resolution: wontfix
Status: newclosed

Your database is "corrupt". The exception happens when inserting custom field values into the ticket_custom table. It looks like you have values in that table for a ticket ID that doesn't exist yet.

You could try cleaning up your ticket_custom table as follows (make sure you have a backup):

  • Find the highest ticket number in your database:
    sqlite> select max(id) from ticket;
    123
    
  • Delete all custom ticket fields for ticket IDs higher than the returned value:
    sqlite> delete from ticket_custom where ticket>123;
    

Anyway, this is an InstallationIssue.

comment:3 by Remy Blank, 16 years ago

Oh, BTW this is the same issue as #6032.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.