For magento 2.2.4 my cron.sh looks like this (crontab is not available in this environment):


PHP_BIN=`which php7-71STABLE-CLI`;

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

$PHP_BIN -d max_execution_time=180 -d memory_limit=756M -c $INI $BIN cron:run | grep -v "Ran jobs by schedule" >> $DIR/var/log/magento.cron.log
$PHP_BIN -d max_execution_time=180 -d memory_limit=756M -c $INI $DIR/update/cron.php >> $DIR/var/log/update.cron.log
$PHP_BIN -d max_execution_time=180 -d memory_limit=756M -c $INI $BIN setup:cron:run >> $DIR/var/log/setup.cron.log

It is run every minute and produces no errors.

In the table cron_schedule I see all kinds of scheduled entries including indexer_reindex_all_invalid.

While others are properly executed the reindex never gets executed. It is stuck with status pending.

The cron config in backend is using the default options.

Manual php bin/magento indexer:reindex works fine but this should be done automatically as it is in my dev environment.

I googled and searched everywhere and ran out of options. What could possibly be wrong here?

  • have you run php bin/magento cron:install in terminal ? Jul 12, 2018 at 9:25
  • Like I said: crontab is not available. The crons get planned from a cpanel type web frontend. The above shell script works just fine.
    – omsta
    Jul 12, 2018 at 9:27

1 Answer 1


I finally found the solution. The crons in the magento backend were configured to use a separate process which does not work on our provider's server. Once I disabled that option the indexers were flying again.

  • how did you change this option?
    – zekia
    Feb 19, 2019 at 10:37
  • Stores -> Configuration -> Advanced -> System -> Cron. There each cron group has a setting called "Use Separate Process". I set those to "No".
    – omsta
    Feb 19, 2019 at 14:03

Your Answer

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

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