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

KarenS’s picture

Status: Active » Fixed

Make 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.

GStegemann’s picture

Yes, 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.

KarenS’s picture

That 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.

GStegemann’s picture

Many 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:

Fatal error: Class 'date_sql_handler' not found in /var/www/html/cm7/sites/all/modules/date/date_api/includes/date_api_argument_handler.inc on line 17

Do I have to re-register some classes? Or are there other places which still may have wrong file names?

KarenS’s picture

Just added that file back, it got lost in the re-organization. Update again please.

GStegemann’s picture

Thanks. Works again. But the tar file seems not to be up-to-date yet.

_randy’s picture

I 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bmcraec’s picture

Running 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.

ericjlitt’s picture

I 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.

dibyadel’s picture

Similar 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.