How to Fix the "Syntax error or access violation: 1072 Key column 'customer_group_id' doesn't exist in table" issue?

How to Fix the "Syntax error or access violation: 1072 Key column 'customer_group_id' doesn't exist in table" issue?

The outlined error is related to the amasty_groupcat_rule_product table, which is used by the Customer Group Catalog extension and serves as an index table. Data gets written into it only after performing a full Magento reindex. However, some issues may occur when the structure of this table is corrupted or doesn’t match the extension’s expectations, for example, if the customer_group_id column is missing.

To fix the error, follow these steps:

Step 1. Create DB backups;

Step 2. Run the following SQL query:

DROP TABLE amasty_groupcat_rule_product

Step 3. Execute these commands, from your Magento root folder via CLI:

php bin/magento se:up && php bin/magento index:reindex 

The actual configuration and rules are stored in the amasty_groupcat_rule table, so you will not lose them. And the amasty_groupcat_rule_product table will automatically be recreated with the proper structure during setup:upgrade.

Should you have any questions or require assistance, reach out to our support team - we're happy to help.