3

I am building a Docker container for CiviCRM, it is 99.9% done. Unfortunately, when I try to install the actual module via Drush, it spits out an error. I am fairly certain this isn't a Docker related issue, hopefully someone here has advice or direction.

The error that is thrown:

Cannot execute INSERT INTO (snip) ;: DB Error: already exists Drush command terminated abnormally due to an unrecoverable error

The full error, including (snip) can be found below.

Now, I dug around the Drush command script and it appears that the issue originates at the _civicrm_install_db function. Specifically, before line 390 as that log entry is never printed.

I did some looking through the JIRA bug tracker and found two possibly related issues. The first CRM-17874 mentions the mysql:// database call, I tried patching the file and the same error is being thrown. The second CRM-18120 mentions Deadlocks which seems highly plausible, but I did not see an easy patch.

Anyway, I have asked for advice on IRC but to no avail as of yet. Please let me know if you have any solutions or thoughts. I will check here frequently as well as being available for synchronous chat in IRC.

Thanks!

Edit 1: Here is the Drush command being run for installation: drush -y civicrm-install \ --dbuser=${MYSQL_USER} \ --dbpass=${MYSQL_PASSWORD} \ --dbhost=db \ --dbname=${MYSQL_DATABASE_CIVICRM} \ --tarfile=/var/www/civicrm.tar.gz \ --destination=sites/all/modules \ --site_url=${VIRTUAL_HOST} \ --ssl=on \ --load_generated_data=false

(full error)

Cannot execute INSERT INTO civicrm_acl (id, name, deny, entity_table, entity_id, operation, object_table, object_id, acl_table, acl_id, is_active) VALUES (1,'Edit All Contacts',0,'civicrm_acl_role',1,'Edit','civicrm_saved_search',0,NULL,NULL,1),(2,'Core ACL',0,'civicrm_acl_role',0,'All','access CiviMail subscribe/unsubscribe pages',NULL,NULL,NULL,1),(3,'Core ACL',0,'civicrm_acl_role',0,'All','access all custom data',NULL,NULL,NULL,1),(4,'Core ACL',0,'civicrm_acl_role',0,'All','make online contributions',NULL,NULL,NULL,1),(5,'Core ACL',0,'civicrm_acl_role',0,'All','make online pledges',NULL,NULL,NULL,1),(6,'Core ACL',0,'civicrm_acl_role',0,'All','profile listings and forms',NULL,NULL,NULL,1),(7,'Core ACL',0,'civicrm_acl_role',0,'All','view event info',NULL,NULL,NULL,1),(8,'Core ACL',0,'civicrm_acl_role',0,'All','register for events',NULL,NULL,NULL,1),(9,'Core ACL',0,'civicrm_acl_role',1,'All','access CiviCRM',NULL,NULL,NULL,1),(10,'Core ACL',0,'civicrm_acl_role',1,'All','access CiviContribute',NULL,NULL,NULL,1),(11,'Core ACL',0,'civicrm_acl_role',1,'All','access CiviEvent',NULL,NULL,NULL,1),(12,'Core ACL',0,'civicrm_acl_role',1,'All','access CiviMail',NULL,NULL,NULL,1),(13,'Core ACL',0,'civicrm_acl_role',1,'All','access CiviMail subscribe/unsubscribe pages',NULL,NULL,NULL,1),(14,'Core ACL',0,'civicrm_acl_role',1,'All','access CiviMember',NULL,NULL,NULL,1),(15,'Core ACL',0,'civicrm_acl_role',1,'All','access CiviPledge',NULL,NULL,NULL,1),(16,'Core ACL',0,'civicrm_acl_role',1,'All','administer CiviCase',NULL,NULL,NULL,1),(17,'Core ACL',0,'civicrm_acl_role',1,'All','access my cases and activities',NULL,NULL,NULL,1),(18,'Core ACL',0,'civicrm_acl_role',1,'All','access all cases and activities',NULL,NULL,NULL,1),(19,'Core ACL',0,'civicrm_acl_role',1,'All','delete in CiviCase',NULL,NULL,NULL,1),(20,'Core ACL',0,'civicrm_acl_role',1,'All','access CiviGrant',NULL,NULL,NULL,1),(21,'Core ACL',0,'civicrm_acl_role',1,'All','access Contact Dashboard',NULL,NULL,NULL,1),(22,'Core ACL',0,'civicrm_acl_role',1,'All','administer Multiple Organizations',NULL,NULL,NULL,1),(23,'Core ACL',0,'civicrm_acl_role',1,'All','delete activities',NULL,NULL,NULL,1),(24,'Core ACL',0,'civicrm_acl_role',1,'All','delete in CiviContribute',NULL,NULL,NULL,1),(25,'Core ACL',0,'civicrm_acl_role',1,'All','delete in CiviMail',NULL,NULL,NULL,1),(26,'Core ACL',0,'civicrm_acl_role',1,'All','delete in CiviPledge',NULL,NULL,NULL,1),(27,'Core ACL',0,'civicrm_acl_role',1,'All','delete contacts',NULL,NULL,NULL,1),(28,'Core ACL',0,'civicrm_acl_role',1,'All','delete in CiviEvent',NULL,NULL,NULL,1),(29,'Core ACL',0,'civicrm_acl_role',1,'All','delete in CiviMember',NULL,NULL,NULL,1),(30,'Core ACL',0,'civicrm_acl_role',1,'All','translate CiviCRM',NULL,NULL,NULL,1),(31,'Core ACL',0,'civicrm_acl_role',1,'All','edit grants',NULL,NULL,NULL,1),(32,'Core ACL',0,'civicrm_acl_role',1,'All','access all custom data',NULL,NULL,NULL,1),(33,'Core ACL',0,'civicrm_acl_role',1,'All','access uploaded files',NULL,NULL,NULL,1),(34,'Core ACL',0,'civicrm_acl_role',1,'All','add contacts',NULL,NULL,NULL,1),(35,'Core ACL',0,'civicrm_acl_role',1,'All','administer CiviCRM',NULL,NULL,NULL,1),(36,'Core ACL',0,'civicrm_acl_role',1,'All','edit all contacts',NULL,NULL,NULL,1),(37,'Core ACL',0,'civicrm_acl_role',1,'All','edit contributions',NULL,NULL,NULL,1),(38,'Core ACL',0,'civicrm_acl_role',1,'All','edit event participants',NULL,NULL,NULL,1),(39,'Core ACL',0,'civicrm_acl_role',1,'All','edit groups',NULL,NULL,NULL,1),(40,'Core ACL',0,'civicrm_acl_role',1,'All','edit memberships',NULL,NULL,NULL,1),(41,'Core ACL',0,'civicrm_acl_role',1,'All','edit pledges',NULL,NULL,NULL,1),(42,'Core ACL',0,'civicrm_acl_role',1,'All','access CiviReport',NULL,NULL,NULL,1),(43,'Core ACL',0,'civicrm_acl_role',1,'All','access Report Criteria',NULL,NULL,NULL,1),(44,'Core ACL',0,'civicrm_acl_role',1,'All','administer Reports',NULL,NULL,NULL,1),(45,'Core ACL',0,'civicrm_acl_role',1,'All','import contacts',NULL,NULL,NULL,1),(46,'Core ACL',0,'civicrm_acl_role',1,'All','make online contributions',NULL,NULL,NULL,1),(47,'Core ACL',0,'civicrm_acl_role',1,'All','make online pledges',NULL,NULL,NULL,1),(48,'Core ACL',0,'civicrm_acl_role',1,'All','profile listings and forms',NULL,NULL,NULL,1),(49,'Core ACL',0,'civicrm_acl_role',1,'All','profile create',NULL,NULL,NULL,1),(50,'Core ACL',0,'civicrm_acl_role',1,'All','profile edit',NULL,NULL,NULL,1),(51,'Core ACL',0,'civicrm_acl_role',1,'All','profile listings',NULL,NULL,NULL,1),(52,'Core ACL',0,'civicrm_acl_role',1,'All','profile view',NULL,NULL,NULL,1),(53,'Core ACL',0,'civicrm_acl_role',1,'All','register for events',NULL,NULL,NULL,1),(54,'Core ACL',0,'civicrm_acl_role',1,'All','view all activities',NULL,NULL,NULL,1),(55,'Core ACL',0,'civicrm_acl_role',1,'All','view all contacts',NULL,NULL,NULL,1),(56,'Core ACL',0,'civicrm_acl_role',1,'All','view event info',NULL,NULL,NULL,1),(57,'Core ACL',0,'civicrm_acl_role',1,'All','view event participants',NULL,NULL,NULL,1),(58,'Core ACL',0,'civicrm_acl_role',1,'All','edit all events',NULL,NULL,NULL,1),(59,'Core ACL',0,'civicrm_acl_role',2,'All','access CiviMail subscribe/unsubscribe pages',NULL,NULL,NULL,1),(60,'Core ACL',0,'civicrm_acl_role',2,'All','access all custom data',NULL,NULL,NULL,1),(61,'Core ACL',0,'civicrm_acl_role',2,'All','make online contributions',NULL,NULL,NULL,1),(62,'Core ACL',0,'civicrm_acl_role',2,'All','make online pledges',NULL,NULL,NULL,1),(63,'Core ACL',0,'civicrm_acl_role',2,'All','profile listings and forms',NULL,NULL,NULL,1),(64,'Core ACL',0,'civicrm_acl_role',2,'All','register for events',NULL,NULL,NULL,1),(65,'Core ACL',0,'civicrm_acl_role',2,'All','view event info',NULL,NULL,NULL,1);: DB Error: already existsDrush command terminated abnormally due to an unrecoverable error. [error]

2 Answers 2

2

This error can happen if you attempt to load a CiviCRM DB over the top of an existing DB. It's possible that's what you're running into here.

Looks like there are two files in the CiviCRM distribution which might try to populate that table, so make sure you aren't getting both executed.

  • civicrm/sql/civicrm_acl.mysql
  • civicrm/sql/civicrm_generated.mysql

But this is speculative - can you describe in detail how you're installing CiviCRM via Drush? That might help someone reproduce the error you're hitting or give a more definite reply.

1

After doing some print-line debugging, I traced the issue to line 413 which determines whether or not pre-generated demo data should be loaded.

I have tried a variety of combinations to no avail: load_generated_data=false load_generated_data=FALSE load_generated_data="FALSE"

As I am out of ideas, for now the flag is just going to be removed from my script. However, it appears that this is a bug with the Drush command.

Thanks to everyone who took a look and offered advice, here and on IRC.

Edit: load_generated_data=0 WORKS!

1
  • 1
    Did you try --load-generated-data=0? Most strings, including "false", evaluate to true: php -r "if ('false') print 'yes';" // => 'yes' Commented Mar 30, 2016 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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