0

I configured the cronjob that is responsible for reindexing my webshop correctly. Unfortunately the indexer is not updated. If I enable cron output I get 'Ran jobs by schedule.'. But when I go to the Index Management page I see that nothing is updated there.

When I manually run: php bin/magento indexer:reindex this values are updated.

Does anyone know what the problem is here?

Thanks.

5
  • Have you set the Magento 2 cron job setting or cpanel cron setting, if cpanel please post the command you gave for cron job, here or update it in your question.
    – Vicky Dev
    Dec 23, 2015 at 12:13
  • Yes, I did configure the cronjob via cPanels. This is the command: /usr/local/bin/php -c /usr/local/lib /home/iys/public_html/bin/magento cron:run > /dev/null where /usr/local/lib is the folder where php.ini is located.
    – Silvan
    Dec 23, 2015 at 12:37
  • By default, indexers are set to update on save. Try changing it to update on schedule: php bin/magento indexer:set-mode schedule. Does that work? Dec 24, 2015 at 14:13
  • Unfortunately this is not the solution to my problem. I already configured Magento to update by schedule instead of update by save.
    – Silvan
    Dec 29, 2015 at 8:13
  • You can check my answer here. Hope this helps you. Apr 3, 2016 at 7:02

5 Answers 5

0

I am having the same issue. I believe it is a bug in Magento 2.0. I have posted the issue on the Magento github at https://github.com/magento/magento2/issues/2855.

0

You need to run cron twice. First to discover the jobs to run and second to execute them.

0
0

I had same problem, so what I did was to create a new cron job just to re-index, by executing the re-index command:

/usr/local/bin/php -c /usr/local/lib/php.ini 'your magento home'/bin/magento indexer:reindex >/dev/null 2>&1

Please note that your PHP folder and php.ini folder could be different from mine.

I decided to use >/dev/null 2>&1 because the log output of the re-index command has several lines so I do not wanted a large log file be created on time as I can see on the admin page if the re-index is done or not.

0

In Magento 2.0.x we added php bin/magento indexer:reindex for a long time in our cronjobs. But this is not the real solution. This is a really heavy command to run and can slow down production environment. Magento 2 has a complex partial reindexing mechanism, which you can read all about here: https://maxchadwick.xyz/blog/digging-into-magento-2-partial-reindexing-implementation.

Since Magento 2.1.x the issue is fixed for us and we do not need to add indexer:reindex anymore to our cronjobs.

-1

I think you need to restart your cron service in Host Server

To do so in Apache CentOS Use below command:

service crond stop 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.