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

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

Dear Forum,

 

I have scoured the net looking for an easy fix for my problem.  However, it has lead to more frustration and no resolve.  I recently manually installed Magento version 2 on my c-panel hosted account.  I was successful at installing it in top directory of my public_html folder.  

I am seeing a message in the dashboard that states:  "One or more indexers are invalid. Make sure your Magento cron job is running."  

I do not have shell access to my account (according to my hosting provider).  So, this leaves me with only being able to setup a Cron job to perform the necessary reindexing.  I have found many good articles on the net for setting up the cron job, but they are not working correctly.  Can someone please provide instructions for us c-panel users without shell access?  I would love to use this store software, but if I am unable to find a solution, I will need to look elsewhere.  

Any assistance would kindly be appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

Finally!  After searching just a bit more, I replaced the first part of the Cron Job string with the following to point to the correct location of my php version:  /opt/php71/bin/php 

It finally worked!  I was only left with a 'Cache Management' message about an invalidated cache type, which was quickly resolved by doing a 'Refresh' on the affected Cache.

 

So, in order to save the next persons from having to spend way too much time trying to resolve this issue, here are the full steps that resolved my issue with not having SSH access and having to resort to Cron Jobs.  Many thanks to "ManthanDave" for pointing me in the right direction!!

 

1.  Follow the steps in this article to configure Magento Cron Jobs on Shared hosting accounts:  https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/magento1/optimi...

 

2.  Add this Cron Job command using the full path to your php (See steps below for how I found this) and replace the 'mypath' with the name of your home directory c-panel account:

 

/opt/php71/bin/php /home/pandasnpearls/public_html/bin/magento indexer:reindex

 

I set the interval for 15 minutes which was the same as the other Cron Jobs from the article.

 

PHP full path
You might wonder how I found the full path to PHP:

  1. In your CPanel File Manager, browse to your shops public folder
  2. In the root folder, where Magento's index.php file is, create a file called info.php
  3. Paste in this code:
<?php
phpinfo();
?>
  1. Save, and then open another browser tab and open the url to this file. Example something like www.your-shop-domain.com/shop/info.php
  2. Search for "php" on that page and you'll find the full path

That's it. Remember to delete the info.php file when get everything up and running. 

 

Hope this helps.  It would have been easier, I think to have SSH access to the Cpanel, but I had already invested so much time in this, I had to see it through for those that did not have it.  I will be speaking with my cpanel hosting provider about turning the SSH feature on, though, for future situations like this.  

 

Danny 

 

 

View solution in original post

5 REPLIES 5

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

Hi @daniel_stump

 

okay i understand the problem you are facing !

 

So yes , you can set the cron job from cpanel - sometimes it happens that when we are using shared hosting , so we don't have SSH access for the same !

 

So below i am sharing links , how to set cron job using cpanel !

 

https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/magento1/optimi...

 

https://magecomp.com/blog/how-to-setup-a-cron-job-in-cpanel-for-magento/

 

https://www.youtube.com/watch?v=phGTGS43U-M

 

Also one more thing , there is one github module available to do reindexing from magento admin panel itself !

 

So you can install that module and used it for the same here is the link - https://github.com/yireo/magento2-backend-reindexer

 

P.S - In magento 2 -  to install any module or any other operations , you required to run commands , so i would suggest you to ask your hosting providers for command line (SSH) access !

 

Hope it helps ! 

if issue solved,Click Kudos & Accept as Solution

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

Hi MathanDave!

 

Thank you so very much for providing me with the information.  I will definitely will pursue obtaining SSH command line access.  In the meantime, I followed information on article "How to configure Magento cron jobs on shared hosting accounts".  Since there was no mention on that article about the "indexer-Reindex, I added one further Cron Job for it using the following command, replacing the 'mypath' with the root name of my site folder and the same time (15 minute) parmeter:  /usr/bin/php /home/mypath/public_html/bin/magento indexer:reindex

 

I feel that I am now getting ever so closer.  However, something is still not quite right.  I get the following in my email on the matter:  

Content-type: text/html

bin/magento must be run as a CLI application

 

I'm wondering if the path I am using is the correct one for php?  I had come across an article in all of my searching that did instruct a method for obtaining the correct path for the php version currently installed using an info.php request, which showed my path to be:  /opt/php71/lib/php

 

I haven't tried that path with the command on CronJob.  So, I will try it and post back, should it do the trick.  I'm just not sure if that is the correct path to be using or not. 

 

If you have any further insight, please feel free to respond and Thank you again ever so much for at least pointing in the right direction!!  

 

Danny

 

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

Just adding that using the command  with:  /opt/php71/lib/php /home/my path/public_html/bin/magento indexer:reindex

 

I now get this email message:  

/bin/sh: /opt/php71/lib/php: is a directory

 

This would place me back at square one again.  

 

 

 

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

Finally!  After searching just a bit more, I replaced the first part of the Cron Job string with the following to point to the correct location of my php version:  /opt/php71/bin/php 

It finally worked!  I was only left with a 'Cache Management' message about an invalidated cache type, which was quickly resolved by doing a 'Refresh' on the affected Cache.

 

So, in order to save the next persons from having to spend way too much time trying to resolve this issue, here are the full steps that resolved my issue with not having SSH access and having to resort to Cron Jobs.  Many thanks to "ManthanDave" for pointing me in the right direction!!

 

1.  Follow the steps in this article to configure Magento Cron Jobs on Shared hosting accounts:  https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/magento1/optimi...

 

2.  Add this Cron Job command using the full path to your php (See steps below for how I found this) and replace the 'mypath' with the name of your home directory c-panel account:

 

/opt/php71/bin/php /home/pandasnpearls/public_html/bin/magento indexer:reindex

 

I set the interval for 15 minutes which was the same as the other Cron Jobs from the article.

 

PHP full path
You might wonder how I found the full path to PHP:

  1. In your CPanel File Manager, browse to your shops public folder
  2. In the root folder, where Magento's index.php file is, create a file called info.php
  3. Paste in this code:
<?php
phpinfo();
?>
  1. Save, and then open another browser tab and open the url to this file. Example something like www.your-shop-domain.com/shop/info.php
  2. Search for "php" on that page and you'll find the full path

That's it. Remember to delete the info.php file when get everything up and running. 

 

Hope this helps.  It would have been easier, I think to have SSH access to the Cpanel, but I had already invested so much time in this, I had to see it through for those that did not have it.  I will be speaking with my cpanel hosting provider about turning the SSH feature on, though, for future situations like this.  

 

Danny 

 

 

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

I try all these steps but i still got same error "One or more indexers are invalid. Make sure your Magento cron job is running".

magento-dashborad.pngcpanel-dashboard.png