Running update.php throws an error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'modules/system/tests/cron_queue_test.module'

I updated all modules to the latest version, changed the theme back to Garland, place the site in maintenance mode.

Full error message below. Any help greatly appreciated.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'modules/system/tests/cron_queue_test.module' for key 1: 
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),
 (:db_insert_placeholder_5,
 :db_insert_placeholder_6,
 :db_insert_placeholder_7,
 :db_insert_placeholder_8,
 :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => modules/system/tests/cron_queue_test.module [:db_insert_placeholder_1] => cron_queue_test [:db_insert_placeholder_2] => module [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => a:13:{s:4:"name";s:15:"Cron Queue test";s:11:"description";s:41:"Support module for the cron queue runner.";s:7:"package";s:7:"Testing";s:7:"version";s:4:"7.34";s:4:"core";s:3:"7.x";s:6:"hidden";b:1;s:7:"project";s:6:"drupal";s:9:"datestamp";s:10:"1416429488";s:5:"mtime";i:1416429488;s:12:"dependencies";a:0:{}s:3:"php";s:5:"5.2.4";s:5:"files";a:0:{}s:9:"bootstrap";i:0;} [:db_insert_placeholder_5] => modules/simpletest/tests/psr_0_test/psr_0_test.module [:db_insert_placeholder_6] => psr_0_test [:db_insert_placeholder_7] => module [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => a:13:{s:4:"name";s:16:"PSR-0 Test cases";s:11:"description";s:44:"Test classes to be discovered by simpletest.";s:4:"core";s:3:"7.x";s:6:"hidden";b:1;s:7:"package";s:7:"Testing";s:7:"version";s:4:"7.34";s:7:"project";s:6:"drupal";s:9:"datestamp";s:10:"1416429488";s:5:"mtime";i:1416429488;s:12:"dependencies";a:0

Comments

gfury’s picture

I took another shot at this with a copy of the databases (export/import into a new database) and the update ran without a hitch.

Do you think there could have been some corruption in the index on the "system" table that the import fixed?

This is an old site that has been upgraded from 5 -> 6 -> 7 over the years.

dcam’s picture

Priority: Major » Normal
Status: Active » Closed (fixed)

Do you think there could have been some corruption in the index on the "system" table that the import fixed?

No, it's more likely that this new module was somehow registered in the system, then for some reason it was being registered again. I'm not sure what was causing this, but I'm glad the update finally succeeded. Sorry you were having this issue.