Modify

Opened 9 years ago

Closed 8 years ago

#12470 closed defect (fixed)

IntegrityError 1062 on any ticket change

Reported by: runner.tomsk@… Owned by: Russ Tyndall
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

After update from 0.12 trac to 1.0 trac, have error with any operation to new or old ticket.

Any POST to ticket have error: IntegrityError: (1062, "Duplicate entry '1902-hours' for key 'PRIMARY'")

System information:
Trac	1.0.8
Babel	0.9.6
Docutils	0.12
FullBlog	0.1.3
Genshi	0.7 (with speedups)
MySQL	server: "5.6.25-73.1-log", client: "5.6.25-73.1", thread-safe: 1
MySQLdb	1.2.3
Pygments	2.0.2
Python	2.7.5 (default, Jun 24 2015, 00:41:19) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
pytz	2015.4
setuptools	0.9.8
Subversion	1.7.14 (r1542130)
jQuery	1.7.2
jQuery UI	1.8.21
jQuery Timepicker	1.0.1

Installed plugins:
timingandestimationplugin	1.4.6	/usr/lib/python2.7/site-packages/timingandestimationplugin-1.4.6-py2.7.egg
TracAccountManager	0.4.4	/usr/lib/python2.7/site-packages/TracAccountManager-0.4.4-py2.7.egg
TracFullBlogPlugin	0.1.3	/usr/lib/python2.7/site-packages/TracFullBlogPlugin-0.1.3-py2.7.egg

Файл "build/bdist.linux-x86_64/egg/trac/web/main.py", строка 551, в _dispatch_request
Файл "build/bdist.linux-x86_64/egg/trac/web/main.py", строка 244, в dispatch
Файл "build/bdist.linux-x86_64/egg/trac/ticket/web_ui.py", строка 182, в process_request
Файл "build/bdist.linux-x86_64/egg/trac/ticket/web_ui.py", строка 619, в _process_ticket_request
Файл "build/bdist.linux-x86_64/egg/trac/ticket/web_ui.py", строка 1350, в _do_save
Файл "build/bdist.linux-x86_64/egg/trac/ticket/model.py", строка 369, в save_changes
Файл "build/bdist.linux-x86_64/egg/timingandestimationplugin/ticket_daemon.py", строка 117, в ticket_changed
Файл "build/bdist.linux-x86_64/egg/timingandestimationplugin/ticket_daemon.py", строка 98, в watch_hours
Файл "build/bdist.linux-x86_64/egg/trac/db/api.py", строка 99, в transaction_wrapper
Файл "build/bdist.linux-x86_64/egg/timingandestimationplugin/ticket_daemon.py", строка 101, в fn
Файл "build/bdist.linux-x86_64/egg/timingandestimationplugin/ticket_daemon.py", строка 34, в save_custom_field_value
Файл "build/bdist.linux-x86_64/egg/trac/db/util.py", строка 72, в execute
Файл "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", строка 174, в execute
Файл "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", строка 36, в defaulterrorhandler

Attachments (0)

Change History (6)

comment:1 Changed 9 years ago by Russ Tyndall

I have not experienced this error personally in years of running this plugin, but I very rarely test against mysql. That is just to say, I will probably have trouble duplicating this error.

My best guess is that mysql is not returning a correct rowcount for the update statment on line 29 of ticket_daemon

def save_custom_field_value( db, ticket_id, field, value ):
    cursor = db.cursor()
    cursor.execute("UPDATE ticket_custom SET value=%s "
                   "WHERE ticket=%s AND name=%s", (value, ticket_id, field))
  
    # It seems this is broken in mysql?
    if cursor.rowcount==0:
        cursor.execute("INSERT INTO ticket_custom (ticket,name, "
                       "value) VALUES(%s,%s,%s)", (ticket_id, field, value))

I see you are using pretty recent versions, so perhaps this is something to do with the database configuration. It seems like rowcount should work

comment:2 Changed 9 years ago by Russ Tyndall

I am trying to add code to just trap the error if it occurs as I think that will probably solve this issue

comment:3 Changed 9 years ago by Russ Tyndall

In 14856:

trying to work around mysql integrity errors re #12470

comment:4 Changed 9 years ago by Russ Tyndall

I think this should get you past the initial errors. I have not found why they would be failing, and I am not happy about completely swallowing the error, but hopefully it allows us to get to the next step.

comment:5 Changed 9 years ago by anonymous

Install 1.4.7 Working without error, send email.

comment:6 Changed 8 years ago by Russ Tyndall

Resolution: fixed
Status: newclosed

Not fixed great, but meh it works

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Russ Tyndall.
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.