|
| 1 | +--- |
| 2 | +title: 'ACSD-68064: Duplicate entries created during scheduled updates in environments with deeply nested categories' |
| 3 | +description: Apply the ACSD-68064 patch to fix the Adobe Commerce issue where creating scheduled updates in environments with a high number of nested categories results in duplicate entries and prevents category saving. |
| 4 | +feature: Catalog Management |
| 5 | +role: Admin, Developer |
| 6 | +type: Troubleshooting |
| 7 | +--- |
| 8 | + |
| 9 | +# ACSD-68064: Duplicate entries created during scheduled updates in environments with deeply nested categories |
| 10 | + |
| 11 | +The ACSD-68064 patch fixes the issue where creating scheduled updates in environments with a high number of nested categories results in duplicate entries and prevents category saving. This patch is available when the [[!DNL Quality Patches Tool (QPT)]](/help/tools/quality-patches-tool/quality-patches-tool-to-self-serve-quality-patches.md) 1.1.72 is installed. The patch ID is ACSD-68064. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.9. |
| 12 | + |
| 13 | +## Affected products and versions |
| 14 | + |
| 15 | +**The patch is created for Adobe Commerce version:** |
| 16 | + |
| 17 | +* Adobe Commerce (all deployment methods) 2.4.7-p6 |
| 18 | + |
| 19 | +**Compatible with Adobe Commerce versions:** |
| 20 | + |
| 21 | +* Adobe Commerce (all deployment methods) 2.4.7 - 2.4.7-p7 |
| 22 | + |
| 23 | +>[!NOTE] |
| 24 | +> |
| 25 | +>The patch might become applicable to other versions with new [!DNL Quality Patches Tool] releases. To check if the patch is compatible with your Adobe Commerce version, update the `magento/quality-patches` package to the latest version and check the compatibility on the [[!DNL Quality Patches Tool]: Search for patches page](https://experienceleague.adobe.com/tools/commerce-quality-patches/index.html). Use the patch ID as a search keyword to locate the patch. |
| 26 | +
|
| 27 | +## Issue |
| 28 | + |
| 29 | +Creating scheduled updates in environments with a high number of nested categories results in duplicate entries, leading to errors and failure to save the category. |
| 30 | + |
| 31 | +<u>Steps to reproduce</u>: |
| 32 | + |
| 33 | +1. Install a clean instance. |
| 34 | +1. Modify the performance fixtures file (small.xml) to include: |
| 35 | + 1. **[!UICONTROL Categories]**: *2500* |
| 36 | + 1. **[!UICONTROL Products]**: *250,000* |
| 37 | +1. Generate the data using the command: |
| 38 | + |
| 39 | + ``` |
| 40 | + bin/magento setup:performance:generate-fixtures var/performance-toolkit/profiles/ce/small.xml |
| 41 | + ``` |
| 42 | +
|
| 43 | +1. After creating products and categories, ensure all categories are set as anchors by running the following query: |
| 44 | +
|
| 45 | + ``` |
| 46 | + UPDATE catalog_category_entity_int set value = 1 where attribute_id = (select attribute_id from eav_attribute where attribute_code = 'is_anchor'); |
| 47 | + ``` |
| 48 | +
|
| 49 | +1. Reindex the data. |
| 50 | +1. Log in to the Admin panel and navigate to **[!UICONTROL Catalog]** > **[!UICONTROL Categories]**. |
| 51 | +1. Move **Category 2** under **Category 1**to create a more nested structure. |
| 52 | +1. Go to a deeply nested category, for example, **Category 2.1.1**. |
| 53 | +1. Create a **[!UICONTROL Scheduled Update]**. |
| 54 | +1. Click **[!UICONTROL Save]**. |
| 55 | +
|
| 56 | +<u>Expected results</u>: |
| 57 | +
|
| 58 | +The category is saved successfully. |
| 59 | +
|
| 60 | +<u>Actual results</u>: |
| 61 | +
|
| 62 | +An error occurs, and the category fails to save. `var/log/exception.log` contains error an similar to: |
| 63 | +
|
| 64 | +``` |
| 65 | +Exception #0 (Magento\Framework\DB\Adapter\DuplicateException): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '229-255' for key 'temp_category_descendants_619aaaaaaaaaa.PRIMARY', query was: INSERT INTO `temp_category_descendants_619aaaaaaaaaa` (`category_id`, `descendant_id`) SELECT `ce`.`entity_id` AS `category_id`, `ce2`.`entity_id` AS `descendant_id` FROM `catalog_category_entity` AS `ce` |
| 66 | + INNER JOIN `catalog_category_entity` AS `ce2` ON ce2.path LIKE CONCAT(ce.path, '/%') OR ce2.entity_id = ce.entity_id AND (ce2.created_in <= '1750287600' AND ce2.updated_in > '1750287600') WHERE ((ce.entity_id IN (4, 6, 7, 8, 10, 24, 25, 27, 30, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 48, 51, 54, 56, 57, 59, 60, 63, 64, 65, 66, 67 ....... |
| 67 | +``` |
| 68 | +
|
| 69 | +## Apply the patch |
| 70 | +
|
| 71 | +To apply individual patches, use the following links depending on your deployment method: |
| 72 | +
|
| 73 | +* Adobe Commerce or Magento Open Source on-premises: [[!DNL Quality Patches Tool] > Usage](/help/tools/quality-patches-tool/usage.md) in the [!DNL Quality Patches Tool] guide. |
| 74 | +* Adobe Commerce on cloud infrastructure: [Upgrades and Patches > Apply Patches](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/develop/upgrade/apply-patches.html) in the Commerce on Cloud Infrastructure guide. |
| 75 | +
|
| 76 | +## Related reading |
| 77 | +
|
| 78 | +To learn more about [!DNL Quality Patches Tool], refer to: |
| 79 | +
|
| 80 | +* [[!DNL Quality Patches Tool]: A self-service tool for quality patches](/help/tools/quality-patches-tool/quality-patches-tool-to-self-serve-quality-patches.md) in the Tools guide. |
0 commit comments