cancel
Showing results for 
Search instead for 
Did you mean: 

One or more indexers are invalid. Make sure your Magento cron job is running.

SOLVED
Highlighted

One or more indexers are invalid. Make sure your Magento cron job is running.

What is this and how do i fix it? 

 

I have found several posts about this but for the life of me i have no idea what the solution is talking about. I have tried to instal and run putty to make these changes but persistent erros occurred with that software so its been uninstalled. 

 

Any solutions to this would be grateful.

 

Paul

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: One or more indexers are invalid. Make sure your Magento cron job is running.

Solved. 

 

I spoke to siteground chat who advised changing the php to php72. I added the -f back in and now the error message has gone.

 

So

 

 php72 -f /home/<username>/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/<username>/public_html/var/log/magento.cron.log
 php72 -f /home/<username>/public_html/update/cron.php >> /home/<username>/public_html/var/log/update.cron.log
 php72 -f /home/<username>/public_html/bin/magento setup:cron:run >> /home/<username>/public_html/var/log/setup.cron.log 

 

Thank you both for the help. 

View solution in original post

16 REPLIES 16

Re: One or more indexers are invalid. Make sure your Magento cron job is running.

Hello @paul_alexander ,

 

To reindex in magento 2, go to the CLI and then the root folder of your magento installation and run the below command :

 

php bin/magento indexer:reindex

 

Also, Please configure cronjob on server so you don't need to reindex indexes.

 

 

 

--

If my answer is useful, please Accept as Solution & give Kudos

Highlighted

Re: One or more indexers are invalid. Make sure your Magento cron job is running.

what is the CLI? Assume i know absolutely nothing about this. I can apparently run cronjobs through cpanel via siteground but everything else to do SSH, Putty, CLI I have no idea about. Ive just spent the past three hours trying to get a connection via SSH to putty, but even chat help with siteground could not work out why putty was continuously disconnecting so i lost the will to live with that and I am trying to find another way of solving this apparent common problem.

Highlighted

Re: One or more indexers are invalid. Make sure your Magento cron job is running.

Hello @paul_alexander ,

 

CLI means you have to run command via terminal.

 

Please setup cronjob on via cPanel it will solve issue after running cronjob.

The Magento 2 upgrade system as well as many admin tasks depends on the cron jobs being configured properly. Cron jobs are scheduled tasks which run at a specific interval. Follow the steps below to set up your Magento 2 cron jobs.

Log in to your cPanel and click on Cron Jobs in the Advanced section. Add three cron job commands and configure them to run Once Per Minute:

 

 php7 -f /home/<username>/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/<username>/public_html/var/log/magento.cron.log
 php7 -f /home/<username>/public_html/update/cron.php >> /home/<username>/public_html/var/log/update.cron.log
 php7 -f /home/<username>/public_html/bin/magento setup:cron:run >> /home/<username>/public_html/var/log/setup.cron.log 

Replace <username> with your cPanel account username. If you prefer to use PHP 5.6 instead of PHP 7 you can replace php7 with php56 in the above commands. When the cron jobs are configured correctly it should look like this:

cron-jobs.png

 

--
If my answer is useful, please Accept as Solution & give Kudos

Highlighted

Re: One or more indexers are invalid. Make sure your Magento cron job is running.

Thank you for the reply and detailed explanation. I have added those lines to cronjobs in cpanel, changed the username and nothing is happening. I have added screenshots for you to look at.

 

Paul

bandicam 2019-02-11 17-14-59-517.jpgbandicam 2019-02-11 17-15-02-161.jpg

Highlighted

Re: One or more indexers are invalid. Make sure your Magento cron job is running.

@paul_alexander 

You may not need to put add '7' after php and '-f'. Try php /home..... as it is without 7 and -f in the command. Wait for at least 15-20 minutes to see the updates.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.
Highlighted

Re: One or more indexers are invalid. Make sure your Magento cron job is running.

Hi Tarandeep, thank you for posting a reply. I tried those modifications to the commands but the error is still appearing. Could it be an issue with magento? 

Highlighted

Re: One or more indexers are invalid. Make sure your Magento cron job is running.

Solved. 

 

I spoke to siteground chat who advised changing the php to php72. I added the -f back in and now the error message has gone.

 

So

 

 php72 -f /home/<username>/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/<username>/public_html/var/log/magento.cron.log
 php72 -f /home/<username>/public_html/update/cron.php >> /home/<username>/public_html/var/log/update.cron.log
 php72 -f /home/<username>/public_html/bin/magento setup:cron:run >> /home/<username>/public_html/var/log/setup.cron.log 

 

Thank you both for the help. 

View solution in original post

Highlighted

Re: One or more indexers are invalid. Make sure your Magento cron job is running.

Hi @gelanivishal,

 

Can I confirm if you run "php bin/magento indexer:reindex" via CLI it'll fix the problem but won't create the cron job for you?

 

So, if you don't have the cron jobs set-up you would constantly have to run "php bin/magento indexer:reindex" via CLI?

 

Thanks.

Highlighted

Re: One or more indexers are invalid. Make sure your Magento cron job is running.

Hello @DAWS96 ,

 

No, You can setup cronjob in your server then you don't get this type of issue.

 

--
If my answer is useful, please Accept as Solution & give Kudos