Menu icon
RedCrackle
Menu icon
Services
01Design Transformation
About UsCase StudiesBlogContact Us

<

Blog post

Fixing "Integrity constraint violation: 1062 Duplicate entry 'rules_event_whitelist' for key 'Primary' error"

Neerav Mehta

Founder & CEO

Recently while running a large integration test suite on a Drupal site, we started getting the error: "Integrity constraint violation: 1062 Duplicate entry 'rules_event_whitelist' for key 'Primary'."

The error would appear randomly and we couldn't find a way to reproduce the error consistently. Looking at stack trace, we discovered that the error is coming variable_set() function. If you are looking for a quick fix for your problem, add the following to your settings.php:

$databases['default']['default']['init_commands'] = array(
  'isolation' => "SET SESSION tx_isolation='READ-COMMITTED'"
);

In all likelihood, your error will disappear!

Neerav Mehta

Neerav Mehta

Founder & CEO

Neerav Mehta is the Founder & CEO of Red Crackle. With sterling qualities, Neerav’s technological acumen is firing a generation of progressive companies on the digital path. With an undergraduate degree in Electrical Engineering from India's most prestigious institution IIT Bombay and having spent seven years developing and contributing to the launch of AMD's innovative line of computer products, Neerav founded Red Crackle where he is lauded for his dynamic and innovative genius.

View all posts

>

Read Next

10 Tips For Entrepreneurs In 2015

10 Tips For Entrepreneurs In 2015

Learn more

10 Ways To Increase Productivity At Work

10 Ways To Increase Productivity At Work

Learn more

30 best WordPress widgets for your site

30 best WordPress widgets for your site

Learn more

Let’s get you started!

Contact Us

>

RedCrackle

Explore

About Us

Services

Contact Us

Our address

5346 Gerine Blossom Dr,

San Jose, CA 95123

USA

Socials

Twitter
LinkedIn

© 2023 RedCrackle. All rights reserved.