Answers.Body: <p>I found out when I uninstall nz.co.fuzion.transactional plugin it is working.</p>
  
  <p>I can't reinstall it to be sure it's the real cause because the plugin setup want to create an exiting DB ! If some developers used to work with Fuzion can help on that it could be great.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-01T13:54:40.077Z
Answers.LastActivityDate: 2018-10-01T13:54:40.077Z
Answers.UserDisplayName: Tom
Body: <p>I am having a "Error in call to Mailing_send_test : job_id is not valid : 14" when I send test email in Mosaico (to one email or to a group) whereas email settings are working perfectly.</p>
  
  <p>My mailing id seems to be 16, 14 have been deleted weeks ago. Why the test functions are stuck with job_id 14 ? How to release it ?</p>
  
  <p>Any idea ?</p>
  
  <ul>
  <li>Civicrm : 5.5.1 - Wordpress 4.9.8 </li>
  <li>Mosaico : 2.0-beta4.1528762072</li>
  <li>FlexMailer : 0.2-alpha5</li>
  </ul>
  
  <p>EDIT :
  If I don't use mosaico, test mails and mailing are working perfectly.</p>
  
  <p>This is the log related to the error :</p>
  
  <pre><code>[info] $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 , contact_id , hash ) VALUES ( 14 ,  97 ,  97 , 'beba286cbb5ec019' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`database`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`) ON DELETE CASCADE)]
  [type] =&gt; DB_Error
  [user_info] =&gt; INSERT INTO civicrm_mailing_event_queue (job_id , email_id , contact_id , hash ) VALUES ( 14 ,  97 ,  97 , 'beba286cbb5ec019' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`database`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`) ON DELETE CASCADE)]
  [to_string] =&gt; [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 , contact_id , hash ) VALUES ( 14 ,  97 ,  97 , 'beba286cbb5ec019' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`database`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`) ON DELETE CASCADE)]"]
  )
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-26T10:28:00.630Z
Comments.Text: Do you have any customizations done on your site? 14 might be the result of those changes?
Comments.UserDisplayName: jitendra - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-27T07:59:37.197Z
Comments.Text: The website is quite basic, not a lot of plugins neither components, only mail report and members, everything was fine before and I realized this issue only recently. Finally this is also impacting a complete mailing campaign. "Finished execution of Send Scheduled Mailings with result: Echec, Error message: job_id is not valid : 14"
Comments.UserDisplayName: Tom
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-27T08:24:34.130Z
Comments.Text: You could find more info from the log files placed under `ConfigAndLog` folder. If possible paste the backtrace here.
Comments.UserDisplayName: jitendra - fuzion
Tags: <mailing><mosaico><testing>
Title: Mailing_send_test - job_id is not valid
ThreadText: # Mailing_send_test - job_id is not valid
  
  (Asked by: username_0 on 2018-09-26)
  
  I am having a "Error in call to Mailing\_send\_test : job\_id is not valid : 14" when I send test email in Mosaico (to one email or to a group) whereas email settings are working perfectly.
  
  My mailing id seems to be 16, 14 have been deleted weeks ago. Why the test functions are stuck with job\_id 14 ? How to release it ?
  
  Any idea ?
  
  * Civicrm : 5.5.1 - Wordpress 4.9.8
  * Mosaico : 2.0-beta4.1528762072
  * FlexMailer : 0.2-alpha5
  
  EDIT :
  If I don't use mosaico, test mails and mailing are working perfectly.
  
  This is the log related to the error :
  
  ```
  [info] $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 , contact_id , hash ) VALUES ( 14 ,  97 ,  97 , 'beba286cbb5ec019' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`database`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`) ON DELETE CASCADE)]
  [type] => DB_Error
  [user_info] => INSERT INTO civicrm_mailing_event_queue (job_id , email_id , contact_id , hash ) VALUES ( 14 ,  97 ,  97 , 'beba286cbb5ec019' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`database`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`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 , contact_id , hash ) VALUES ( 14 ,  97 ,  97 , 'beba286cbb5ec019' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`database`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`) ON DELETE CASCADE)]"]
  )
  
  ```
  
  **Tags:** mailing, mosaico, testing
  
  > **Comments:**
  > **username_1**: Do you have any customizations done on your site? 14 might be the result of those changes?  
  > **username_0**: The website is quite basic, not a lot of plugins neither components, only mail report and members, everything was fine before and I realized this issue only recently. Finally this is also impacting a complete mailing campaign. "Finished execution of Send Scheduled Mailings with result: Echec, Error message: job_id is not valid : 14"  
  > **username_1**: You could find more info from the log files placed under `ConfigAndLog` folder. If possible paste the backtrace here.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-10-01. Score: 0
  
  I found out when I uninstall nz.co.username_1.transactional plugin it is working.
  
  I can't reinstall it to be sure it's the real cause because the plugin setup want to create an exiting DB ! If some developers used to work with username_1 can help on that it could be great.
  
  
  ---
  
  