Answers.Body: <p>Kainuk referenced <a href="https://civicrm.stackexchange.com/questions/11210/civimail-not-sending-mails-in-4-7-6-drupal-7-db-error-syntax-error">a post</a> that I missed regarding this issue. It appears that after scheduling the mailings, users were deleted from the groups to whom those mailings were scheduled to send. A quick cancellation of those messages, then re-using them solved the issue.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-10T15:32:31.050Z
Answers.Text: Could you accept your own answer here, please?
Answers.UserDisplayName: thoni56
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-30T16:43:32.360Z
Answers.LastActivityDate: 2016-10-30T16:43:32.360Z
Answers.LastEditDate: 2017-04-13T12:53:13.207Z
Answers.UserDisplayName: S Christopher
Body: <p>Users reported that CiviMail is not pushing their messages. The scheduled mailings have Started, but not Completed. When I go to scheduled jobs and manually execute the Send Scheduled Mailings, it refreshes the page but doesn't send the mail. When I go to my host control panel and initiate the Cron manually, I receive the following error:</p>
  
  <p><b>Notice</b>:  A session had already been started - ignoring session_start() in <b>/home/mysite/www/www/includes/session.inc</b> on line <b>287</b><br /></p>
  
  <p>I found a few "solutions" via Google that involve editing the session start php code.</p>
  
  <p>For instance I entered this into the root php.ini file:</p>
  
  <pre><code>if(!isset($_SESSION)) 
  { 
      session_start(); 
  } 
  </code></pre>
  
  <p>It clears the error when running the cron manually, but it doesn't actually send the pending messages in Civi.</p>
  
  <p>The log says:</p>
  
  <blockquote>
    <p>Parameters parsed (and passed to API method): 
    a:1:{s:7:"version";i:3;}</p>
    
    <p>Full message:  Finished execution of Send Scheduled Mailings with
    result: Failure, Error message: DB Error: syntax error</p>
  </blockquote>
  
  <p>There was another "solution" to add "php_flag session.auto_start 0" to the .htaccess file. When I tried that, it gave me server not found errors when trying to access the site.</p>
  
  <p>I also cleared my _sessions table to see if that fixed the issue. No dice.</p>
  
  <p>Does anyone have a possible solution to this issue? Thank you.</p>
  
  <p>Civi 4.7.12
  Drupal 7.51</p>
  
  <p>Edit: 10-29-16 / 2159 to add log error message.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-29T21:17:34.427Z
Comments.Text: What is the result of running the *Send Scheduled Mailings* job?  It writes a message that you can examinate at the  *View Job Log* link.
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-30T04:57:25.317Z
Comments.Text: Parameters parsed (and passed to API method): 
  a:1:{s:7:"version";i:3;}
  
  Full message: 
  Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: syntax error
Comments.UserDisplayName: S Christopher
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-30T07:23:40.443Z
Comments.Text: That explains why the emails are not pushed. Maybe you can find more information in http://civicrm.stackexchange.com/questions/11210/civimail-not-sending-mails-in-4-7-6-drupal-7-db-error-syntax-error
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-30T15:47:58.263Z
Comments.Text: CiviCrm errors can be logged to drupal watchdog logging. But you have to enable it in *Administer CiviCRM -> Settings - Debugging and Error Handling*. This should give you the syntax of the sql statement that causes the DB Error. Maybe you can add it to the question for feedback.
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-30T16:44:59.970Z
Comments.Text: Thank you! The messages have been sent after deleting and re-scheduling them. It looks like the solution was as described in your link. Issue resolved (at least on my end).
Comments.UserDisplayName: S Christopher
Tags: <civimail><drupal><cron-job><4.7.1>
Title: Cron Error/CiviMail Stalled
ThreadText: # Cron Error/CiviMail Stalled
  
  (Asked by: username_0 on 2016-10-29)
  
  Users reported that CiviMail is not pushing their messages. The scheduled mailings have Started, but not Completed. When I go to scheduled jobs and manually execute the Send Scheduled Mailings, it refreshes the page but doesn't send the mail. When I go to my host control panel and initiate the Cron manually, I receive the following error:
  Notice:  A session had already been started - ignoring session_start() in /home/mysite/www/www/includes/session.inc on line 287
  I found a few "solutions" via Google that involve editing the session start php code.
  For instance I entered this into the root php.ini file:
  if(!isset($_SESSION)) 
  { 
      session_start(); 
  } 
  
  It clears the error when running the cron manually, but it doesn't actually send the pending messages in Civi.
  The log says:
  
  Parameters parsed (and passed to API method): 
    a:1:{s:7:"version";i:3;}
  Full message:  Finished execution of Send Scheduled Mailings with
    result: Failure, Error message: DB Error: syntax error
  
  There was another "solution" to add "php_flag session.auto_start 0" to the .htaccess file. When I tried that, it gave me server not found errors when trying to access the site.
  I also cleared my _sessions table to see if that fixed the issue. No dice.
  Does anyone have a possible solution to this issue? Thank you.
  Civi 4.7.12
  Drupal 7.51
  Edit: 10-29-16 / 2159 to add log error message.
  
  **Tags:** civimail, drupal, cron-job, 4.7.1
  
  > **Comments:**
  > **username_1**: What is the result of running the *Send Scheduled Mailings* job?  It writes a message that you can examinate at the  *View Job Log* link.  
  > **username_0**: Parameters parsed (and passed to API method):  a:1:{s:7:"version";i:3;}  Full message:  Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: syntax error  
  > **username_1**: That explains why the emails are not pushed. Maybe you can find more information in http://civicrm.stackexchange.com/questions/11210/civimail-not-sending-mails-in-4-7-6-drupal-7-db-error-syntax-error  
  > **username_1**: CiviCrm errors can be logged to drupal watchdog logging. But you have to enable it in *Administer CiviCRM -> Settings - Debugging and Error Handling*. This should give you the syntax of the sql statement that causes the DB Error. Maybe you can add it to the question for feedback.  
  > **username_0**: Thank you! The messages have been sent after deleting and re-scheduling them. It looks like the solution was as described in your link. Issue resolved (at least on my end).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-10-30. Score: 1
  
  Kainuk referenced [a post](https://civicrm.stackexchange.com/questions/11210/civimail-not-sending-mails-in-4-7-6-drupal-7-db-error-syntax-error) that I missed regarding this issue. It appears that after scheduling the mailings, users were deleted from the groups to whom those mailings were scheduled to send. A quick cancellation of those messages, then re-using them solved the issue.
  
  > **Comments:**
  > **username_2**: Could you accept your own answer here, please?  
  
  ---
  
  