When I enable the flat catalog in my Magento 2.2.5 installation, I get an error.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.name' in 'field list', query was: SELECT COUNT(report_table_views.event_id) AS `views`, `e`.*, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `e`.`name`, `e`.`short_description`, `e`.`price`, `e`.`special_price`, `e`.`special_from_date`, `e`.`special_to_date`, `e`.`weight`, `e`.`image`, `e`.`small_image`, `e`.`thumbnail`, `e`.`color`, `e`.`color_value`, `e`.`news_from_date`, `e`.`news_to_date`, `e`.`required_options`, `e`.`image_label`, `e`.`small_image_label`, `e`.`thumbnail_label`, `e`.`price_type`, `e`.`weight_type`, `e`.`price_view`, `e`.`msrp`, `e`.`msrp_display_actual_price_type`, `e`.`url_key`, `e`.`links_purchased_separately`, `e`.`links_exist`, `e`.`tax_class_id`, `e`.`swatch_image`, `e`.`list_price`, `e`.`supplier_code`, `e`.`apparel_size`, `e`.`apparel_size_value`, `e`.`apparel_occasion`, `e`.`apparel_occasion_value`, `e`.`apparel_style`, `e`.`apparel_style_value`, `e`.`apparel_gender`, `e`.`apparel_gender_value`, `e`.`material`, `e`.`material_value`, `e`.`exh_size`, `e`.`exh_size_value`, `e`.`exh_adapter`, `e`.`exh_adapter_value`, `e`.`karmak_pn`, `e`.`freight_free`, `e`.`free_shipping`, `e`.`backorder_shipping_message`, `e`.`brands`, `e`.`brands_value`, `cat_index`.`position` AS `cat_index_position`, `stock_status_index`.`stock_status` AS `is_salable` FROM `report_event` AS `report_table_views`
 INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = report_table_views.object_id
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
 INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(2, 4) AND cat_index.category_id='2'
 LEFT JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1 WHERE (report_table_views.event_type_id = 1) AND (logged_at >= '2018-08-13') AND (logged_at <= '2019-01-20') GROUP BY `e`.`entity_id` HAVING (COUNT(report_table_views.event_id) > 0) ORDER BY `views` DESC

It looks like Magento is trying to read from report_event table and other "report" tables which seems odd for catalog data.

Any ideas on why this error is happening? Do I need certain settings turned on for each attribute? Any help is appreciated, thank you!

Edit: I have tried php/bin magento indexer:reindex with no luck. I have also tried removing all extensions from the app/code/ directory and running the setup:upgrade, setup:di:compile, indexer:reindex, & cache:flush. No luck so far.


run command index for that, it will solve your case.

bin/magento indexer:reindex
  • I have tried that multiple times. Even running a setup:upgrade, setup:di:compile, indexer:reindex, cache:flush. No luck. – buttons99 Jan 21 at 3:35
  • forgot to tag you @theLight – buttons99 Jan 21 at 9:32

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.