when I update Magento from 2.3 to 2.4.1, I can't save the old Configurable Products, it said that error "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 2, query was: SELECT main_table.*, cp_table.type_id FROM cataloginventory_stock_item AS main_table INNER JOIN catalog_product_entity AS cp_table ON main_table.product_id = cp_table.entity_id WHERE (main_table.website_id = '0') AND (main_table.product_id IN())",

but when create a new Configurable Products, it still works perfect.

enter image description here

Do anyone have same problem, please help. Thanks.

  • Did you fix the error?
    – Kiwop
    Sep 16, 2021 at 18:42

1 Answer 1


This looks like an issue caused by a 3rd party extension. How do I know this? Because the 'Magento style' aliases to tables are formatted by using the first char of the table name parts, so basically catalog_product_entity would be cpe and not cp.

I suggest you either disable the 3rd party modules and enable them back one by one to see which causes the problem OR install xdebug and debug the admin page to see where it gets stuck. However, depending on how your log settings, you might already have the error stack trace in the log files, so take a look there too.

Cheers and good luck!

  • Thank for your answer, I will try your suggest, hope I can find the problem soon. Have a nice day! Apr 20, 2021 at 8:18
  • I am facing the same error as above. I have checked the Magento core code, and they are using cp_table for catalog_product_entity in Magento/module-catalog-inventory So, it's from core Magento and not from any 3rd party module. Specially this two files vendor/magento/module-catalog-inventory/Model/ResourceModel/Stock/Item/StockItemCriteriaMapper.php and vendor/magento/module-catalog-inventory/Model/ResourceModel/Stock/Status/StockStatusCriteriaMapper.php @chinhnguyen let me know if you are able to find any solution for this. May 19, 2022 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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