CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • 'Not connected' error with multiple civimail.cronjob.php CLI processes
Pages: [1]

Author Topic: 'Not connected' error with multiple civimail.cronjob.php CLI processes  (Read 896 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
'Not connected' error with multiple civimail.cronjob.php CLI processes
September 14, 2011, 05:49:40 am
I've set up civimail.cronjob.php to run every 5 minutes via the CLI with a nice of -19. The Mailer Batch Limit is 300 emails, and the Mailer job size is 0 (no multi-threading).

Usually one civimail.cronjob.php finishes before the next starts. All is good.

But if the next job starts before the previous one finishes. problems occur. The pattern is this: when 3 are running simultaneously, there is a SASL connection error to the SMTP server, and then a few hundred emails bounce with a "not connected" error. The server also throws out-of-memory errors.

As a workaround, I've put a check into my shell script to exit if another civimail.cronjob.php is already running.

Here's the backtrace ...
Quote
Sep 14 12:18:33  [info] $backTrace = /var/www/xxx/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 541
, nullHandler,
/var/www/xxx/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 931
/var/www/xxx/sites/all/modules/civicrm/packages/PEAR.php, PEAR_Error, 566
/var/www/xxx/sites/all/modules/civicrm/packages/Net/Socket.php, raiseError, 327
/var/www/xxx/sites/all/modules/civicrm/packages/Net/SMTP.php, write, 229
/var/www/xxx/sites/all/modules/civicrm/packages/Net/SMTP.php, _send, 265
/var/www/xxx/sites/all/modules/civicrm/packages/Net/SMTP.php, _put, 1138
/var/www/xxx/sites/all/modules/civicrm/packages/Mail/smtp.php, rset, 293
/var/www/xxx/sites/all/modules/civicrm/CRM/Mailing/BAO/Job.php, send, 547
/var/www/xxx/sites/all/modules/civicrm/CRM/Mailing/BAO/Job.php, deliverGroup, 476
/var/www/xxx/sites/all/modules/civicrm/CRM/Mailing/BAO/Job.php, deliver, 152
/var/www/xxx/sites/all/modules/civicrm/bin/civimail.cronjob.php, runJobs, 47
/var/www/xxx/sites/all/modules/civicrm/bin/civimail.cronjob.php, processQueue, 79

The error object is huge: here's the top of it ...
Quote
Sep 14 12:18:33  [ info ] $Ignoring exception thrown here = PEAR_Error Object
(
    [ error_message_prefix ] =>
    [ mode ] => 16
    [ level ] => 1024
    [ code ] =>
    [ message ] => Failed to write to socket: not connected
    [ userinfo ] =>
    [ backtrace ] => Array
        (
            [ 0 ] => Array
                (
                    [ file ] => /var/www/xxx/sites/all/modules/civicrm/packages/PEAR.php
                    [ line ] => 566
                    [ function ] => PEAR_Error
                    [ class ] => PEAR_Error
                    [ type ] => ->
                    [ args ] => Array
                        (
                            [ 0 ] => Failed to write to socket: not connected
                            [ 1 ] =>
                            [ 2 ] => 16
                            [ 3 ] => Array
                                (
                                    [ 0 ] => CRM_Core_Error
                                    [ 1 ] => nullHandler
                                )

                            [ 4 ] =>
                        )

                )

Syslog says ...
Quote
Sep 14 12:15:21 xxx postfix/smtpd[30583]: warning: localhost[127.0.0.1]: SASL LOGIN authentication failed: Connection lost to authentication server

Note that over 200 emails bounce with status "not connected" between 12:15 (the error in Syslog) and 12:18 (the error in the CiviCRM log). The error object contains an array of 300 emails: I assume what happens is that the "not connect" error occurred before 100 had been sent, and all the subsequent emails failed.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 'Not connected' error with multiple civimail.cronjob.php CLI processes
September 14, 2011, 07:57:39 am

Note that in 3.4.5 you can limit the number of simultaneous instances of civimail.cronjob.php in the mailer admin settings

also 3.4.6 has fixed the issue of writing the delivered records to the very end. It also has increased the threshold of these bounces to 2

lobo


A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: 'Not connected' error with multiple civimail.cronjob.php CLI processes
September 17, 2011, 04:02:55 am
Excellent!

I'm planning on upgrading to 3.4.6 when it's released.

Thanks, Lobo

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • 'Not connected' error with multiple civimail.cronjob.php CLI processes

This forum was archived on 2017-11-26.