5

I am getting the following error on my D7 site:

PDOException: SQLSTATE[40001]: Serialization failure: 1213 
Deadlock found when  trying to get lock; try restarting transaction: 
INSERT INTO {node} (type, language, title, uid, status, created, changed, promote, sticky) 
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); Array
(
[:db_insert_placeholder_0] => baby_clothes
[:db_insert_placeholder_1] => und
[:db_insert_placeholder_2] => Boys clothes and swing
[:db_insert_placeholder_3] => 1
[:db_insert_placeholder_4] => 1
[:db_insert_placeholder_5] => 1333240131
[:db_insert_placeholder_6] => 1333240131
[:db_insert_placeholder_7] => 1
[:db_insert_placeholder_8] => 0
)

in drupal_write_record() (line 6975 of includes/common.inc).

I have a module that saves nodes programatically on cron run. There is the possibiliy that two nodes could save simultaneously. Is that what could be causing this? The table locking mechanism is not working correctly to prevent collisions? If I put the site in maintenance mode and just run the batch of nodes to be saved, this never happens. Thoughts? thanks!

  • Where does the Boys clothes and swing come from? Is that from your module? – Patrick Kenny Apr 1 '12 at 1:49
  • Those are example values of what is going into the database node table. They correspond respectively to type, language, title, etc, going top to bottom. – blue928 Apr 1 '12 at 2:16
4

This is a known issue in drupal 7.x core and has been resolved in the latest release (see this bug report for more information). Make sure you've upgraded to the latest version of Drupal 7, or try applying the patch if you need to get your site operational.

  • Unfortunately, it's not true that the current release of Drupal 7 has the fix for this issue. The most recent release is 7.12, which came out in February. This fix was applied to the Drupal core 7.x dev branch in late March, but that branch is not meant to be run on production sites. Hopefully, the next official release of Drupal 7 will be pushed out soon, as it will have this fix. – coredumperror Apr 13 '12 at 21:55
  • 1
    Drupal 7.14 contains that fix. But there are still some people encountering these errors even with the fix. – user56reinstatemonica8 Aug 6 '12 at 22:50
  • 1
    As of this writing, I am still getting this error (7.15). More thoughts on how to fix this outside of Drupal? – blue928 Sep 30 '12 at 23:21
  • I opened a new thread concerning this. Have a look as the new thread more generically addresses needing to get around this as a performance issue. drupal.stackexchange.com/questions/45617/… – blue928 Oct 4 '12 at 6:52
3

I was also having this problem. I realized there was some redundant data in the database. After deleting these, the problem is solved.

  • Can you please elaborate? – Gokul N K Dec 13 '13 at 10:56
  • 1
    @ Gokul N K The way to go would be to backup your database with Backup and Migrate module ( this makes the data free from unnecessary cache data) - import this data in a database on your local server and check to see if there are redundant rows in any of the field tables (this I assume you would be able to identify as the developer). Delete those records and the import teh clean data into your site. Hope it helps. – VivMajor Dec 20 '13 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.