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.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
Pages: [1] 2

Author Topic: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)  (Read 9509 times)

moondrake

  • I’m new here
  • *
  • Posts: 11
  • Karma: 2
cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
April 26, 2012, 11:56:23 pm
Hi There,

I'm probably missing something obvious, but I can't get the new cron.php to activate any of my scheduled jobs.

My setup is Civicrm 4.1.2 on a fresh Joomla 2.5 install.

cron.php is being activated every 15 minutes through URLs by a cron job setup through my hosts cpanel as follows:

Code: [Select]
lynx -source http://mysite.com/administrator/components/com_civicrm/civicrm/bin/cron.php?job=process_mailing\&name=civimail\&pass=my_long_password\&key=my_site_key
and

Code: [Select]
lynx -source http://mysite.com/administrator/components/com_civicrm/civicrm/bin/cron.php?job=fetch_bounces\&name=civimail\&pass=my_long_password\&key=my_site_key (my actuall command has the real password and key)

The scheduled jobs page in my civicrm setup doesn't show that the corresponding jobs are running (the 'Last run' column entry only shows the last time the job was executed manually using the 'Execute Now' link). However, if I look at the logs for each of these jobs I see that the jobs are being initiated by cron, every 15 minutes as expected. For e.g.

DateJob NameCommand/Job Status/Additional Information
2012-04-27 16:30:04Send Scheduled Mailings   0
Summary
Starting execution of Send Scheduled Mailings
Details

Parameters raw (From cron.php):
a:1:{s:7:"version";s:1:"3";}

Parameters parsed (and passed to API method):
a:1:{s:7:"version";s:1:"3";}

Full message:
Starting execution of Send Scheduled Mailings

There are equivalent logs for the fetch_bounces job.

So I began to wonder is the problem with my basic mailer setup? To test this I setup a mailing to a group that included an email sure to bounce and one that was valid. I scheduled the mailing and then manually ran the process_mailings and fetch_bounce actions (using the Execute Now option on the Scheduled Jobs listing). This worked fine. The mailing is received by the legit email and the dummy user with the fake email is put on hold in civicrm. So my outgoing mail settings and my bounce processor are working as intended - unless I've missed something which is highly likely :P.

One other note: after executing the two actions manually I can see in the logs similar output to what I copied above, however in addition to the "Starting Executing Entry" there is a corresponding "Finished execution" log entry indicating that the corresponding action completed successfully (see below) - this entry is not present when the actions are initiated by my cron jobs from urls.

DateJob NameCommand/Job Status/Additional Information
2012-04-27 16:37:33Send Scheduled Mailings   0
Summary
Finished execution of Send Scheduled Mailings with result: Success (a:0:{})
Details

Parameters parsed (and passed to API method):
a:1:{s:7:"version";i:3;}

Full message:
Finished execution of Send Scheduled Mailings with result: Success (a:0:{})

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: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
April 27, 2012, 06:43:55 am

what happens when u run the cron job from the browser?

ie. cut-n-paste the url associated with the lynx command and see what happens.

also can u try using cli.php instead of cron.php to execute the jobs (i'm not sure of the difference)

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

moondrake

  • I’m new here
  • *
  • Posts: 11
  • Karma: 2
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
April 27, 2012, 07:12:11 am
Thanks for the reply lobo.

Quote from: Donald Lobo on April 27, 2012, 06:43:55 am
what happens when u run the cron job from the browser?

A blank browser window. But the logs for that particular job (Civicrm admin page for scheduled jobs) show that it does trigger the job:

2012-04-27 23:56:45   Send Scheduled Mailings0
Summary
Starting execution of Send Scheduled Mailings
Details

Parameters raw (From cron.php):
a:4:{s:6:"__utma";s:55:"149561268.1507912772.1326884014.1326884014.1326884014.1";s:6:"__utmz";s:70:"149561268.1326884014.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)";s:16:"ja_purity_ii_tpl";s:12:"ja_purity_ii";s:7:"version";s:1:"3";}

Parameters parsed (and passed to API method):
a:4:{s:6:"__utma";s:55:"149561268.1507912772.1326884014.1326884014.1326884014.1";s:6:"__utmz";s:70:"149561268.1326884014.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)";s:16:"ja_purity_ii_tpl";s:12:"ja_purity_ii";s:7:"version";s:1:"3";}

Full message:
Starting execution of Send Scheduled Mailings

Again, there is no corresponding 'finishing execution' log entry as you get if you fire the job off manually.

Quote
also can u try using cli.php instead of cron.php to execute the jobs (i'm not sure of the difference)
I did try that using this cron command - /usr/bin/php /home/path-to-my-site/administrator/components/com_civicrm/civicrm/bin/cli.php -u civimail -p my_passowrd -e Job -a execute.

The result I got was this output:

X-Powered-By: PHP/5.3.10
Set-Cookie: PHPSESSID=51a6140886221ee74daf650ef9f4d67e; path=/
Content-type: text/html

It doesn't look like an error, but the cli.php script generated no activity - i.e. nothing in the logs for that scheduled job.

devprogress

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.1.2
  • CMS version: Joomla 2.5
  • MySQL version: 5.0.95
  • PHP version: 5.2.14
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 07, 2012, 08:13:22 pm
I am having the same issue but I am using crontab. I also used wget with the same result.

karunadave

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
    • Karuna Dev
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 6.30 or Drupal 7.26 Drush 6.2.0
  • MySQL version: 5.5.35-cll - MySQL Community Server (GPL)
  • PHP version: 5.3.21
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 08, 2012, 09:17:33 pm
I am also experience the same thing; with CiviCRM 4.1.2 with Drupal 6.25.

I have two sites that use CiviMail, both on Drupal 6.25 both with similar cron configuruation.  After the upgrade to 4.1.2, one continues to work, the other has stopped working.

I can take the url out of my script and it comes back with a blank page, which is good, for if I change a character I get an error message about missing or bad site key or account or password.  However no mail is sent.  I only get mail sent if I use the .../civicrm/mailing/queue URL. 


johnsopaul

  • I’m new here
  • *
  • Posts: 8
  • Karma: 1
  • CiviCRM version: 4.3
  • CMS version: 2.5
  • MySQL version: 5.0
  • PHP version: 5.3
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 13, 2012, 02:21:48 pm
i was also having this problem with j2.5 and civi 4.1.  i am running on a shared host that has both php5.2 and 5.3.  the cron job as defined was using the default 5.2 binary.  when i changed it to the 5.3 version,  jobs began executing correctly.   

my cron job command now looks like:
/usr/local/php53/bin/php $HOME/public_html/my_civicrm/administrator/components/com_civicrm/civicrm/bin/cli.php -u username -p password -e Job -a execute

paul

karunadave

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
    • Karuna Dev
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 6.30 or Drupal 7.26 Drush 6.2.0
  • MySQL version: 5.5.35-cll - MySQL Community Server (GPL)
  • PHP version: 5.3.21
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 13, 2012, 07:25:53 pm
Thank Johnsopaul, I though the PHP version might explain it.  In my case, both my upgraded sites, one now no longer working, one still working are both on PHP version 5.3.6.

johnsopaul

  • I’m new here
  • *
  • Posts: 8
  • Karma: 1
  • CiviCRM version: 4.3
  • CMS version: 2.5
  • MySQL version: 5.0
  • PHP version: 5.3
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 17, 2012, 02:33:29 pm
on closer inspection not all was hunky dory.  some scripts were executing and some not (the "always" mailer etc.).  i have the time zone overridden in a root php.ini in my joomla app which i thought might be messing with the time in the cron jobs.  it seemed if i ran the manual jobs i got a local timestamp, but the cron job stamped them with server time. 
i added -c switch to the above php command pointing to the overridden php.ini and now all jobs are executing correctly - so far

ceford

  • I’m new here
  • *
  • Posts: 20
  • Karma: 2
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 18, 2012, 11:16:54 pm
I had this problem too. I solved it by following the guidelines to create a crontab here: http://wiki.civicrm.org/confluence/display/CRMDOC41/CiviMail+Installation

Something to note: /usr/bin/php and /usr/local/bin/php are different. The former is cgi and does not work - and sends http headers. The latter is cli and does - and does not create any output (so no mail message without  > /dev/null 2>&1).


gmarsh

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.4.2
  • CMS version: Joomla 2.5.14
  • MySQL version: 5.5.32
  • PHP version: 5.3.26
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 31, 2012, 07:06:46 am
Just upgraded to J2.5.4 and C4.1.2 and trying to get the new CRON system working for membership record updates.  I set the timing of the scheduled job (process_membership) to 'always' so that I could test the various run options.  I intend to set that timing to 'daily' when the process is finalized.

Here's what's working & not:
  • Manually executing the job [process_membership] works fine.
  • URL processing - Executing a single job by job name (e.g. job=process_membership) via URL starts the processing but doesn't complete it.  In the job log, the parameters parsed list is enormous (see attached ParametersParsed.pdf). URL I'm using is:  http://[DOMAIN]/administrator/components/com_civicrm/civicrm/bin/cron.php?job=process_membership&name=[USERNAME]&pass=[PASSWORD]&key=[SITEKEY]
  • URL processing - executing only cron.php appears to do nothing.  Blank screen and no logging.  URL: http://[DOMAIN]/administrator/components/com_civicrm/civicrm/bin/cron.php?name=[USERNAME]&pass=[PASSWORD]&key=[SITEKEY]
I used WGET processing in J1.6.4/C4.0.7 calling UpdateMembershipRecord.php directly and that worked fine, but that doesn't seem to be an option any more.  I have not attempted any other types of processing on the assumption that, if the URL processing doesn't work, there is something fundamentally wrong.

Any thoughts on this?

Thanks,
Gary Marsh

nzampella

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 2
  • CiviCRM version: 4.5.3
  • CMS version: Joomla 3.3.6
  • MySQL version: 5.5.36
  • PHP version: 5.4.31
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 31, 2012, 07:23:55 am
Gary .. this is what is working for me at my host:

wget -O - -q -t 1 --post-data='name=nxxxxx&pass=xxxxxxx&key=xxxxxxxx http://usafnukes.com/administrator/components/com_civicrm/civicrm/bin/EmailProcessor.php

I have it running each night at 2 AM.

I couldn't get the CRON.PHP to run either .. so I'm running each process separately .

magnolia61

  • I post occasionally
  • **
  • Posts: 37
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34 / Joomla 3.3.6
  • MySQL version: MySQL 5.5.40
  • PHP version: PHP 5.5.19
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 31, 2012, 07:41:00 am
What version of civicrm are you using then. Because in 4.1.2 the file you mention is depreciated.

nzampella

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 2
  • CiviCRM version: 4.5.3
  • CMS version: Joomla 3.3.6
  • MySQL version: 5.5.36
  • PHP version: 5.4.31
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 31, 2012, 07:46:03 am
Quote from: magnolia61 on May 31, 2012, 07:41:00 am
What version of civicrm are you using then. Because in 4.1.2 the file you mention is depreciated.

It is, but its still there in 4.1.2, and it works, along with ..../administrator/components/com_civicrm/civicrm/bin/UpdateMembershipRecord.php using the same wget setup.

I need something to keep updating and processing mail while I try to get something else going.

Cheers
« Last Edit: May 31, 2012, 07:48:28 am by nzampella »

gmarsh

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.4.2
  • CMS version: Joomla 2.5.14
  • MySQL version: 5.5.32
  • PHP version: 5.3.26
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
May 31, 2012, 06:20:16 pm
Thanks for the info on using WGET!  I tried it using UpdateMembershipRecord.php and received the following fatal error: Cannot redeclare class JConfig in /home/tchradev/www/www/configuration.php on line 2  Here's the actual code:

wget -O - -q -t 1  --post-data='name=[USERNAME]&pass=[PASSWORD]&key=[SITEKEY]'  http://www.tchra.org/administrator/components/com_civicrm/civicrm/bin/UpdateMembershipRecord.php

Will keep working on it.

grumpybug

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.1.3
  • CMS version: 2.5.4
  • MySQL version: 5.0.91
  • PHP version: 5.2.9
Re: cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)
June 16, 2012, 12:09:26 am
Just out of curiosity, did you find a fix for " Cannot redeclare class JConfig in " error.

My site which has been working has suddenly developed this error.

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • cron.php not finishing scheduled jobs (CiviCRM 4.1.2 on Joomla 2.5)

This forum was archived on 2017-11-26.