I recently found the following error in Magento2 log.

Reading the query is missing there's an error in where condition --> WHERE (())

How I can debug?

Tryed a crude "grep" in my filesystem but I found nothing.

[2019-08-01 12:59:47] main.CRITICAL: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AND (IF(at_include_in_menu.value_id > 0, at_include_in_menu.value, at_include' at line 5, query was: SELECT `e`.*, IF(at_include_in_menu.value_id > 0, at_include_in_menu.value, at_include_in_menu_default.value) AS `include_in_menu`, IF(at_is_active.value_id > 0, at_is_active.value, at_is_active_default.value) AS `is_active` FROM `catalog_category_entity` AS `e`
 INNER JOIN `catalog_category_entity_int` AS `at_include_in_menu_default` ON (`at_include_in_menu_default`.`entity_id` = `e`.`entity_id`) AND (`at_include_in_menu_default`.`attribute_id` = '67') AND `at_include_in_menu_default`.`store_id` = 0
 LEFT JOIN `catalog_category_entity_int` AS `at_include_in_menu` ON (`at_include_in_menu`.`entity_id` = `e`.`entity_id`) AND (`at_include_in_menu`.`attribute_id` = '67') AND (`at_include_in_menu`.`store_id` = 1)
 INNER JOIN `catalog_category_entity_int` AS `at_is_active_default` ON (`at_is_active_default`.`entity_id` = `e`.`entity_id`) AND (`at_is_active_default`.`attribute_id` = '42') AND `at_is_active_default`.`store_id` = 0
 LEFT JOIN `catalog_category_entity_int` AS `at_is_active` ON (`at_is_active`.`entity_id` = `e`.`entity_id`) AND (`at_is_active`.`attribute_id` = '42') AND (`at_is_active`.`store_id` = 1) WHERE (()) AND (IF(at_include_in_menu.value_id > 0, at_include_in_menu.value, at_include_in_menu_default.value) = 1) AND (IF(at_is_active.value_id > 0, at_is_active.value, at_is_active_default.value) = '1')
  • This is M2 for sure? I can't find at_include_in_menu in code. – danronmoon Aug 1 at 19:39
  • Not sure, maybe a plugin (megamenu?) but i can't find anything in the code. The only result of a grep for "at_include_in_menu" is the log file – domfitty Aug 2 at 5:56
  • Just to clarify: you're not sure if it's Magento2 or Magento1? at_include_in_menu in all searches online lead me to believe it's Magento1 you're dealing with. – danronmoon Aug 4 at 14:33
  • Sure, Magento 2.3.1 – domfitty Aug 4 at 18:14

Your Answer

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

Browse other questions tagged or ask your own question.