Answers.Body: <p>I eventually found the error for this problem, which was triggering an error for CiviEvent registrations and event reminders. Guidance from @Demerit and @petednz should have led me to it sooner.</p>
  <p>The problem was caused by an email address with a 9-letter top level domain, and regex in sparkpost.php which assumes that top level domains are between 2 and 4 characters but see <a href="https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Brand_top-level_domains" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Brand_top-level_domains</a> .</p>
  <p>I changed the regex from 2,4 to 2,24 and the problem is resolved.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-22T21:19:08.887Z
Answers.Text: good catch Davy
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-23T17:41:58.227Z
Answers.Text: ....and just found that the problem is not fully resolved. While registrations are now working the event reminders are triggering a 'DB Error: constraint violation'.
  
  Clearly some more digging needed :-(
Answers.UserDisplayName: Davy Ivins
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-21T21:00:01.637Z
Answers.LastActivityDate: 2021-06-21T21:00:01.637Z
Answers.UserDisplayName: Davy Ivins
Answers.Body: <p>What version of <a href="https://civicrm.org/extensions/sparkpost-civicrm-integration" rel="nofollow noreferrer">that sparkpost extension</a> do you have? It looks pretty old. It's not inserting a contact_id when it needs to. Maybe need to update to latest master version from github manually.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-06T06:36:50.367Z
Answers.Text: It has the latest version - and the site pumps out thousands of emails all the time without any overt problems. 
  But I'll try your idea to instal the gihub master and see if that helps.
Answers.UserDisplayName: Davy Ivins
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-05T19:36:11.860Z
Answers.LastActivityDate: 2021-05-05T19:36:11.860Z
Answers.UserDisplayName: Demerit
Body: <p>I get the following fatal error when trying to send an email (under 50 addresses) to a list of participants for one specific event. I can successfully email a participant list from another event.</p>
  <p>I'm using CiviCRM 5.36.1 with Drupal 6 (Pressflow 6.56).</p>
  <p>I'd really appreciate any ideas how to fix this.</p>
  <pre><code>$Fatal Error Details = Array ( [callback] =&gt; Array ( [0] =&gt; CRM_Core_Error [1] =&gt; exceptionHandler ) [code] =&gt; -3 [message] =&gt; DB Error: constraint violation [mode] =&gt; 16 [debug_info] =&gt; INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) VALUES ( 8527 , 45914 , 'b22a018b6ac6959f' ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`purcosacoza`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)] [type] =&gt; DB_Error [user_info] =&gt; INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) VALUES ( 8527 , 45914 , 'b22a018b6ac6959f' ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`purcosacoza`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)] [to_string] =&gt; [db_error: message=&quot;DB Error: constraint violation&quot; code=-3 mode=callback callback=CRM_Core_Error::exceptionHandler prefix=&quot;&quot; info=&quot;INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) VALUES ( 8527 , 45914 , 'b22a018b6ac6959f' ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`purcosacoza`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_contact_id```
  
  
  BACKTRACE
  
  ```Message  $backTrace = #0 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(942): CRM_Core_Error::backtrace(&quot;backTrace&quot;, TRUE) #1 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error)) #2 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/db/DB.php(998): PEAR_Error-&gt;__construct(&quot;DB Error: constraint violation&quot;, -3, 16, (Array:2), &quot;INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...&quot;) #3 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error-&gt;__construct(-3, 16, (Array:2), &quot;INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...&quot;) #4 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR-&gt;_raiseError(Object(DB_mysqli), NULL, -3, 16, (Array:2), &quot;INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...&quot;, &quot;DB_Error&quot;, TRUE) #5 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1928): PEAR-&gt;__call(&quot;raiseError&quot;, (Array:7)) #6 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common-&gt;raiseError(-3, NULL, NULL, &quot;INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...&quot;, &quot;1452 ** Cannot add or update a child row: a foreign key constraint fails (`pu...&quot;) #7 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli-&gt;mysqliRaiseError() #8 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli-&gt;simpleQuery(&quot;INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...&quot;) #9 [...]/static/import/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(2696): DB_common-&gt;query(&quot;INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...&quot;) #10 [...]/static/import/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(1245): DB_DataObject-&gt;_query(&quot;INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...&quot;) #11 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(639): DB_DataObject-&gt;insert() #12 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Mailing/Event/BAO/Queue.php(41): CRM_Core_DAO-&gt;save() #13 [...]/static/files/purcosa.co.za.files/civicrm/ext/com.pesc.sparkpost/sparkpost.php(280): CRM_Mailing_Event_BAO_Queue::create((Array:3)) #14 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php(275): sparkpost_civicrm_alterMailParams((Array:9), &quot;singleEmail&quot;) #15 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(74): CRM_Utils_Hook-&gt;runHooks((Array:165), &quot;civicrm_alterMailParams&quot;, 2, (Array:9), &quot;singleEmail&quot;, NULL, NULL, NULL, NULL) #16 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(172): CRM_Utils_Hook_DrupalBase-&gt;invokeViaUF(2, (Array:9), &quot;singleEmail&quot;, NULL, NULL, NULL, NULL, &quot;civicrm_alterMailParams&quot;) #17 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(214): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\GenericHookEvent), &quot;hook_civicrm_alterMailParams&quot;, Object(Civi\Core\CiviEventDispatcher)) #18 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher-&gt;doDispatch((Array:1), &quot;hook_civicrm_alterMailParams&quot;, Object(Civi\Core\Event\GenericHookEvent)) #19 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(129): Symfony\Component\EventDispatcher\EventDispatcher-&gt;dispatch(&quot;hook_civicrm_alterMailParams&quot;, Object(Civi\Core\Event\GenericHookEvent)) #20 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php(167): Civi\Core\CiviEventDispatcher-&gt;dispatch(&quot;hook_civicrm_alterMailParams&quot;, Object(Civi\Core\Event\GenericHookEvent)) #21 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php(1218): CRM_Utils_Hook-&gt;invoke((Array:2), (Array:9), &quot;singleEmail&quot;, NULL, NULL, NULL, NULL, &quot;civicrm_alterMailParams&quot;) #22 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Utils/Mail.php(179): CRM_Utils_Hook::alterMailParams((Array:9), &quot;singleEmail&quot;) #23 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(639): CRM_Utils_Mail::send((Array:9)) #24 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(298): CRM_Core_BAO_ActionSchedule::sendReminderEmail(Object(Civi\Token\TokenRow), Object(CRM_Core_DAO_ActionSchedule), &quot;50360&quot;) #25 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(372): CRM_Core_BAO_ActionSchedule::sendMailings(3, &quot;20210505200124&quot;) #26 [...]/static/import/public_html/sites/all/modules/civicrm/api/v3/Job.php(207): CRM_Core_BAO_ActionSchedule::processQueue(&quot;20210505200124&quot;, (Array:2)) #27 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_send_reminder((Array:2)) #28 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:8)) #29 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel-&gt;runRequest((Array:8)) #30 [...]/static/import/public_html/sites/all/modules/civicrm/api/api.php(22): Civi\API\Kernel-&gt;runSafe(&quot;Job&quot;, &quot;send_reminder&quot;, (Array:1)) #31 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/JobManager.php(134): civicrm_api(&quot;Job&quot;, &quot;send_reminder&quot;, (Array:1)) #32 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/JobManager.php(66): CRM_Core_JobManager-&gt;executeJob(Object(CRM_Core_ScheduledJob)) #33 [...]/static/import/public_html/sites/all/modules/civicrm/api/v3/Job.php(118): CRM_Core_JobManager-&gt;execute(FALSE) #34 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2)) #35 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:8)) #36 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel-&gt;runRequest((Array:8)) #37 [...]/static/import/public_html/sites/all/modules/civicrm/api/api.php(22): Civi\API\Kernel-&gt;runSafe(&quot;Job&quot;, &quot;execute&quot;, (Array:2)) #38 [...]/static/import/public_html/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc(1361): civicrm_api(&quot;Job&quot;, &quot;execute&quot;, (Array:2)) #39 [...]/tools/drush/includes/command.inc(422): drush_civicrm_api(&quot;Job.execute&quot;, &quot;auth=0&quot;) #40 [...]/tools/drush/includes/command.inc(231): _drush_invoke_hooks((Array:37), (Array:2)) #41 [...]/tools/drush/includes/command.inc(199): drush_command(&quot;Job.execute&quot;, &quot;auth=0&quot;) #42 [...]/tools/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch((Array:37)) #43 [...]/tools/drush/includes/preflight.inc(67): Drush\Boot\BaseBoot-&gt;bootstrap_and_dispatch() #44 [...]/tools/drush/drush.php(12): drush_main() #45 {main}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-06T02:29:38.710Z
Comments.Text: any chance you have a munted email address for a participant? more like what Demerit is suggesting, but since you are saying 'works for A but not B' then perhaps something wrong with an address in Group B
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-06T06:25:01.560Z
Comments.Text: Good idea on the email addresses - yesterday I had a look through the list and they looked OK, but its a small list of 21 contacts so a delete/replace of each address will determine if that's the prob.
Comments.UserDisplayName: Davy Ivins
Tags: <email><participants><drupal-6>
Title: Fatal error when emailing specific participant list
ThreadText: # Fatal error when emailing specific participant list
  
  (Asked by: username_0 on 2021-05-05)
  
  I get the following fatal error when trying to send an email (under 50 addresses) to a list of participants for one specific event. I can successfully email a participant list from another event.
  
  I'm using CiviCRM 5.36.1 with Drupal 6 (Pressflow 6.56).
  
  I'd really appreciate any ideas how to fix this.
  
  ```
  $Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => exceptionHandler ) [code] => -3 [message] => DB Error: constraint violation [mode] => 16 [debug_info] => INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) VALUES ( 8527 , 45914 , 'b22a018b6ac6959f' ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`purcosacoza`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)] [type] => DB_Error [user_info] => INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) VALUES ( 8527 , 45914 , 'b22a018b6ac6959f' ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`purcosacoza`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)] [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) VALUES ( 8527 , 45914 , 'b22a018b6ac6959f' ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`purcosacoza`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_contact_id```
  
  BACKTRACE
  
  ```Message  $backTrace = #0 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(942): CRM_Core_Error::backtrace("backTrace", TRUE) #1 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error)) #2 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/db/DB.php(998): PEAR_Error->__construct("DB Error: constraint violation", -3, 16, (Array:2), "INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...") #3 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-3, 16, (Array:2), "INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...") #4 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -3, 16, (Array:2), "INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...", "DB_Error", TRUE) #5 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7)) #6 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-3, NULL, NULL, "INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...", "1452 ** Cannot add or update a child row: a foreign key constraint fails (`pu...") #7 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError() #8 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...") #9 [...]/static/import/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(2696): DB_common->query("INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...") #10 [...]/static/import/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(1245): DB_DataObject->_query("INSERT INTO `civicrm_mailing_event_queue` (`job_id` , `email_id` , `hash` ) V...") #11 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(639): DB_DataObject->insert() #12 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Mailing/Event/BAO/Queue.php(41): CRM_Core_DAO->save() #13 [...]/static/files/purcosa.co.za.files/civicrm/ext/com.pesc.sparkpost/sparkpost.php(280): CRM_Mailing_Event_BAO_Queue::create((Array:3)) #14 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php(275): sparkpost_civicrm_alterMailParams((Array:9), "singleEmail") #15 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(74): CRM_Utils_Hook->runHooks((Array:165), "civicrm_alterMailParams", 2, (Array:9), "singleEmail", NULL, NULL, NULL, NULL) #16 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(172): CRM_Utils_Hook_DrupalBase->invokeViaUF(2, (Array:9), "singleEmail", NULL, NULL, NULL, NULL, "civicrm_alterMailParams") #17 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(214): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\GenericHookEvent), "hook_civicrm_alterMailParams", Object(Civi\Core\CiviEventDispatcher)) #18 [...]/static/import/public_html/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:1), "hook_civicrm_alterMailParams", Object(Civi\Core\Event\GenericHookEvent)) #19 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(129): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("hook_civicrm_alterMailParams", Object(Civi\Core\Event\GenericHookEvent)) #20 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php(167): Civi\Core\CiviEventDispatcher->dispatch("hook_civicrm_alterMailParams", Object(Civi\Core\Event\GenericHookEvent)) #21 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php(1218): CRM_Utils_Hook->invoke((Array:2), (Array:9), "singleEmail", NULL, NULL, NULL, NULL, "civicrm_alterMailParams") #22 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Utils/Mail.php(179): CRM_Utils_Hook::alterMailParams((Array:9), "singleEmail") #23 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(639): CRM_Utils_Mail::send((Array:9)) #24 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(298): CRM_Core_BAO_ActionSchedule::sendReminderEmail(Object(Civi\Token\TokenRow), Object(CRM_Core_DAO_ActionSchedule), "50360") #25 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(372): CRM_Core_BAO_ActionSchedule::sendMailings(3, "20210505200124") #26 [...]/static/import/public_html/sites/all/modules/civicrm/api/v3/Job.php(207): CRM_Core_BAO_ActionSchedule::processQueue("20210505200124", (Array:2)) #27 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_send_reminder((Array:2)) #28 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8)) #29 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8)) #30 [...]/static/import/public_html/sites/all/modules/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("Job", "send_reminder", (Array:1)) #31 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/JobManager.php(134): civicrm_api("Job", "send_reminder", (Array:1)) #32 [...]/static/import/public_html/sites/all/modules/civicrm/CRM/Core/JobManager.php(66): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob)) #33 [...]/static/import/public_html/sites/all/modules/civicrm/api/v3/Job.php(118): CRM_Core_JobManager->execute(FALSE) #34 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2)) #35 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8)) #36 [...]/static/import/public_html/sites/all/modules/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8)) #37 [...]/static/import/public_html/sites/all/modules/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("Job", "execute", (Array:2)) #38 [...]/static/import/public_html/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc(1361): civicrm_api("Job", "execute", (Array:2)) #39 [...]/tools/drush/includes/command.inc(422): drush_civicrm_api("Job.execute", "auth=0") #40 [...]/tools/drush/includes/command.inc(231): _drush_invoke_hooks((Array:37), (Array:2)) #41 [...]/tools/drush/includes/command.inc(199): drush_command("Job.execute", "auth=0") #42 [...]/tools/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch((Array:37)) #43 [...]/tools/drush/includes/preflight.inc(67): Drush\Boot\BaseBoot->bootstrap_and_dispatch() #44 [...]/tools/drush/drush.php(12): drush_main() #45 {main}
  
  ```
  
  **Tags:** email, participants, drupal-6
  
  > **Comments:**
  > **username_1**: any chance you have a munted email address for a participant? more like what username_2 is suggesting, but since you are saying 'works for A but not B' then perhaps something wrong with an address in Group B  
  > **username_0**: Good idea on the email addresses - yesterday I had a look through the list and they looked OK, but its a small list of 21 contacts so a delete/replace of each address will determine if that's the prob.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2021-06-21. Score: 2 | Accepted answer
  
  I eventually found the error for this problem, which was triggering an error for CiviEvent registrations and event reminders. Guidance from @username_2 and @username_1 should have led me to it sooner.
  
  The problem was caused by an email address with a 9-letter top level domain, and regex in sparkpost.php which assumes that top level domains are between 2 and 4 characters but see <https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Brand_top-level_domains> .
  
  I changed the regex from 2,4 to 2,24 and the problem is resolved.
  
  > **Comments:**
  > **username_1**: good catch username_0  
  > **username_0**: ....and just found that the problem is not fully resolved. While registrations are now working the event reminders are triggering a 'DB Error: constraint violation'.  Clearly some more digging needed :-(  
  
  ---
  
  ### Answer by username_2 on 2021-05-05. Score: 0
  
  What version of [that sparkpost extension](https://civicrm.org/extensions/sparkpost-civicrm-integration) do you have? It looks pretty old. It's not inserting a contact\_id when it needs to. Maybe need to update to latest master version from github manually.
  
  > **Comments:**
  > **username_0**: It has the latest version - and the site pumps out thousands of emails all the time without any overt problems.  But I'll try your idea to instal the gihub master and see if that helps.  
  
  ---
  
  