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 »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • Cron job problem
Pages: [1]

Author Topic: Cron job problem  (Read 5888 times)

trevorwood

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 4
  • CiviCRM version: 4.0.2
  • CMS version: Joomla 1.6
  • MySQL version: 5.0.51a
  • PHP version: 5.2.6-1+lenny8
Cron job problem
January 13, 2012, 12:25:53 am
I'm trying to get the Cron job working for CiviMail

Here's the cronjob code

#This must be set to the directory where civicrm is installed.
CIVI_ROOT=/var/www/vhosts/the-businessclub.org.uk/httpdocs/administrator/components/com_civicrm/civicrm
USER=www-data
MAILTO="trevor.wood@redline.co.uk"
#Location of the PHP Command Line Interface binary. nice -19 forces to run at a lower priority than the web server
PHP=nice -n19 /usr/bin/php
#line to be modified according to the informations below
PARAMS= -sthe-businessclub.org.uk -umailprocessingforcivicrm -p***deleted***
#cronjob send
#m h dom mon dow command
*/5 * * * * cd $CIVI_ROOT;$PHP bin/civimail.cronjob.php $PARAMS
*/15 * * * * cd $CIVI_ROOT;$PHP bin/EmailProcessor.php $PARAMS

Every 15 minutes I get an email with the following

PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imap.ini on line 1 in Unknown on line 0 PHP Warning:  Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0 Sorry. A non-recoverable error has occurred.
Could not connect to MailStore<p>Error message: <pre>An error occured while sending or receiving mail. Failed to connect to the server: gmail.com:993.</pre><p>



#0  CRM_Core_Error::fatal(Could not connect to MailStore<p>Error message: <pre>An error occured while sending or receiving mail. Failed to connect to the server: gmail.com:993.</pre><p>) called at [/var/www/vhosts/the-businessclub.org.uk/httpdocs/administrator/components/com_civicrm/civicrm/bin/EmailProcessor.php:165]
#1  EmailProcessor::_process(1, CRM_Core_DAO_MailSettings Object ([id] => 1,[domain_id] => 1,[name] => thebusinessclub.return,[is_default] => 1,[domain] => gmail.com,[localpart] => thebusinessclub.return+,[return_path] => ,[protocol] => 1,[server] => gmail.com,[port] => ,[username] => thebusinessclub.return@gmail.com,[password] => t&Xac!uf97Br,[is_ssl] => 1,[source] => ,[_DB_DataObject_version] => 1.8.12,[__table] => civicrm_mail_settings,[N] => 1,[_database_dsn] => ,[_database_dsn_md5] => bbc6212c56788a73440f12edfd842f83,[_database] => busclub-joomla,[_query] => ,[_DB_resultid] => 7,[_resultFields] => ,[_link_loaded] => ,[_join] => ,[_lastError] => )) called at [/var/www/vhosts/the-businessclub.org.uk/httpdocs/administrator/components/com_civicrm/civicrm/bin/EmailProcessor.php:65]
#2  EmailProcessor::processBounces() called at [/var/www/vhosts/the-businessclub.org.uk/httpdocs/administrator/components/com_civicrm/civicrm/bin/EmailProcessor.php:364]

If I delete (or comment out using #) the last line to manage the bounces, the emails stop.

The queued email is not being processed.

Any help would be greatly appreciated.

Please not I'm not very familiar with Linux so I need really detailed help - for example if you want to see outputs or error logs you'll need to tell me how to do this

The priority is to get the mail sent and then sort out the bounce

Thanks in advance

trevorwood

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 4
  • CiviCRM version: 4.0.2
  • CMS version: Joomla 1.6
  • MySQL version: 5.0.51a
  • PHP version: 5.2.6-1+lenny8
Re: Cron job problem
January 15, 2012, 10:22:48 am
Anyone please - I'm getting desperate

Thanks

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Cron job problem
January 15, 2012, 10:48:09 am
Hi,

The account you have configured for the bounce seems to be invalid.

I would suggest running the commands directly from the shell to see the result, and once they work, put them in the cron.

Check out our book for more details:

http://book.civicrm.org/user/basic-setup/email-system-configuration
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Cron job problem
January 15, 2012, 12:17:12 pm
Can you try the URL method for these cron jobs? If so, you can use wget and the URL for the cron job.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

trevorwood

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 4
  • CiviCRM version: 4.0.2
  • CMS version: Joomla 1.6
  • MySQL version: 5.0.51a
  • PHP version: 5.2.6-1+lenny8
Re: Cron job problem
January 16, 2012, 12:49:29 am
Quote from: xavier on January 15, 2012, 10:48:09 am
Hi,

The account you have configured for the bounce seems to be invalid.

I would suggest running the commands directly from the shell to see the result, and once they work, put them in the cron.

Check out our book for more details:

http://book.civicrm.org/user/basic-setup/email-system-configuration

I realise there's a prblem with the bounce configuration - at the moment my main problem is getting the send to work. I'll get back to the bounce once that is working

trevorwood

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 4
  • CiviCRM version: 4.0.2
  • CMS version: Joomla 1.6
  • MySQL version: 5.0.51a
  • PHP version: 5.2.6-1+lenny8
Re: Cron job problem
January 16, 2012, 12:51:44 am
Quote from: Hershel on January 15, 2012, 12:17:12 pm
Can you try the URL method for these cron jobs? If so, you can use wget and the URL for the cron job.

I can run the send using http://domainname/administrator/?option=com_civicrm&task=civicrm/mailing/queue&reset=1

I'll look at wget documentation later on today. Thanks

trevorwood

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 4
  • CiviCRM version: 4.0.2
  • CMS version: Joomla 1.6
  • MySQL version: 5.0.51a
  • PHP version: 5.2.6-1+lenny8
Re: Cron job problem
January 17, 2012, 06:53:24 am
I can run this with wget

I've also progressed a little with the standard Cron job

after setting it up using the Plesk interface, I'm now getting emails back which say

/bin/sh: bin/civimail.cronjob.php: Permission denied

/bin/sh: bin/EmailProcessor.php: Permission denied

What permission needs to be granted where for this to run?

Cheers

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Cron job problem
January 17, 2012, 08:02:24 am
Try 775
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Cron job problem
January 17, 2012, 08:32:15 am
It's not a shell you can run directly, you need to put "php " before (and I'd suggest to go "nice -n19 php" like in the initial examples)
 
Quote from: trevorwood on January 17, 2012, 06:53:24 am

after setting it up using the Plesk interface, I'm now getting emails back which say

/bin/sh: bin/civimail.cronjob.php: Permission denied

/bin/sh: bin/EmailProcessor.php: Permission denied

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

trevorwood

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 4
  • CiviCRM version: 4.0.2
  • CMS version: Joomla 1.6
  • MySQL version: 5.0.51a
  • PHP version: 5.2.6-1+lenny8
Re: Cron job problem
January 19, 2012, 06:49:28 am
Quote from: xavier on January 17, 2012, 08:32:15 am
It's not a shell you can run directly, you need to put "php " before (and I'd suggest to go "nice -n19 php" like in the initial examples)
 
Quote from: trevorwood on January 17, 2012, 06:53:24 am

after setting it up using the Plesk interface, I'm now getting emails back which say

/bin/sh: bin/civimail.cronjob.php: Permission denied

/bin/sh: bin/EmailProcessor.php: Permission denied


Sorry - probably didn't make it clear - this is what the email comes back with. I do have the php nice etc in front

trevorwood

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 4
  • CiviCRM version: 4.0.2
  • CMS version: Joomla 1.6
  • MySQL version: 5.0.51a
  • PHP version: 5.2.6-1+lenny8
Re: Cron job problem
January 19, 2012, 06:50:04 am
Quote from: Hershel on January 17, 2012, 08:02:24 am
Try 775

which directory?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Cron job problem
January 19, 2012, 08:19:15 am
On the files civimail.cronjob.php and EmailProcessor.php

But I would try running

Code: [Select]
cd /var/www/vhosts/the-businessclub.org.uk/httpdocs/administrator/components/com_civicrm/civicrm
php bin/civimail.cronjob.php

from the command line to test that it executes.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

trevorwood

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 4
  • CiviCRM version: 4.0.2
  • CMS version: Joomla 1.6
  • MySQL version: 5.0.51a
  • PHP version: 5.2.6-1+lenny8
Re: Cron job problem
January 23, 2012, 06:43:46 am
Sorry I haven't got back to you - our hosting company had a major crash and we've been recovering various websites.

I've done cd /var/www/vhosts/the-businessclub.org.uk/httpdocs/administrator/components/com_civicrm/civicrm; nice -n19 /usr/bin/php bin/civimail.cronjob.php -sthe-businessclub.org.uk -umailprocessingforcivicrm -ppassword

and it runs OK - except that I get

PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imap.ini on line 1 in Unknown on line 0

Anyway - the email has arrived, now I need to turn it into a Cron job.

Funny though - since the recovery the WGET command that I tried before doesn't seem to work - not that that's a problem if the above works

Thanks for help, I'll get back and let you know how I get on

There is a problem with the job to test bounce messages though

I've set up a gmail account to check. I'm using the command cd /var/www/vhosts/the-businessclub.org.uk/httpdocs/administrator/components/com_civicrm/civicrm; nice -n19 /usr/bin/php bin/EmailProcessor.php -sthe-businessclub.org.uk -umailprocessingforcivicrm -ppassword

and I'm getting the error

PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imap.ini on line 1 in Unknown on line 0
Sorry. A non-recoverable error has occurred.
Could not connect to MailStore<p>Error message: <pre>An error occured while sending or receiving mail. Failed to connect to the server: gmail.com:993.</pre><p>



#0  CRM_Core_Error::fatal(Could not connect to MailStore<p>Error message: <pre>An error occured while sending or receiving mail. Failed to connect to the server: gmail.com:993.</pre><p>) called at [/var/www/vhosts/the-businessclub.org.uk/httpdocs/administrator/components/com_civicrm/civicrm/bin/EmailProcessor.php:165]
#1  EmailProcessor::_process(1, CRM_Core_DAO_MailSettings Object ([id] => 1,[domain_id] => 1,[name] => thebusinessclub.return,[is_default] => 1,[domain] => gmail.com,[localpart] => thebusinessclub.return+,[return_path] => ,[protocol] => 1,[server] => gmail.com,[port] => ,[username] => thebusinessclub.return@gmail.com,[password] => password[is_ssl] => 1,[source] => ,[_DB_DataObject_version] => 1.8.12,[__table] => civicrm_mail_settings,[N] => 1,[_database_dsn] => ,[_database_dsn_md5] => bbc6212c56788a73440f12edfd842f83,[_database] => busclub-joomla,[_query] => ,[_DB_resultid] => 7,[_resultFields] => ,[_link_loaded] => ,[_join] => ,[_lastError] => )) called at [/var/www/vhosts/the-businessclub.org.uk/httpdocs/administrator/components/com_civicrm/civicrm/bin/EmailProcessor.php:65]
#2  EmailProcessor::processBounces() called at [/var/www/vhosts/the-businessclub.org.uk/httpdocs/administrator/components/com_civicrm/civicrm/bin/EmailProcessor.php:364]

I've got the following set up in CiviCRM

Name: thebusinessclub.return
Server: gmail.com
Username: thebusinessclub.return@gmail.com
Password:
Localpart: thebusinessclub.return+
Email Domain: gmail.com
Return Path:
Protocol: POP3 (I've tried it with IMAP and it still doesn't work)
Use SSL: yes
Used for:Bounce Processing

When i set up the account in Outlook, it connects fine. The only thing I can see is different is the port number. In outlook it's 995, here it looks like 993

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Cron job problem
January 23, 2012, 07:32:25 am
Hi,

Modify (or ask your host to modify) imap.ini This being said it's a warning so not a big issue

Can you ask your host if they have this port open (outgoing traffic)? Might be that they don't allow the connection. The rest seems ok configured

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

trevorwood

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 4
  • CiviCRM version: 4.0.2
  • CMS version: Joomla 1.6
  • MySQL version: 5.0.51a
  • PHP version: 5.2.6-1+lenny8
Re: Cron job problem
January 23, 2012, 11:16:25 am
agreed it's not a big issue but I'm getting an email every 5 minutes!

I'll check about the port - thanks

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • Cron job problem

This forum was archived on 2017-11-26.