Cron jobs in Magento 2 are a great tool to automate repetitive tasks!
However, sometimes the developers face an Undefined index: jobs error on running cron in Magento 2.x.x. (including me )
While running the below command,
/usr/bin/php [magento root directory]/bin/magento cron:run | grep -v "Ran jobs by schedule" >> [magento root directory]/var/log/magento.cron.log
Magento throws the below exception:
[Exception] Notice: Undefined index: jobs in /home/ubuntu/repo/project/vendor/magento/
module-cron/Model/Config/Converter/Db.php on line 39
The solution to undefined index: jobs error on running cron in Magento 2.x.x:
While migrating from Magento 1 to Magento 2, you may have got the entries as crontab/{groupname}/jobs/{code} with the missing group name i.e default in core_config_data table. You need to delete the wrong table entries and run the upgrade and deploy command to solve the issue.
That’s all to get rid of the error.
Do share the solution with the fellow developers via social media.
Thanks.