I get this after I enable advagg:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'IytIHwH1SUr0-GTrR2c0ukYSgP4O_yJXw_pdpzeiz14' for key 'PRIMARY': INSERT INTO {advagg_files} (filename, filename_hash, content_hash, filetype, filesize, linecount, mtime, changes) 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); Array ( [:db_insert_placeholder_0] => profiles/openatrium/themes/oa_radix/assets/stylesheets/screen.css [:db_insert_placeholder_1] => IytIHwH1SUr0-GTrR2c0ukYSgP4O_yJXw_pdpzeiz14 [:db_insert_placeholder_2] => jZFvpLI007Nh5L_42NYwnlX4sEeiuURA8LZi0mXM-7Q [:db_insert_placeholder_3] => css [:db_insert_placeholder_4] => 230767 [:db_insert_placeholder_5] => 3969 [:db_insert_placeholder_6] => 1396677122 [:db_insert_placeholder_7] => 1 ) in drupal_write_record() (line 7219 of /var/aegir/platforms/7/servers/sng-contrib/sng-d7.26-oa-2.15/includes/common.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

advagg_insert_update_files() get's called from 2 places; advagg_push_new_changes() in advagg.cache.inc and advagg_insert_update_db() in advagg.inc. The one in advagg_insert_update_db has a lock so that means that the call to it in advagg_push_new_changes() needs more logic or I might need to catch exceptions around the call to drupal_write_record().

mikeytown2’s picture

Status: Active » Fixed
FileSize
1.5 KB

This patch has been committed.

  • Commit f15b15d on 7.x-2.x by mikeytown2:
    Issue #2233937 by mikeytown2: Fix PDO exception in advagg_files table.
    

Status: Fixed » Closed (fixed)

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

Marko B’s picture

I see this patch is old and you moved that code to advagg,module. What happend is that I had the same problem with 7.x-2.7 version.

Whole lot of errors in watchdog, on many pages this duplicate entry calls.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'LOw93khOQLWwalcvT84vupySWe8w7FwZ28zogOWSMTU' for key 'PRIMARY': INSERT INTO {advagg_files} (filename, filename_hash, content_hash, filetype, filesize, mtime, linecount, changes) 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); Array ( [:db_insert_placeholder_0] => public://ctools/css/e62586b27c14b25d76df3b2257527061_3.css [:db_insert_placeholder_1] => LOw93khOQLWwalcvT84vupySWe8w7FwZ28zogOWSMTU [:db_insert_placeholder_2] => nRDvqzolSD2ttCa9wWpoo20tPZMBbvtPKQYJubU0srM [:db_insert_placeholder_3] => css [:db_insert_placeholder_4] => 3604 [:db_insert_placeholder_5] => 1429707480 [:db_insert_placeholder_6] => 42 [:db_insert_placeholder_7] => 1 ) in advagg_insert_update_files() (line 200 of /var/www/html/sites/all/modules/contrib/advagg/advagg.inc

Marko B’s picture

On dev version it is the same thing, a lot of this errors happening. I will remove module for now as it seems problematic if this things happens over and over.

mikeytown2’s picture

Status: Closed (fixed) » Active

I'll look into this more next week.

mikeytown2’s picture

Status: Active » Fixed
FileSize
1.06 KB

Wrapped this in a try catch block.

  • mikeytown2 committed e372306 on 7.x-2.x
    Issue #2233937 by mikeytown2: Wrap the db_merge insertFields call in a...

  • mikeytown2 committed 9fb4241 on 7.x-2.x
    Issue #2233937 by joelpittet: Fix try catch syntax.
    

Status: Fixed » Closed (fixed)

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