0

I got Magento 2 issue. I can't open categories on frontend. I'm getting following error

{"0":"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'krono_mag.inventory_stock_1' doesn't exist, query was: INSERT INTO `search_tmp_5f22816c2c80b8_66493421` SELECT `main_select`.`entity_id`, SUM(score) AS `relevance` FROM (SELECT DISTINCT  `search_index`.`entity_id`, (((0) + (0)) * 1) AS `score` FROM `catalog_product_index_eav` AS `search_index`\n INNER JOIN `catalog_product_entity` AS `product` ON product.entity_id = search_index.entity_id\n INNER JOIN `inventory_stock_1` AS `stock_index` ON stock_index.sku = product.sku\n INNER JOIN `catalog_category_product_index_store1` AS `category_ids_index` ON search_index.entity_id = category_ids_index.product_id AND category_ids_index.store_id = '1' WHERE (search_index.store_id = '1') AND (`search_index`.`attribute_id` = 96 AND `search_index`.`value` in ('2', '4') AND `search_index`.`store_id` = '1') AND (category_ids_index.category_id = 4)) AS `main_select` GROUP BY `entity_id` ORDER BY `relevance` DESC, `entity_id` DESC\n LIMIT 10000","1":"#0 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/DB\/Statement\/Pdo\/Mysql.php(93): Zend_Db_Statement_Pdo->_execute(Array)\n#1 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/zendframework1\/library\/Zend\/Db\/Statement.php(303): Magento\\Framework\\DB\\Statement\\Pdo\\Mysql->_execute(Array)\n#2 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/zendframework1\/library\/Zend\/Db\/Adapter\/Abstract.php(480): Zend_Db_Statement->execute(Array)\n#3 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/zendframework1\/library\/Zend\/Db\/Adapter\/Pdo\/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `se...', Array)\n#4 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/DB\/Adapter\/Pdo\/Mysql.php(541): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `se...', Array)\n#5 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/DB\/Adapter\/Pdo\/Mysql.php(615): Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql->_query('INSERT INTO `se...', Array)\n#6 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Search\/Adapter\/Mysql\/TemporaryStorage.php(117): Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql->query('INSERT INTO `se...')\n#7 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Search\/Adapter\/Mysql\/Adapter.php(81): Magento\\Framework\\Search\\Adapter\\Mysql\\TemporaryStorage->storeDocumentsFromSelect(Object(Magento\\Framework\\DB\\Select))\n#8 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/module-search\/Model\/SearchEngine.php(42): Magento\\Framework\\Search\\Adapter\\Mysql\\Adapter->query(Object(Magento\\Framework\\Search\\Request))\n#9 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Search\/Search.php(72): Magento\\Search\\Model\\SearchEngine->search(Object(Magento\\Framework\\Search\\Request))\n#10 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/module-catalog-search\/Model\/ResourceModel\/Fulltext\/Collection.php(359): Magento\\Framework\\Search\\Search->search(Object(Magento\\Framework\\Api\\Search\\SearchCriteria))\n#11 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Data\/Collection\/AbstractDb.php(342): Magento\\CatalogSearch\\Model\\ResourceModel\\Fulltext\\Collection->_renderFiltersBefore()\n#12 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/module-catalog-search\/Model\/ResourceModel\/Fulltext\/Collection.php(410): Magento\\Framework\\Data\\Collection\\AbstractDb->_renderFilters()\n#13 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/module-eav\/Model\/Entity\/Collection\/AbstractCollection.php(920): Magento\\CatalogSearch\\Model\\ResourceModel\\Fulltext\\Collection->_renderFilters()\n#14 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/module-catalog\/Model\/ResourceModel\/Product\/Collection.php(790): Magento\\Eav\\Model\\Entity\\Collection\\AbstractCollection->load(false, false)\n#15 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection->load(false, false)\n#16 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\CatalogSearch\\Model\\ResourceModel\\Fulltext\\Collection\\Interceptor->___callParent('load', Array)\n#17 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\CatalogSearch\\Model\\ResourceModel\\Fulltext\\Collection\\Interceptor->Magento\\Framework\\Interception\\{closure}()\n#18 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/generated\/code\/Magento\/CatalogSearch\/Model\/ResourceModel\/Fulltext\/Collection\/Interceptor.php(26): Magento\\CatalogSearch\\Model\\ResourceModel\\Fulltext\\Collection\\Interceptor->___callPlugins('load', Array, Array)\n#19 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/module-review\/Observer\/CatalogBlockProductCollectionBeforeToHtmlObserver.php(38): Magento\\CatalogSearch\\Model\\ResourceModel\\Fulltext\\Collection\\Interceptor->load()\n#20 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Event\/Invoker\/InvokerDefault.php(72): Magento\\Review\\Observer\\CatalogBlockProductCollectionBeforeToHtmlObserver->execute(Object(Magento\\Framework\\Event\\Observer))\n#21 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Event\/Invoker\/InvokerDefault.php(60): Magento\\Framework\\Event\\Invoker\\InvokerDefault->_callObserverMethod(Object(Magento\\Review\\Observer\\CatalogBlockProductCollectionBeforeToHtmlObserver), Object(Magento\\Framework\\Event\\Observer))\n#22 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Event\/Manager.php(66): Magento\\Framework\\Event\\Invoker\\InvokerDefault->dispatch(Array, Object(Magento\\Framework\\Event\\Observer))\n#23 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/generated\/code\/Magento\/Framework\/Event\/Manager\/Proxy.php(95): Magento\\Framework\\Event\\Manager->dispatch('catalog_block_p...', Array)\n#24 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/module-catalog\/Block\/Product\/ListProduct.php(471): Magento\\Framework\\Event\\Manager\\Proxy->dispatch('catalog_block_p...', Array)\n#25 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/module-catalog\/Block\/Product\/ListProduct.php(116): Magento\\Catalog\\Block\\Product\\ListProduct->initializeProductCollection()\n#26 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/module-catalog\/Block\/Product\/ListProduct.php(348): Magento\\Catalog\\Block\\Product\\ListProduct->_getProductCollection()\n#27 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/module-page-cache\/Model\/Layout\/LayoutPlugin.php(71): Magento\\Catalog\\Block\\Product\\ListProduct->getIdentities()\n#28 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Interception\/Interceptor.php(146): Magento\\PageCache\\Model\\Layout\\LayoutPlugin->afterGetOutput(Object(Magento\\Framework\\View\\Layout\\Interceptor), '<script>\\n    va...')\n#29 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Framework\\View\\Layout\\Interceptor->Magento\\Framework\\Interception\\{closure}()\n#30 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/generated\/code\/Magento\/Framework\/View\/Layout\/Interceptor.php(494): Magento\\Framework\\View\\Layout\\Interceptor->___callPlugins('getOutput', Array, Array)\n#31 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/View\/Result\/Page.php(258): Magento\\Framework\\View\\Layout\\Interceptor->getOutput()\n#32 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/View\/Result\/Layout.php(171): Magento\\Framework\\View\\Result\\Page->render(Object(Magento\\Framework\\App\\Response\\Http\\Interceptor))\n#33 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Framework\\View\\Result\\Layout->renderResult(Object(Magento\\Framework\\App\\Response\\Http\\Interceptor))\n#34 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Framework\\View\\Result\\Page\\Interceptor->___callParent('renderResult', Array)\n#35 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Framework\\View\\Result\\Page\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Response\\Http\\Interceptor))\n#36 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/generated\/code\/Magento\/Framework\/View\/Result\/Page\/Interceptor.php(130): Magento\\Framework\\View\\Result\\Page\\Interceptor->___callPlugins('renderResult', Array, Array)\n#37 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/App\/Http.php(139): Magento\\Framework\\View\\Result\\Page\\Interceptor->renderResult(Object(Magento\\Framework\\App\\Response\\Http\\Interceptor))\n#38 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/generated\/code\/Magento\/Framework\/App\/Http\/Interceptor.php(24): Magento\\Framework\\App\\Http->launch()\n#39 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/vendor\/magento\/framework\/App\/Bootstrap.php(258): Magento\\Framework\\App\\Http\\Interceptor->launch()\n#40 \/var\/www\/povolotskiy2\/data\/www\/kronoplast.ua\/index.php(43): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#41 {main}","url":"\/corrugated-pipe-4.html","script_name":"\/index.php"}
3
0

first check if msi is enabled on your magento 2 version checking app/etc/config.php. All modules listed in config.php called Inventory_ecc should be at 1 according to the error you have. If so, then you have to regenerate the view inventory and to do it it is "simple".

Test it not in production please Steps:

  • Go into database and delete this entry from table 'patch_list' -> 'Magento\InventoryCatalog\Setup\Patch\Schema\CreateLegacyStockStatusView'

  • Run bin/magento setup:upgrade

Cheers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.