cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to apply data patch Magento\Catalog\Setup\Patch\Data\UpdateMultiselectAttributesBackendTypes

Unable to apply data patch Magento\Catalog\Setup\Patch\Data\UpdateMultiselectAttributesBackendTypes

After Upgrading to Magento 2.4.6.-p1 , we are getting error on setup:upgrade

Unable to apply data patch Magento\Catalog\Setup\Patch\Data\UpdateMultiselectAttributesBackendTypes for module Magento_Catalog. Original exception message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '5566-200-0' for key 'MGCP_CATALOG_PRODUCT_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID', query was: INSERT INTO mgcp_catalog_product_entity_text (value_id,attribute_id,store_id,entity_id,value) VALUES.

 

Tried this  solution 

but it stucks on Magento_catalog in setup :upgrade

please help me about this.

3 REPLIES 3

Re: Unable to apply data patch Magento\Catalog\Setup\Patch\Data\UpdateMultiselectAttributesBackendTy

To resolve the error "Unable to apply data patch Magento\Catalog\Setup\Patch\Data\UpdateMultiselectAttributesBackendTypes,"

You can try the following steps:

1) Back up your Magento database.
2)Clear the generated and var directories.
3)Disable the Magento_Catalog module using the command: bin/magento            module:disable Magento_Catalog.
4)Run setup:upgrade without the Magento_Catalog module: bin/magento setup:upgrade --skip-module=Magento_Catalog.

If the issue will be resolved, Click Kudos & Accept as a Solution




Re: Unable to apply data patch Magento\Catalog\Setup\Patch\Data\UpdateMultiselectAttributesBackendTy

Re: Unable to apply data patch Magento\Catalog\Setup\Patch\Data\UpdateMultiselectAttributesBackendTy

  • The error indicates a data issue with the mgcp_catalog_product_entity_text table during upgrade.
  • Check for duplicate rows and remove them. Duplicates likely cause the key conflict.
  • Try the upgrade on a fresh database backup to isolate environment issues.
  • As a last resort, backup and truncate the table to clear invalid rows. This will lose existing text values.
  • Disable custom attribute modules to see if they interfere.
  • Open a support ticket with Magento if needed to further investigate the core issue.
  • Overall, troubleshoot to identify and fix the problematic data blocking the upgrade.