magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Cron error

Open thomvanderboon opened this issue 10 years ago • 6 comments

Every night at 0:00 I get the following cron error

PHP Fatal error: Class 'Magento\SalesRule\Crone\AggregateSalesReportCouponsData' not found in /var/www/html_dev/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php on line 97

I have the same issue on a 2.0.2 install as well as a clean dev install

After installation the following commands have been issued:

composer update php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy en_US nl_NL php bin/magento indexer:reindex php bin/magento cache:clean php bin/magento cache:flush

I run the cron as follows:

*/1 * * * * php -c /etc/php.ini /var/www/html/bin/magento cron:run > /dev/null */1 * * * * php -c /etc/php.ini /var/www/html/update/cron.php > /dev/null */1 * * * * php -c /etc/php.ini /var/www/html/bin/magento setup:cron:run > /dev/null

So any errors will be mailed to the system owner.

Error mail is issued only once every day.

thomvanderboon avatar Mar 13 '16 23:03 thomvanderboon

Internal ticket MAGETWO-50633

buskamuza avatar Mar 18 '16 14:03 buskamuza

Hi @thomvanderboon, there was a typo in SalesRule module's crontab.xml and it has been fixed in the develop branch (https://github.com/magento/magento2/commit/af80f15a49fc0a77f32ad906cae78e3c93375934#diff-fe2887919970f52be8c36f474e625585). It is not in 2.0.2 yet but will be available in future versions.

eddielau avatar Mar 18 '16 18:03 eddielau

Due to the "huge" change in the code, I manually patched both my 2.0.2 and development branch using vi :)

Do I have to close this issue, or will it be closed when the solution is available in 2.0.x?

thomvanderboon avatar Mar 18 '16 19:03 thomvanderboon

I think it is best to close it, since solution is already in the develop branch. We have marked it to be ported to 2.0.x.

mazhalai avatar Mar 18 '16 20:03 mazhalai

After manually patching the files. I still got the error messages (both on dev and 2.0.2). Do I have to recompile magento?

Furthermore I noticed that there are quite some error records in the cron_schedule table. Do I have to clear the errors in cron_schedule table manually?

thomvanderboon avatar Mar 19 '16 06:03 thomvanderboon

Please try cleaning cache. Yes, you will need to clean the records manually.

eddielau avatar Mar 22 '16 15:03 eddielau