1

Below error appears on api call ,

[2020-06-18 07:57:42] main.CRITICAL: Report ID: webapi-5eeb1e76e4607; Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.catalog_category_product_index_store0' doesn't exist, query was: SELECT `main_table`.* FROM `wishlist_item` AS `main_table`

Any idea how to solve it ?

0

Try to disable magento Catalog Flat for Category from Admin>Store>Catalog>Catalog>Use Flat Catalog Category make it NO.

enter image description here

2
  • Thankyou for your response , let me check , – devmage Jun 18 '20 at 8:43
  • its already set to no – devmage Jun 18 '20 at 9:17
0

The database catalog_category_product_index_store0 table does not create that why you getting error. This table is created when indexing for Category Product will run properly . Might be in your system Indexing Category Product is not working. So, you have to do indexing again .

4
  • i've done reindexing amit sir , still i am facing this error. – devmage Jun 18 '20 at 10:57
  • can you please help me out here to , how do i solve it ? – devmage Jun 18 '20 at 10:59
  • i have also added a seperate question & code here - magento.stackexchange.com/questions/315375/… – devmage Jun 18 '20 at 11:01
  • Any thoughts on this ? ? – devmage Jun 18 '20 at 11:38
0

Same issue here: Want to get all categories by REST API Magento 2.4.1

missing table catalog_category_product_index_store0

when I check the database I find a table called catalog_category_product_index_store1

when I call

GET https://dev.puresportsstyles.com/rest/all/V1/categories/

I get the error: {"message":"Internal Error. Details are available in Magento log file. Report ID: webapi-5fbbd8e7e2f81"}

In Exception Log: Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mag2ma1h_shop2.catalog_category_product_index_store0' doesn't exist, query was: SELECT cat_index.category_id, count(cat_index.product_id) AS count FROM catalog_category_product_index_store0 AS cat_index WHERE (cat_index.category_id in (2, 3, 4, 5, 6)) GROUP BY cat_index.category_id {"exception":"[object] (Exception(code: 1146): Report ID: webapi-5fbbd8e7e2f81; Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mag2ma1h_shop2.catalog_category_product_index_store0' doesn't exist, query was: SELECT cat_index.category_id, count(cat_index.product_id) AS count FROM catalog_category_product_index_store0 AS cat_index WHERE (cat_index.category_id in (2, 3, 4, 5, 6)) GROUP BY cat_index.category_id at /home/mag2ma1h/public_html/shop/magento-2_4_1/vendor/magento/framework/Webapi/ErrorProcessor.php:208

how can I change catalog_category_product_index_store1 to catalog_category_product_index_store0

i´m afraid just changing the name in the DB will break the site

many thanks for your help

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.