P4DTI issue job000423

TitleBugzilla integration may fail due to MySQL IntegrityError
Assigned userNick Barnes
DescriptionA user had a problem with a MySQL consistency check. The error message looked like this:
(1062, "Duplicate entry '532232' for key 2")
This means that the P4DTI was attempting to add a row to a table with an auto-increment column (the 'id' column in the 'p4dti_replications' table). MySQL is then complaining that the auto-increment value which it has generated, and which MySQL is supposed to guarantee is unique, is not unique.
AnalysisThis is almost certainly a MySQL bug. We have not been able to reproduce it.
This may be a symptom of underlying database corruption.
It may be possible to fix this up by a suitable sequence of MySQL "alter table" commands, but the exact sequence may depend on the current state of the table. We are awaiting more information from the user.
How foundcustomer
EvidenceSupport call: <http://info.ravenbrook.com/mail/2001/11/28/12-42-05/0.txt>
Observed in1.2.1
Created byNick Barnes
Created on2001-11-28 17:05:35
Last modified byNick Barnes
Last modified on2018-07-05 17:27:49
History2001-11-28 NB Created.
2002-01-31 GDR Downgraded to "optional" since this hasn't happened to any other customers. Added support information.
       2018-07-05 NB Suspended because the P4DTI is obsolete.

Advice for all releases.

Symptoms: The P4DTI stops with an error message from the MySQL database of the form (1062, "Duplicate entry '532232' for key 2").

Cause: Your MySQL database has been corrupted, either by a bug in MySQL or by an operating system or disk error.

Solution: You can check, and possibly repair, the affected tables with the "check table" and "repair table" commands in MySQL. See http://www.mysql.com/doc/R/e/Repair.html.

If you can't repair the problems with the "repair table" command, then if the only affected table is p4dti_replications, you can just drop this table and restart the P4DTI, when the table will be recreated. Note that all bugs changed since the start_date will be examined for replication to their corresponding issues again. But if there are other affected tables, you may have to resort to backups.