Attribute set edit form : slow or unfinished loading
Preconditions and environment
- Magento version : 2.4.7 Magento Open source and Adobe Commerce
- The bug is reproduced when you load the attribute set editor page for an attribute set, with an important number ( > 1000 ) of unassigned attributes to this attribute set
- In this case the loading is really slow and takes a long time sometimes, and in some environment it does not even load the attributes, and this error is displayed :
There is the image of the loading of the page :
Steps to reproduce
- Install Sample Data
- Create at least 1000 attributes ( not assigned to any of the attribute sets ) - please fin attached an example of a patch to create the attributes AddUnassignedAttributes.zip
- Go to Adobe commerce Backend
- Go so Stores > Attributes [Attribute Set] > Edit and attribute set ( Bag for example ) - Don't check the default attribute set
Expected result
The Editor should display in the same way of Adobe commerce 2.4.6, without the time that the loading takes or the error displayed
Actual result
The loader is displayed for a very long time, sometimes it displays the form and others it displays an error :
Additional information
After doing the technical check , the issue comes from the js jtree library that has been replaced in the 2.4.7 version in the file : vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml In the version 2.4.6 it was working
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.
- [X] 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”.
Hi @ibrahim-amara. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance- upcoming 2.4.x release- For more details, review the Magento Contributor Assistant documentation.
- Add a comment to assign the issue:
@magento I am working on this - To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
-
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
-
- Verify that issue has a meaningful description and provides enough information to reproduce the issue.
-
- Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to.
- Add
-
- Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
- Verify that the issue is reproducible on
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
- [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! - [ ] 5. Add label
Issue: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
- [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! - [ ] 5. Add label
Issue: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hello @ibrahim-amara,
Thank you for the report and collaboration!
We were not able to reproduce this on latest 2.4-develop instance.
Followed the steps to reproduce and added 1000+ attributes.
When opening Stores > Attributes [Attribute Set] > Edit an attribute set (Bag), we are able to see attribute list without any significant load time.
Please let us know if we are missing anything.
Thank you.
Hi @engcom-November
I managed to reproduce the issue on my end with a fresh Magento 2.4.7-p1
With 1000 random attributes created, the loading time of this page is extremely long (screenshots below) :
and here's my script to create 1000 random attributes create_random_attributes.zip
Hello @ibrahim-amara,
Thank you for the quick response!
Tried to reproduce this on 2.4.7-p1, but it is not reproducible.
Here are the performance screenshots:
Here is the datapatch used to add 1000+ atrributes. I38810V.zip
Please let us know if we are missing anything.
Thank you.
Hi @engcom-November,
This issue can only be reproduced when the attributes are located under Unassigned Attributes, while attributes created from the I38810V.zip will be assigned to a group after installation of the module (please see screenshot below) :
You may use my executable php script (paste it under the root folder of the project) to create 1000 unassigned attributes.
Feel free to contact me for any additional information.
Best regards,
@ibrahim-amara,
The attributes were in unassigned attributes section when testing for the performance.
Please take a look at the screenshot:
I have double checked the issue with your script and got the same result.
I am having the same issue. Firefox is crashing (2700 attributes in total)
Same issue.
1. Environment Details: Magento Version: 2.4.7 PHP Version 8.3.7 Browser: Chrome version 120.0.6099.216
-
Steps to Reproduce: Navigate to admin/catalog/product_set/edit/id/{attribute_set_id} Attempt to load the list of attributes.
-
Expected Result: The page loads successfully, displaying the list of attributes for the product set.
-
Actual Result: Chrome crashes, and the list of attributes fails to load.
Not able to reproduce this with 1000+ attributes on 2.4.7 and 2.4.7-p1 with php 8.3.8 and chrome version 126.0.6478.127.
Please take a look at the screencast below:
Please let us know if there are any prerequisites required inorder to reproduce this.
We're having the same problem after the update to 2.4.7-p1. The number of unassigned attributes is 1800.
The highest attribute ID is 24523. This might be (or might not) be of importance since I see the ID is used in JS: the first parameter of redraw_node and this number is probably higher than on a clean Magento instance.
It just keeps redrawing nodes forever, again and again.
Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
- [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! - [ ] 5. Add label
Issue: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hello @ibrahim-amara @xpoback,
We have tried to reproduce the issue in the latest 2.4-develop branch with the below script creating 3000 unassigned attributes.
<?php
use Magento\Framework\App\Bootstrap;
use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory;
use Magento\Eav\Setup\EavSetup;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
/** @var AttributeFactory $attributeFactory */
$attributeFactory = $objectManager->get(AttributeFactory::class);
/** @var EavSetup $eavSetup */
$eavSetup = $objectManager->create(EavSetup::class);
$entityTypeId = $eavSetup->getEntityTypeId('catalog_product');
$attributeSetId = $eavSetup->getDefaultAttributeSetId($entityTypeId);
$attributeCodes = [];
for ($i = 1; $i <= 3000; $i++) {
$attributeCode = 'random_attribute_' . $i;
$attributeCodes[] = $attributeCode;
$attributeData = [
'type' => 'varchar',
'label' => 'Random Attribute ' . $i,
'input' => 'text',
'required' => false,
'user_defined' => true,
'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => true,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_in_product_listing' => false,
'unique' => false,
];
try {
$eavSetup->addAttribute($entityTypeId, $attributeCode, $attributeData);
echo "Created attribute: $attributeCode\n";
} catch (\Exception $e) {
echo "Error creating attribute $attributeCode: " . $e->getMessage() . "\n";
}
}
echo "Created 3000 random attributes.\n";
The issue has been reproducible for us:
Hence confirming the issue:
Thanks
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-13304 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
For several months, no one has been able to fix the bug that prevents viewing and managing attribute sets from the admin panel. There isn’t even the slightest information about what the problem might be.
For those interested: In a store with 3600+ attributes and around 500 attribute sets, the issue was resolved by overriding the file: vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml
with the code from Magento 2.4.6-p8: https://github.com/magento/magento2/blob/2.4.6-p8/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml
I assume the cause is this commit that replaced extjs with jstree: https://github.com/magento/magento2/commit/9eb7432c1d208565eeac373127a4ebcebd6f16e4
For several months, no one has been able to fix the bug that prevents viewing and managing attribute sets from the admin panel. There isn’t even the slightest information about what the problem might be.
For those interested: In a store with 3600+ attributes and around 500 attribute sets, the issue was resolved by overriding the file: vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml
with the code from Magento 2.4.6-p8: https://github.com/magento/magento2/blob/2.4.6-p8/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml
I assume the cause is this commit that replaced extjs with jstree: 9eb7432
I just created a patch for this and I just want to verify that this update works as expected. It is even faster then before.
Issue is fixed and here is the commit id: https://github.com/magento/magento2/commit/a7627fc4346638a1d10f4e18e7f438d8fca24c74
Thanks for the update @chittima. I am closing this issue as the issue got fixed and merged with the repo.