How to: Solve Drupal/CiviCRM Error Messages

A collection of common Drupal and/or CiviCRM error messages and their solutions.

Drupal Error Message Solution
user warning: Duplicate entry '0' for key 1 query: INSERT INTO location ... In sequence table, increment location_lid (or the corresponding counter) to value greater than any other location_lid used in the system.
Cron failed - Attempting to re-run cron while it is already running
  1. flush all caches
  2. if unsuccessful, then via phpMyAdmin -> in variable table -> delete cron_semaphore.
  3. flush all chaches
  4. run cron!
CiviCRM Error Message Solution
user warning: Duplicate entry '0' for key 1 query: INSERT INTO location ...
  1. In sequence table, increment location_lid (or the corresponding counter) to value greater than any other location_lid used in the system.
  2. In location and location_instance tables, set the lid field's extra property to auto_increment.
error: Fatal error: Maximum execution time of 30 seconds exceeded in \includes\file.inc
  • In php.ini, increase max_execution_time to 120
The user account used by your web-server needs to be granted write access to the following directory in order to configure the CiviCRM settings file (during CiviCRM installation)
  1. Start > Run > cmd
  2. Navigate to /sites folder and type: attrib -r default /s /d
Fatal error: Class 'CRM_Import_Field' not found in /civicrm/CRM/Import/Parser.php on line 732 (during CiviCRM contact import)
  1. Create a new empty db for CRM
  2. Delete old civicrm.settings.php
  3. Reinstall CiviCRM /civicrm/install/index.php using old Drupal db using the new CRM db
  4. Open new civicrm.settings.php and change new CRM db name to old CRM db name
HP Fatal error: Uncaught exception 'Exception' with message 'Please make sure the IDS/tmp folder is writable' in /civicrm/packages/IDS/Monitor.php
  • Change permission of /sites/default/files/civicrm/upload/ folder to writable (777). You can use any FTP software, upload the file, and change it's permission.
user warning: BLOB/TEXT column 'status_codes' can't have a default value query: CREATE TABLE civicrm_member_roles_rules ( `rule_id` INT unsigned NOT NULL auto_increment, `rid` INT unsigned NOT NULL, `type_id` INT unsigned NOT NULL, `status_codes` TEXT NOT NULL DEFAULT '', PRIMARY KEY (rule_id) ) in \includes\database.inc
  • In civicrm_member_roles.install, delete line 41: 'default' => '',
user warning: Incorrect integer value: '' for column 'rule_id' at row 1 query: INSERT INTO civicrm_member_roles_rules (rule_id, rid, type_id, status_codes) VALUES('', 3, 1, '...'') in /civicrm_member_roles.module
  • In civicrm_member_roles.module, replace ln 357-358:
    $add_rule = db_query('INSERT INTO {civicrm_member_roles_rules} (rule_id, rid, type_id, status_codes) VALUES(\'\', %d, %d, \'%s\')',

    with:
    $add_rule = db_query('INSERT INTO {civicrm_member_roles_rules} (rid, type_id, status_codes)< VALUES(%d, %d, \'%s\')',

Call to undefined function curl_init() in CRM\Core\Payment\PayPalImpl.php (when submitting new membership)
  • in php.ini, remove ; before extension=php_curl.dll and restart server
Sorry. A non-recoverable error has occurred. DB Error: constraint violation. Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`crm`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452
  1. Make sure paths are updated: /civicrm/admin/setting/
    updateConfigBackend?reset=1
  2. Make sure direcotires are upddated: /civicrm/admin/setting/path
user warning: Duplicate entry '0' for key 1 query: INSERT INTO location ... In sequence table, increment location_lid (or the corresponding counter) to value greater than any other location_lid used in the system.

Comments

Thank you for the solution to: The user account used by your web-server needs to be granted write access to the following directory in order to configure the CiviCRM settings file (during CiviCRM installation)

Post new comment

The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.