4

When i run command for indexing

php bin/magento indexer:info

Error was thrown

Class Magento\Indexer\Model\ResourceModel\Indexer\State\CollectionFactory does not exist

[Magento\Framework\Exception\LocalizedException] Can't create directory /var/www/html/var/generation/Magento/Indexer/Model/R
esourceModel/Indexer/State/.

I'm using magento 2.0.4, Linux server

2
  • 4
    give permissions to var /generation directory Dec 21, 2017 at 5:41
  • 1
    wow , thanks it works. sudo chmod -R 777 /var/www/html/var/generation/
    – Ganesh
    Dec 21, 2017 at 5:51

4 Answers 4

3
composer update and 

Please add permission.
1

My www.test.com website on Ubunto 16.04 and nginx in the admin page had an error

Class Magento\Indexer\Model\ResourceModel\Indexer\State\CollectionFactory does not exist

Turned out the folder /var/www/test.com/html/magento/generated/code/Magento/Indexer was owned by root and everything from there to /var/www/test.com/html/magento/generated/code/Magento/Indexer/Model/Indexer/CollectionFactory.php

fixed by changing owner to www-data like all the folders should have been:-

sudo chown -R www-data:www-data /var/www/test.com/html/magento/generated
1

In admin side I am getting

Class Magento\Indexer\Model\ResourceModel\Indexer\State\CollectionFactory does not exist

so I tried

sudo php chown -R www-data:www-data my_magento2_folder/*
1

This is a permission issue. Just give permissions to var /generation directory folders. sudo chmod -R 777 /var/www/html/var/generation/

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.