3

I installed Magento but in admin panel it is giving system message as:

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

If I am adding categories or products from admin panel It shows no effect on front-end and not even menu and categories are displayed.

Abhishek Tripathi
  • 2,885
  • 2
  • 18
  • 37
Sanjay
  • 31
  • 1
  • 2
  • You should reindex manually when you update product data, but you won't be able to run the cron on windows – scrowler Dec 24 '15 at 05:52
  • I do not recommend use Magento direct on Windows. Please use virtualization to install on supported os. – KAndy Dec 24 '15 at 07:47
  • @Sanjay As KAndy mentioned, Windows is not officially tested and supported platform for Magento 2. Take a look at vagrant project optimized for Magento 2 development on Windows. – Alex Paliarush Dec 24 '15 at 09:24

6 Answers6

2

You have to run indexing command. if you are using windows than run below command in cmd. you have to run these commands in your magento root directory:

php bin/magento indexer:reindex
php bin/magento cache:clean

NOTE: If you have just installed magento than you might need to run below commands as well:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean
Chintan Kaneriya
  • 657
  • 1
  • 11
  • 30
2

You must configure a cron.job in your server to automate a some internal tasks like reindexing, email sending and cleaning between others, there is 3 cron jobs in magento2 you will find all information about that in:

Configure and run cron

Magento has a complex db schema to save categories and products data and "render" all these information to a single table per store if you have configured use flat categories and/or use flat catalog to grant performance on the frontend. This would be the reason why you don't see categories on frontend.

Remember always clean/flush cache too

MauroNigrele
  • 3,005
  • 1
  • 18
  • 28
2

You can create cron.bat file like this

@echo off
cls
:start
echo This is a loop
cd %magento_root%
bin/magento cron:run
sleep 10
goto start

to emulate cron.

KAndy
  • 20,811
  • 3
  • 49
  • 59
2

reindex magento2 using command

Your path like

var\www\html\magento2\bin

Now You have to enter command

sudo php magento indexer:reindex

Show your index management all indexes are re-indexed.

I hope this will help you.

Denish Vachhani
  • 4,562
  • 3
  • 16
  • 47
2

you have issue of indexing. You can indexing using cli, Commnad php magento indexer:reindex

After successfully run indexing , your issue are gone.

Thanks.

Rakesh Jesadiya
  • 42,221
  • 18
  • 132
  • 183
0

As others have pointed out if indexer is stuck you'll have to change it manually in db,

UPDATE indexer_state SET status = 'valid';

https://magento.stackexchange.com/a/126102/45516

Hope this helps,

Monty
  • 51
  • 6