Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 10
Issues With Cron and Catalog price rules
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

Every day at midnight my catalog price rules disappear. The cron is setup and running every 5 minutes. Problem is the rules “switch off” with or with out the cron working. I am at a loss to figure this out but find i have to wait up till the rules turn off then reapply them. This is getting to the point of being unacceptable and i really need some help. Any ideas will be appreciated.

When i did the last upgrade the system rewrote all my file permissions including cron.php. Is it possible that one or more other may have this same issue? Does anybody know if i can check if the cron is executing the catalog price rules?

Edit, the cron.php file is being executed, as i inserted a email to code at the end of the file.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chrisdarl
Member
 
Total Posts:  45
Joined:  2008-07-17
 

Getting the same issue.. would be great if someone could find out why!

running 1.3.2.3

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

Ok its midnight and all my specials have dissapeared. I am waiting till 0100 to see if they reappear as this happened last night. (i made a couple of minor changes) Now i know my cron is executing because i have checked the cron_schedule table. I have included a dump of the table. Now all the tables have the spcials data in it bar the catalog rule affected products table, which is empty.

The odd one out in the cron schedule, ie the only things that happened at midnight (local time) was catalog_product_alert & sales_clean_quotes. I wonder if these have anything to do with it and how do i disable them. Sorry i am not offering a solution just thinking out loud as nobody who develops this software seems to put any input into this issue…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

4668 catalogrule_apply_all pending NULL 2009-08-07 14:45:01 2009-08-07 15:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00

Has just appeared in the cron_schedule table....

 
Magento Community Magento Community
Magento Community
Magento Community
 
chrisdarl
Member
 
Total Posts:  45
Joined:  2008-07-17
 

From searching the forum, you need to set up CRON. Search for how to setup cron jobs and then it should do the trick.

Good luck!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

OK my specials are back at 0100

schedule_id job_code status messages created_at scheduled_at executed_at finished_at
4668 catalogrule_apply_all success NULL 2009-08-07 14:45:01 2009-08-07 15:00:00 2009-08-07 15:00:02 2009-08-07 15:00:08

the only change i made last night was in my cron setup.

*/* * * * /absolute/path/to/bin/php -/absolute/path/to/magento/cron.php

to
minus the “-f” switch

*/* * * * /absolute/path/to/bin/php  /absolute/path/to/magento/cron.php

now just to figure out why the disappear @ midnight (this was happening before i setup the cron)

I also added this to the bottom of my cron.php file to help debugging.

$to "you@yourdomain.com";
$subject "Cron Mail";
$message "Cron is active "date('l jS \of F Y h:i:s A');
$from "you@yourdomain.com";
$headers "From: $from";
mail($to,$subject,$message,$headers);
 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

Same again tonight. I disabled product alerts in advanced/disable outputs with no effect. Next step, disable it in the xml file

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

Quick php script to get cron data

<?php
//Magento Cron script. GNU/GPL
//oliver.higgins@gmail.com
//provided without warranty or support
//================================================================
//insert your database info here
$server='your.server.address:port';
$user='yourusername';
$pass='yourpassword';
$db='yourMySQLdatabasenane';
//end data input
//================================================================

echo "<h1>Magento Cron Schedule</h1><h2>for ".$user."@".$server."</h2>";
//================================================================
//pending jobs

mysql_connect($server,$user,$pass);
@
mysql_select_db($db) or die("Unable to select database");
//$query="SELECT * FROM cron_schedule" ;
$query='SELECT * FROM `cron_schedule` WHERE `status` ="pending" ORDER BY `scheduled_at` DESC' ;
$result=mysql_query($query);
$num=mysql_numrows($result);
echo 
"<h2>".$num." Jobs Pending</h2>";
echo 
'<table border="1"><tbody>';
echo 
"<tr><th>schedule_id</th><th>job_code</th><th>status</th><th>created_at</th><th>scheduled_at</th>";
//echo "<th>executed_at</th><th>finished_at</th></tr>";
$i=0;
while (
$i $num{

$schedule_id
=mysql_result ($result,$i,"schedule_id");                                      
$job_code=  mysql_result($result,$i,"job_code");
$status=mysql_result ($result,$i,"status");
$created_at=mysql_result ($result,$i,"created_at");
$scheduled_at=mysql_result ($result,$i,"scheduled_at");
$executed_at=mysql_result ($result,$i,"executed_at");
$finished_at=mysql_result ($result,$i,"finished_at");

//output html
echo "<tr>";
echo 
"<td>".$schedule_id."</td>";
echo 
'<td>'.$job_code."</td>"
echo 
'<td style="color: red;">'.$status."</td>"
echo 
"<td>".$created_at."</td>"
echo 
"<td>".$scheduled_at."</td>"
//echo "<td>".$executed_at."</td>"; 
//echo "<td>".$finished_at."</td>"; 
echo "</tr>";                 
$i++;
}
echo "</tbody></table><hr>";
//================================================================
//Succsessful jobs

mysql_connect($server,$user,$pass);
@
mysql_select_db($db) or die("Unable to select database");
//$query="SELECT * FROM cron_schedule" ;
$query='SELECT * FROM `cron_schedule` WHERE `status` ="success" ORDER BY `executed_at` DESC' ;
$result=mysql_query($query);
$num=mysql_numrows($result);
echo 
"<h2>".$num." Jobs Succsessful</h2>";
echo 
'<table border="1"><tbody>';
echo 
"<tr><th>schedule_id</th><th>job_code</th><th>status</th><th>created_at</th><th>scheduled_at</th>";
echo 
"<th>executed_at</th><th>finished_at</th></tr>";
$i=0;
while (
$i $num{

$schedule_id
=mysql_result ($result,$i,"schedule_id");                                      
$job_code=  mysql_result($result,$i,"job_code");
$status=mysql_result ($result,$i,"status");
$created_at=mysql_result ($result,$i,"created_at");
$scheduled_at=mysql_result ($result,$i,"scheduled_at");
$executed_at=mysql_result ($result,$i,"executed_at");
$finished_at=mysql_result ($result,$i,"finished_at");

//output html
echo "<tr>";
echo 
"<td>".$schedule_id."</td>";
echo 
"<td>".$job_code."</td>"
echo 
"<td>".$status."</td>"
echo 
"<td>".$created_at."</td>"
echo 
"<td>".$scheduled_at."</td>"
echo 
"<td>".$executed_at."</td>"
echo 
"<td>".$finished_at."</td>"
echo 
"</tr>";                 
$i++;
}
echo "</tbody></table>";
//================================================================
?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

I edited the catalogrule_apply_all config.xml file to schedule earlier. This seems to work to turn it all back on.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

I am having this issue too.  I have a rule to have a certain category on sale for 30% off through sept 8th.  every 24 hours or so, it turns the rule off until i go back in and hit “apply”

this is really frustrating.  did anyone find a permanent fix?

 
Magento Community Magento Community
Magento Community
Magento Community
 
chrisdarl
Member
 
Total Posts:  45
Joined:  2008-07-17
 

Have you setup your Cron correctly?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 
lurebeauty - 25 August 2009 07:26 AM

I am having this issue too.  I have a rule to have a certain category on sale for 30% off through sept 8th.  every 24 hours or so, it turns the rule off until i go back in and hit “apply”

this is really frustrating.  did anyone find a permanent fix?

yeah #1 is your cron working correctly?

Mine turn off at midnight and then back on at 0005

 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

Ok i set up the cron as in this post and i checked and today it is ok, so I think it worked! you guys are great!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 
lurebeauty - 26 August 2009 05:50 AM

Ok i set up the cron as in this post and i checked and today it is ok, so I think it worked! you guys are great!

Good luck smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

Nope, it didnt work, today again the sales were back off again :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

did u use the cronmon.php file?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 10