Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After applying the yesterday's update of date 7.x-1.x-dev the following error is raised at the end of update.php:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'DateAPITestCase-class' for key 1: INSERT INTO {registry} (name, type, filename, module, weight) 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] => DateAPITestCase [:db_insert_placeholder_1] => class [:db_insert_placeholder_2] => sites/all/modules/date/date/tests/date_api.test [:db_insert_placeholder_3] => date [:db_insert_placeholder_4] => 0 ) in _registry_parse_file() (Zeile 179 von /var/www/html/cm7/includes/registry.inc).
This happens on a migrated Drupal 6.20 site running the D7 release version.
Would it help just to remove this record from the registry table?
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedMake sure you have a clean directory and re-download the files. I had to totally re-organize the file directory and you may have duplicate files.
Comment #2
GStegemann CreditAttribution: GStegemann commentedYes, I did that during the migration. But the Drupal 7 Update Manager did a strange thing: it created another subdirectory 'date' within the module directory and copied all the files into this subdirectory.
Anyway, removing the records from the registry table helped to complete the update process. But then I had to correct all the 'wrong' filenames.
Comment #3
KarenS CreditAttribution: KarenS commentedThat is a problem in the update manager, I had to re-organize the files so future updates won't do that.
You should not have to manually alter the registry table. Things should sort out once you have the right files in the right places. You will probably need to clear the cache after making the changes.
Comment #4
GStegemann CreditAttribution: GStegemann commentedMany thanks for your help so far.
But now I ran into another problem. After re-downloaded the files and try to run the site I get the following message:
Do I have to re-register some classes? Or are there other places which still may have wrong file names?
Comment #5
KarenS CreditAttribution: KarenS commentedJust added that file back, it got lost in the re-organization. Update again please.
Comment #6
GStegemann CreditAttribution: GStegemann commentedThanks. Works again. But the tar file seems not to be up-to-date yet.
Comment #7
_randy CreditAttribution: _randy commentedI ran into this issue when running D7 on Microsoft SQL Server after running an update.
I had to remove the DateAPITestCase entry in the registry table in order for the update to work.
Comment #9
bmcraec CreditAttribution: bmcraec commentedRunning 7.0 on MAMP 1.9.4, and trying to get Views 7.x-3.0-alpha1 to run, and I get:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'DateAPITestCase-class' for key 'PRIMARY': INSERT INTO {registry} (name, type, filename, module, weight) 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] => DateAPITestCase [:db_insert_placeholder_1] => class [:db_insert_placeholder_2] => sites/all/modules/date/date/tests/date_api.test [:db_insert_placeholder_3] => date [:db_insert_placeholder_4] => 0 ) in _registry_parse_file() (line 179 of /Users/brucecampbell/Sites/drupal7/includes/registry.inc).
as a result. I've also installed the Chaos Tools for dependency.
This is a completely clean install of D7, running as a test instance on a OSX 10.6.6.
Comment #10
ericjlitt CreditAttribution: ericjlitt commentedI am late to the game, but I had the same issue and just deleted the .test file mentioned in the error. I didn't need it, so that was the easiest fix.
Comment #11
dibyadel CreditAttribution: dibyadel commentedSimilar problem came to my site with captcha 7.x-1.0 . Then I uninstall it and deleted the table from the database and later installed 7.x-1.x-dev which worked.