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

Fixed Unable to apply data patch issue after upgrade in 2.4 #29365 #29804

Merged

Conversation

ravi-chandra3197
Copy link
Contributor

@ravi-chandra3197 ravi-chandra3197 commented Aug 29, 2020

Description (*)

Fixed Unable to apply data patch issue #29365

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Magento 2.4 Upgrade issue Unable to apply data patch Magento\CatalogUrlRewrite\Setup\Patch\Data\UpdateUrlKeyForProducts #29365
  2. Fixes Magento 2.4 upgrade fails if there is data under catalog_product_entity_varchar #29805

Manual testing scenarios (*)

  1. Composer upgrade from 2.3.5-p1 to 2.4.0
  2. php bin/magento setup:upgrade

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Aug 29, 2020

Hi @ravi-chandra3197. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@ravi-chandra3197
Copy link
Contributor Author

@magento run all tests

@ravi-chandra3197 ravi-chandra3197 changed the title Fixed Unable to apply data patch issue #29365 Fixed Unable to apply data patch issue after upgrade in 2.4 #29365 Aug 29, 2020
@ihor-sviziev ihor-sviziev added the Severity: S1 Affects critical data or functionality and forces users to employ a workaround. label Aug 31, 2020
@ihor-sviziev ihor-sviziev self-assigned this Aug 31, 2020
@VladimirZaets
Copy link
Contributor

@magento I am working on it

@sidolov sidolov added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Aug 31, 2020
@ihor-sviziev
Copy link
Contributor

@magento run all tests

@ihor-sviziev ihor-sviziev added Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Award: bug fix labels Sep 5, 2020
ihor-sviziev
ihor-sviziev previously approved these changes Sep 6, 2020
@ghost ghost removed the Progress: review label Sep 6, 2020
@ihor-sviziev
Copy link
Contributor

From Slack with @engcom-Alfa - he was able to reproduce this issue locally, but unfortunately, he didn't find exact steps to reproduce it.
@engcom-Alfa do you have any updates about that?

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Manual testing scenario:

  1. Create several store views - en & de & fr;
  2. Enable showing store code in the URL
  3. Configure different URL keys for categories and for products for the DE & EN & FR versions;
  4. Also were added different product attributes and other different combinations
    As result, we had several records by request:
mysql> SELECT COUNT(*)
    -> FROM catalog_product_entity_varchar cpev
    -> LEFT JOIN catalog_product_entity cpe on cpev.entity_id = cpe.entity_id
    -> WHERE cpe.entity_id IS NULL;

image

  1. Try to upgrade;

Before: ❌ Upgrade Fail with the following error:

Unable to apply data patch Magento\CatalogUrlRewrite\Setup\Patch\Data\UpdateUrlKeyForProducts for module Magento_CatalogUrlRewrite. Original exception message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (magento24.catalog_product_entity_varchar, CONSTRAINT CAT_PRD_ENTT_VCHR_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (entity_id) REFERENCES catalog_product_entity (entity_id) ON DELETE), query was: INSERT  INTO catalog_product_entity_varchar (value_id,value) VALUES (?, ?), (?, ?),....(?, ?) ON DUPLICATE KEY UPDATE value = VALUES(value)

After: ✔️ Upgrade finished successfully.

Also was tested general functionality and everything works as previously (expected)

@m2-assistant
Copy link

m2-assistant bot commented Feb 5, 2021

Hi @ravi-chandra3197, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Component: CatalogUrlRewrite Partner: Krish TechnoLabs partners-contribution Pull Request is created by Magento Partner Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
None yet
8 participants