Smile-SA / elasticsuite

Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
https://elasticsuite.io
Open Software License 3.0
761 stars 341 forks source link

Exception: catalog_product index does not exist yet. #173

Closed diybook closed 8 years ago

diybook commented 8 years ago

Hi Romain, thanks for introducing elasticsearch to me in the post https://github.com/magento/magento2/issues/7027. I think the elasticsuite is really greath and wanted to try it myself.

I´ve installed the ElasticSearch server as well as the magento module but getting the following errors on the frontend.

`1 exception(s): Exception #0 (LogicException): catalog_product index does not exist yet. Make sure everything is reindexed

Exception #0 (LogicException): catalog_product index does not exist yet. Make sure everything is reindexed

0 /var/www/diyparts.staging/diyparts_dev/vendor/smile/elasticsuite/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php(166): Smile\ElasticsuiteCore\Index\IndexOperation->getIndexByName('catalog_product', Object(Magento\Store\Model\Store\Interceptor))

1 /var/www/diyparts.staging/diyparts_dev/vendor/smile/elasticsuite/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php(108): Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\AttributeList->getMapping()

2 /var/www/diyparts.staging/diyparts_dev/vendor/smile/elasticsuite/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product.php(77): Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product`

Reindexing does not help, so I've no clue how to further go on. Maybe you know what to do. Installed Magento version: 2.1.0 using Elasticsuite version 2.2.0

I've updated to Magento version: 2.1.1 using Elasticsuite version 2.2.2 showing the same error.

romainruaud commented 8 years ago

hello @diybook and thank you for trying our module.

Did you run the setup:upgrade after adding the module to Magento ?

diybook commented 8 years ago

Yes I did. Initially I had troubles installing the plugins for the elasticuite server, and therefore get error messages. After successful install of the plugins no error occured, but maybe the db is messed up with something.

romainruaud commented 8 years ago

maybe you could give a try to removing Smile_* entries from the setup_module then process again a setup:upgrade. Or now that you have everything running fines regarding ES plugins, try a reinstall from scratch.

Regards.

diybook commented 8 years ago

unfortunately it's not working. I've installed the magento module on a new dump of the production setup. (clean db, and files) But the same error is occuring.

Do you have any other ideas?

afoucret commented 8 years ago

What about reindexinng did you run bin/magento index:reindex as explained into the doc. if so, no errors ?

Did you check ES server install requirement is OK as explained into : https://github.com/Smile-SA/elasticsuite/wiki/ServerConfig ?

diybook commented 8 years ago

Yes, reindexing runs without any trouble and without error messages.

ES install should be ok. Server is up and running. But ES Server Version is 2.4.1. Maybe that this is a problem because install documentation shows version 2.2.0. I've installed JDK 1.8 as recommended.

curl localhost:9200 shows: { "name" : "Shanna the She-Devil", "cluster_name" : "elasticsearch", "cluster_uuid" : "noY0LiV_SD20xL2YYy9wkA", "version" : { "number" : "2.4.1", "build_hash" : "c67dc32e24162035d18d6fe1e952c4cbcbe79d16", "build_timestamp" : "2016-09-27T18:57:55Z", "build_snapshot" : false, "lucene_version" : "5.5.2" }, "tagline" : "You Know, for Search" }

afoucret commented 8 years ago

Did you install the plugins (icu and phonetic) and did you restart the ES server after the install ? Then reindex and it should run.

diybook commented 8 years ago

Yes I did this too. Initially I had problems installing the plugins, but in the end it worked. I've restarted the ES beacause otherwise reindexing did not work. But reindexing do not show any error.

afoucret commented 8 years ago

Hi @diybook,

I try to uninstall the phonetic plugin on my own environment to see own the error is reported, and I am able to see the following error :

Catalog Search indexer process unknown error:
index_creation_exception: failed to create index

And I get the following error in my ES logs located into /var/log/elasticsearch/ :

[2016-10-20 11:45:02,762][WARN ][cluster.action.shard     ] [Raymond Sikorsky] [magento2_default_catalog_category_20161017_131650][9] received shard failed for target shard [[magento2_default_catalog_category_20161017_131650][9], node[O3fNYMoIRUae8zvwYSHowQ], [P], v[3], s[INITIALIZING], a[id=VqWN--7lRk6TtYFZxtF1WQ], unassigned_info[[reason=ALLOCATION_FAILED], at[2016-10-20T09:45:02.666Z], details[failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Unknown TokenFilter type [phonetic] for [phonetic]]; ]]], indexUUID [CqVnvghoQ8iXXkEvO1MAKA], message [failed to create index], failure [IndexCreationException[failed to create index]; nested: IllegalArgumentException[Unknown TokenFilter type [phonetic] for [phonetic]]; ]

Tips : enabling debug log of ElasticSuite in the module configuration allow to have the ES error the Magento logs.

I think that your PHP environment is configured to not display errors even in CLI mode.

diybook commented 8 years ago

Hi I gave it another try. What I found out is that the server is running and working as intended. Plugins are installed and working. Reindexing do not show any error.

But the systemlog of magento shows the following error: [2016-10-22 19:42:25] main.WARNING: Request Failure: {"method":"HEAD","uri":"http://localhost:9200/magento2_repariersdoch_at_catalog_product","headers":{"host":["localhost:9200"]},"HTTP code":404,"duration":0.003469,"error":""} [] [2016-10-22 19:42:25] main.WARNING: Response [null] []

I have no idea why the requestet index is not generated. The elasticsearch log shows the folloging lines:

[2016-10-22 21:17:03,013][INFO ][cluster.routing.allocation] [Ultimo] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[magento2_default_at_catalog_category_20161018_120745][0]] ...]). [2016-10-22 21:46:52,531][INFO ][cluster.metadata ] [Ultimo] [magento2_repariersdoch_at_catalog_category_20161022_194652] creating index, cause [api], templates [], shards [1]/[0], mappings [category] [2016-10-22 21:46:52,788][INFO ][cluster.routing.allocation] [Ultimo] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[magento2_repariersdoch_at_catalog_category_20161022_194652][0]] ...]). [2016-10-22 21:46:55,633][INFO ][cluster.metadata ] [Ultimo] updating number_of_replicas to [0] for indices [magento2_repariersdoch_at_catalog_category_20161022_194652] [2016-10-22 21:46:55,643][INFO ][index.shard ] [Ultimo] [magento2_repariersdoch_at_catalog_category_20161022_194652][0] updating refresh_interval from [10s] to [1s] [2016-10-22 21:46:55,778][INFO ][cluster.metadata ] [Ultimo] [magento2_repariersdoch_de_catalog_category_20161022_194655] creating index, cause [api], templates [], shards [1]/[0], mappings [category] [2016-10-22 21:46:55,901][INFO ][cluster.routing.allocation] [Ultimo] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[magento2_repariersdoch_de_catalog_category_20161022_194655][0]] ...]). [2016-10-22 21:46:56,875][INFO ][cluster.metadata ] [Ultimo] updating number_of_replicas to [0] for indices [magento2_repariersdoch_de_catalog_category_20161022_194655] [2016-10-22 21:46:56,877][INFO ][index.shard ] [Ultimo] [magento2_repariersdoch_de_catalog_category_20161022_194655][0] updating refresh_interval from [10s] to [1s] [2016-10-22 21:46:56,972][INFO ][cluster.metadata ] [Ultimo] [magento2_diyparts_at_catalog_category_20161022_194656] creating index, cause [api], templates [], shards [1]/[0], mappings [category] [2016-10-22 21:46:57,073][INFO ][cluster.routing.allocation] [Ultimo] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[magento2_diyparts_at_catalog_category_20161022_194656][0]] ...]). [2016-10-22 21:46:57,130][INFO ][cluster.metadata ] [Ultimo] updating number_of_replicas to [0] for indices [magento2_diyparts_at_catalog_category_20161022_194656] [2016-10-22 21:46:57,134][INFO ][index.shard ] [Ultimo] [magento2_diyparts_at_catalog_category_20161022_194656][0] updating refresh_interval from [10s] to [1s] [2016-10-22 21:46:57,213][INFO ][cluster.metadata ] [Ultimo] [magento2_default_ch_catalog_category_20161022_194657] creating index, cause [api], templates [], shards [1]/[0], mappings [category] [2016-10-22 21:46:57,297][INFO ][cluster.routing.allocation] [Ultimo] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[magento2_default_ch_catalog_category_20161022_194657][0]] ...]). [2016-10-22 21:46:57,351][INFO ][cluster.metadata ] [Ultimo] updating number_of_replicas to [0] for indices [magento2_default_ch_catalog_category_20161022_194657] [2016-10-22 21:46:57,353][INFO ][index.shard ] [Ultimo] [magento2_default_ch_catalog_category_20161022_194657][0] updating refresh_interval from [10s] to [1s] [2016-10-22 21:46:57,431][INFO ][cluster.metadata ] [Ultimo] [magento2_repariersdoch_at_thesaurus_20161022_194657] creating index, cause [api], templates [], shards [1]/[0], mappings [] [2016-10-22 21:46:57,562][INFO ][cluster.routing.allocation] [Ultimo] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[magento2_repariersdoch_at_thesaurus_20161022_194657][0]] ...]). [2016-10-22 21:46:57,597][INFO ][cluster.metadata ] [Ultimo] [magento2_repariersdoch_de_thesaurus_20161022_194657] creating index, cause [api], templates [], shards [1]/[0], mappings [] [2016-10-22 21:46:57,654][INFO ][cluster.routing.allocation] [Ultimo] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[magento2_repariersdoch_de_thesaurus_20161022_194657][0]] ...]). [2016-10-22 21:46:57,689][INFO ][cluster.metadata ] [Ultimo] [magento2_diyparts_at_thesaurus_20161022_194657] creating index, cause [api], templates [], shards [1]/[0], mappings [] [2016-10-22 21:46:57,739][INFO ][cluster.routing.allocation] [Ultimo] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[magento2_diyparts_at_thesaurus_20161022_194657][0]] ...]). [2016-10-22 21:46:57,780][INFO ][cluster.metadata ] [Ultimo] [magento2_default_ch_thesaurus_20161022_194657] creating index, cause [api], templates [], shards [1]/[0], mappings [] [2016-10-22 21:46:57,832][INFO ][cluster.routing.allocation] [Ultimo] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[magento2_default_ch_thesaurus_20161022_194657][0]] ...]).

No indexes for catalog_product are generated. But why? There are 5 products in the database? Any Ideas? Maybe there is something wrong with the database.

The default main category is empty because we use another main category for the configured shops. But the configuration is ok, because magento is working correct in this setup. How can I find out why the catalog_product index is not there?

Best regards, Gerald

diybook commented 8 years ago

To close this issue some update: Installation worked on a new Magento installation. I'm not sure what was wrong but definitly something was wrong with the magento-db. Best regards, and thanks for your help.

cizgidekiadam commented 7 years ago

Same issue in Magento 2.1.2 with 5-6 catalog rules. All indexes are fine except catalog rule product and catalog product rule.

There is about 1 million single (both configurable and children) products so catalog rule indexers takes too long.

Why should we wait to complete all indexers to be completed ?

blewinsky commented 7 years ago

I've got that issue too and discovered that this functions doesnt index data for admin area (Store 0): Magento\CatalogSearch\Model\Indexer\Fulltext::executeFull() Smile\ElasticsuiteCatalog\Model\Category\Indexer\Fulltext::executeFull()

For the test when i added $storeIds[] = 0; after this assigment $storeIds = array_keys($this->storeManager->getStores()); in both functions and reindexed again the warning was disappeared.

Magento ver. 2.1.2 smile/elasticsuite 2.3.2

ericrisler commented 7 years ago

Perhaps helpful: if you do not change the search engine setting in Stores > Configuration > Catalog > Catalog Search then the catalog_product index will not be generated in ElasticSearch.

truelogicapp commented 6 years ago

catalog_product index does not exist yet. Make sure everything is reindexed

a:4:{i:0;s:75:"catalog_product index does not exist yet. Make sure everything is reindexed";i:1;s:8304:"#0 /Applications/AMPPS/www/testsssports/app/code/Smile/ElasticsuiteCore/Search/Request/ContainerConfiguration.php(161): Smile\ElasticsuiteCore\Index\IndexOperation->getIndexByName('catalog_product', 1)

1 /Applications/AMPPS/www/testsssports/app/code/Smile/ElasticsuiteCore/Search/Request/ContainerConfiguration.php(94): Smile\ElasticsuiteCore\Search\Request\ContainerConfiguration->getIndex()

2 /Applications/AMPPS/www/testsssports/app/code/Smile/ElasticsuiteCore/Search/Request/Builder.php(150): Smile\ElasticsuiteCore\Search\Request\ContainerConfiguration->getIndexName()

3 /Applications/AMPPS/www/testsssports/app/code/Smile/ElasticsuiteCatalog/Model/ResourceModel/Product/Fulltext/Collection.php(583): Smile\ElasticsuiteCore\Search\Request\Builder->create(1, 'catalog_view_co...', 0, 0, NULL, Array, Array, Array, Array)

4 /Applications/AMPPS/www/testsssports/app/code/Smile/ElasticsuiteCatalog/Model/ResourceModel/Product/Fulltext/Collection.php(189): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection->loadProductCounts()

5 /Applications/AMPPS/www/testsssports/var/generation/Smile/ElasticsuiteCatalog/Model/ResourceModel/Product/Fulltext/Collection/Interceptor.php(24): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection->getSize()

6 /Applications/AMPPS/www/testsssports/vendor/magento/framework/Data/Collection.php(259): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection\Interceptor->getSize()

7 /Applications/AMPPS/www/testsssports/var/generation/Smile/ElasticsuiteCatalog/Model/ResourceModel/Product/Fulltext/Collection/Interceptor.php(1610): Magento\Framework\Data\Collection->getLastPageNumber()

8 /Applications/AMPPS/www/testsssports/vendor/magento/framework/Data/Collection.php(245): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection\Interceptor->getLastPageNumber()

9 /Applications/AMPPS/www/testsssports/var/generation/Smile/ElasticsuiteCatalog/Model/ResourceModel/Product/Fulltext/Collection/Interceptor.php(1597): Magento\Framework\Data\Collection->getCurPage(0)

10 /Applications/AMPPS/www/testsssports/app/code/Smile/ElasticsuiteCatalog/Model/ResourceModel/Product/Fulltext/Collection.php(484): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection\Interceptor->getCurPage()

11 /Applications/AMPPS/www/testsssports/app/code/Smile/ElasticsuiteCatalog/Model/ResourceModel/Product/Fulltext/Collection.php(393): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection->prepareRequest()

12 /Applications/AMPPS/www/testsssports/vendor/magento/framework/Data/Collection/AbstractDb.php(338): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection->_renderFiltersBefore()

13 /Applications/AMPPS/www/testsssports/app/code/Smile/ElasticsuiteCatalog/Model/ResourceModel/Product/Fulltext/Collection.php(430): Magento\Framework\Data\Collection\AbstractDb->_renderFilters()

14 /Applications/AMPPS/www/testsssports/vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php(906): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection->_renderFilters()

15 /Applications/AMPPS/www/testsssports/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php(727): Magento\Eav\Model\Entity\Collection\AbstractCollection->load(false, false)

16 /Applications/AMPPS/www/testsssports/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Catalog\Model\ResourceModel\Product\Collection->load(false, false)

17 /Applications/AMPPS/www/testsssports/var/generation/Smile/ElasticsuiteCatalog/Model/ResourceModel/Product/Fulltext/Collection/Interceptor.php(377): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection\Interceptor->___callPlugins('load', Array, Array)

18 /Applications/AMPPS/www/testsssports/vendor/magento/framework/Data/Collection.php(820): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection\Interceptor->load()

19 /Applications/AMPPS/www/testsssports/var/generation/Smile/ElasticsuiteCatalog/Model/ResourceModel/Product/Fulltext/Collection/Interceptor.php(1844): Magento\Framework\Data\Collection->getIterator()

20 /Applications/AMPPS/www/testsssports/vendor/magento/module-catalog/Block/Product/ListProduct.php(321): Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection\Interceptor->getIterator()

21 /Applications/AMPPS/www/testsssports/var/generation/Magento/Catalog/Block/Product/ListProduct/Interceptor.php(154): Magento\Catalog\Block\Product\ListProduct->getIdentities()

22 /Applications/AMPPS/www/testsssports/vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php(71): Magento\Catalog\Block\Product\ListProduct\Interceptor->getIdentities()

23 /Applications/AMPPS/www/testsssports/vendor/magento/framework/Interception/Interceptor.php(152): Magento\PageCache\Model\Layout\LayoutPlugin->afterGetOutput(Object(Magento\Framework\View\Layout\Interceptor), ' Githubissues.
  • Githubissues is a development platform for aggregating issues.