product_type or type_id then attempt to create any of themAn attribute with this code already exists. _OR_ An attribute with the same code (product_type) already exists.It's due to following line of code https://github.com/magento/magento2/blob/39012d4ea79157cb12eef348cc3448d955c0ecc5/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php#L130 implemented in https://github.com/magento/magento2/commit/ca0da34ee2691bfaca1c74d94a0db33377d4e54c#diff-9ff38a88c1abf86286f77b64c8bc9b38 and https://github.com/magento/magento2/commit/b9d13e69c4928a0b6d740845bed305a399a42fd5#diff-9ff38a88c1abf86286f77b64c8bc9b38
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
Hi @IgorM92. Thank you for your report.
To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance - upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
Hi @swathishs. 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:
Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
[ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop branchDetails
- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced 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: Confirmed once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@magento give me 2.4-develop instance
Hi @swathishs. Thank you for your request. I'm working on Magento 2.4-develop instance for you
Hi @swathishs, here is your Magento instance.
Admin access: https://i-28479-2-4-develop.instances.magento-community.engineering/admin_7697
Login: f178f522 Password: 1608965c8c8a
Instance will be terminated in up to 3 hours.
@swathishs any updates on this one?
@IgorM92: The issue is reproducible in Magento 2.4 develop instance.
Please find the attachment below:


:white_check_mark: Confirmed by @swathishs
Thank you for verifying the issue. Based on the provided information internal tickets MC-34952 were created
Issue Available: @swathishs, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._
Hi, @swathishs @IgorM92
I wanted to warn you against using such values ​​for "Default value". There was a case but vice versa.
product_type attribute contains incorrect value in mass import export csv after creating custom type_id attribute. actual type_id value in database gets change with newly created attribute type_id.
I think an additional discussion would be helpful.
@engcom-Echo could you help me with following question:
Does product_type and type_id product attributes get created with magento installation ?
@IgorM92 @swathishs @engcom-Echo
I think that product_type and type_id are both used to describe the product type (simple, Downloadable, ..... ).
The type_id can be found as a column in catalog_product_entity table which used as product_type in many places in code and import/export operations. So they look like reserved keys that cannot be used in naming custom attributes.
So I think the issue is not about "Cannot create/update attribute with product_type & type_id codes" but it's about showing more meaningful error message instead of An attribute with the same code already exists. but there isn't which making us confused!.
If it makes sense, you can update the issue please.
Hello @IgorM92 @AbdulRahmanAbouzaid
Thank you for your report and collaboration!
This issue has been reviewed and discussed during the Triage Meeting with Magento Product Managers.
The results and resolution based on https://github.com/magento/magento2/issues/28479#issuecomment-640722555
product_type and type_id are reserved keys in Magento that in use through a lot of functionality. So, allowing to save such names will required a lot of effort for development and testing and the final value does not worth itThe expected result should be updated:
@sdzhepa
Thanks for your comment. I already provided this PR #28663 that updated the error message in that case.
Can you please review it?
@magento give me 2.4-develop instance
Hi @IgorM92. Thank you for your request. I'm working on Magento 2.4-develop instance for you
Hi @IgorM92, here is your Magento instance.
Admin access: https://i-28479-2-4-develop.instances.magento-community.engineering/admin_b2ff
Login: b3b2b52a Password: 7a51914455ac
Instance will be terminated in up to 3 hours.
@swathishs @AbdulRahmanAbouzaid @sdzhepa first i would like to apologise to all of you.
First of all i've realised that i have not provided in Steps to reproduce point 2 more information and ELSE edit any of them and change anything does not indicate to the problem i was facing.
Overall the issue i've stumbled across was that in admin panel i could not edit labels for attribute product_type, based on this can any of you answer to the following questions:
product_type and type_id attributes visible in admin by default ? (on a project i am working on it was visible, if answer to this question is no then most likely in my project in the past it was updated to be visible in admin panel)P.S. attached image to show about which section i am speaking of

Apologies again for not providing full story 🙇
@magento give me 2.3.5-p1 instance
Hi @Ig0r-M-magic42. Thank you for your request. I'm working on Magento 2.3.5-p1 instance for you
Hi @Ig0r-M-magic42, here is your Magento instance.
Admin access: https://i-28479-2-3-5-p1.instances.magento-community.engineering/admin_4e07
Login: abb3982d Password: a2c463f811a2
Instance will be terminated in up to 3 hours.
Hi @IgorM92. Thank you for your report.
The issue has been fixed in magento/magento2#28663 by @AbdulRahmanAbouzaid in 2.4-develop branch
Related commit(s):
The fix will be available with the upcoming 2.4.2 release.
Most helpful comment
Hi @IgorM92. Thank you for your report.
The issue has been fixed in magento/magento2#28663 by @AbdulRahmanAbouzaid in 2.4-develop branch
Related commit(s):
The fix will be available with the upcoming 2.4.2 release.