Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magento/module-catalog/Setup/Patch/Data/UpdateMultiselectAttributesBackendTypes.php breaks upgrade in migrated sites from 1.x #919

Open
1 of 5 tasks
engcom-Bravo opened this issue Oct 13, 2023 · 1 comment

Comments

@engcom-Bravo
Copy link

Preconditions and environment

  • 2.4.6-p2

Steps to reproduce

To replicate this you need

  1. Magento 2 (e.g. 2.4.1) that was migrated from 1.x and the 1.x instance had multiselect attributes with data (stored in _text table)
  2. Use data migration tool to transfer the data which will copy the values from _text table to _varchar table during migration
  3. Upgrade to 2.4.6-p2

The system will try to copy data from the _varchar table back to the _text table which was already migrated with the data migration tool to _text and to _varchar table. In the process you'll get this error about duplicate values

Expected result

Upgrade occurs properly

Actual result

Duplicated values throw exceptions

image

Additional information

There is only one real solution here, the patch needs to first clear the invalid data from _text table before migrating from _varchar to _text

e.g.

delete from catalog_product_entity_text where catalog_product_entity_text.attribute_id in (select eav_attribute.attribute_id from eav_attribute where eav_attribute.backend_type = 'varchar' and eav_attribute.entity_type_id = 4)

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Oct 13, 2023

Hi @engcom-Bravo. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant