I'm using Magento 2.4.5 version. I'm trying to create custom attribute. I have followed following tutorials https://experienceleague.adobe.com/docs/commerce-learn/tutorials/backend-development/add-product-attribute.html?lang=en https://webkul.com/blog/magento2-how-to-create-product-custom-attribute-from-installer-in-custom-module/

Custom attribue is not getting created even after executing php bin/magento setup:upgrade command. Is there any change in process in newer version? php bin/magento setup:di:compile also got executed without errors.


1 Answer 1


Delete your module from setup_module table and run php bin/magento setup:upgrade again, also please do not use 'InstallData' as it is not recommended by Magento. Instead use 'patch'

See here for patch

  • Getting following error call_user_func(): Argument #1 ($callback) must be a valid callback, class \Vendor\Extention\Setup\Patch\Data\Addcustomdatapatch not found .. could someone please help me on this
    – srihitha
    Commented Nov 16, 2022 at 8:06
  • You have to give your Namespace and module name in place of vendor\Extension
    – Ankit
    Commented Nov 16, 2022 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.