After a database was corrupted and reloaded from a backup. Looking at the error log this appears to be where CiviCRM is hanging.


Here is the debug information.

[debug_info] => CREATE TEMPORARY TABLE civicrm_temp_group_contact_cache1632 (SELECT 95 as group_id, contact_a.id as id FROM civicrm_contact contact_a LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_email.is_primary = 1) WHERE ( ( (NULLIF(civicrm_email.email, '') IS NOT NULL) AND contact_a.do_not_email = AND contact_a.is_opt_out = AND contact_a.contact_type = 'Individual' ) ) AND (contact_a.is_deleted = 0) AND contact_a.id NOT IN ( SELECT contact_id FROM civicrm_group_contact WHERE civicrm_group_contact.status = 'Removed' AND civicrm_group_contact.group_id = 95 ) ); [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND contact_a.is_opt_out = AND contact_a.contact_type = 'Individual' ) ) AND ' at line 1]

Any advice on how to resolve this is appreciated.

Thanks, Josh

1 Answer 1


There's something wrong with your smart group with an ID of 95. However, this is unlikely to be causing a performance problem, since this query simply isn't running. If you can delete and recreate your smart group with an ID of 95, this error should go away.

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.