Following error after executing update.php after updating code:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'sites/all/modules/ctools/tests/ctools_export_test/ctools_export_' for key 'PRIMARY': INSERT INTO {system} (filename, name, type, owner, info) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.module [:db_insert_placeholder_1] => ctools_export_test [:db_insert_placeholder_2] => module [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => a:12:{s:4:"name";s:18:"CTools export test";s:11:"description";s:25:"CTools export test module";s:4:"core";s:3:"7.x";s:7:"package";s:16:"Chaos tool suite";s:12:"dependencies";a:1:{i:0;s:6:"ctools";}s:6:"hidden";b:1;s:5:"files";a:1:{i:0;s:18:"ctools_export.test";}s:7:"version";s:7:"7.x-1.1";s:7:"project";s:6:"ctools";s:9:"datestamp";s:10:"1344463011";s:3:"php";s:5:"5.2.4";s:9:"bootstrap";i:0;} ) in system_update_files_database() (line 2294 of /PATH/TO/WEBSITE/www/modules/system/system.module).

Comments

robmalon’s picture

Same thing:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'sites/all/modules/contrib/ctools/tests/ctools_export_test/ctools' for key 'PRIMARY': INSERT INTO {system} (filename, name, type, owner, info) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => sites/all/modules/contrib/ctools/tests/ctools_export_test/ctools_export_test.module [:db_insert_placeholder_1] => ctools_export_test [:db_insert_placeholder_2] => module [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => a:12:{s:4:"name";s:18:"CTools export test";s:11:"description";s:25:"CTools export test module";s:4:"core";s:3:"7.x";s:7:"package";s:16:"Chaos tool suite";s:12:"dependencies";a:1:{i:0;s:6:"ctools";}s:6:"hidden";b:1;s:5:"files";a:1:{i:0;s:18:"ctools_export.test";}s:7:"version";s:7:"7.x-1.1";s:7:"project";s:6:"ctools";s:9:"datestamp";s:10:"1344463011";s:3:"php";s:5:"5.2.4";s:9:"bootstrap";i:0;} ) in system_update_files_database() (line 2294 of C:\PATH\modules\system\system.module).

Running update.php again seems to pass amicably, but no further updates were needed.

I went into a custom view of mine and tinkered a bit with adding/removing fields since I know ctools is used there and received no errors. I'm guessing it didn't have any debilitating effects, but still odd...

I'm using a fairly new install which is not yet a production site and am on 7.15.

merlinofchaos’s picture

Handling the system table is core, I'm not sure how this can be a bug of ctools.

lyricnz’s picture

Yes, it sounds like a core bug, triggered by something ctools happened to do.

The method that is failing in system.module is system_update_files_database() - where it's attempting to add new files (ctools_export_test.module in this case) to the list of files. I wonder how it got added to the table before this point?

lyricnz’s picture

Is the truncation of the PK value in the messages above significant? Could we have something that is non-unique for some substring of the "filename" value? (I don't think so)

It looks like Drupal updated {system} before update.php did, and the latter failed. Unable to reproduce with a DB backup, will try again with older version.

Leeteq’s picture

@lyricnz: are you on 7.15 too?

lyricnz’s picture

Yes. Have been unable to reproduce the problem so far.

mgifford’s picture

mgifford’s picture

Issue summary: View changes

Update with comment about how error occurred

DamienMcKenna’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (cannot reproduce)

It has been two years, core has gone from 7.15 to 7.34 and several people have been unable to reproduce the problem. If the problem still persists please reopen this issue, otherwise I suspect it was fixed along the way either in core or CTools.