Drupal 7.7 latest dev of Feeds XPath Parser
Following error appears every time trying to flush the caches.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'FeedsXPathParserHTML-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] => FeedsXPathParserHTML [:db_insert_placeholder_1] => class [:db_insert_placeholder_2] => sites/all/modules/feeds_xpathparser/FeedsXPathParserHTML.inc [:db_insert_placeholder_3] => feeds_xpathparser [:db_insert_placeholder_4] => 0 ) in _registry_parse_file() (line 179 of /home/timeweav/public_html/includes/registry.inc).
The website encountered an unexpected error. Please try again later.

Comments

twistor’s picture

Assigned: Unassigned » twistor

Can you try refreshing the cache?

cutmedia’s picture

The error above occurs every time the cache is refreshed. It will only refresh it the reference is manually removed from the db.

mathieuhelie’s picture

This seems to be related to class autoloading. A few modules have these problems in D7. I'll investigate.

mathieuhelie’s picture

Doing a registry rebuild failed. I'm going to open a ticket about this in their issue queue to see if they have any insights in the problem.

#1324000: Failed to rebuild registry on PDO Exception: duplicate entry

mathieuhelie’s picture

I didn't find a real fix for this issue, but this is what took place to cause the error.

  1. I cloned a staging site to a dev site in a multi-site platform (aegir), copying the database and the modules. The modules included Feeds XPath Parser.
  2. Clearing the cache always failed on my dev site due to the above registry error.
  3. Searching through the dev database tables for references to my staging site, I found lots of references to modules in the staging site in the dev site's main cache table.
  4. I truncated the cache table in mysql, then did a regular Drupal cache clear and the problem was fixed.

This is likely a bug in the Drupal registry process auto-loading classes from the cache table before running a cache clear, then auto-loading them again after the cache clear.

mathieuhelie’s picture

Title: PDOException » PDOException due to class auto-loading registry when running a cache clear
juampynr’s picture

Status: Needs review » Active

Related issue: #1347894: Clear cache causes integrity constraint violation

The patch for Feeds module in the above issue fixes the error.

twistor’s picture

Status: Active » Needs review

I just committed a fix for this to 7.x-dev. Can someone test it?

twistor’s picture

twistor’s picture

Status: Active » Closed (fixed)

This was fixes in ctools a long time ago.