While installing database from cmd I am getting below error.

Unable to apply data patch Magento\Msrp\Setup\Patch\Data\ChangeMsrpAttributeLabel for module Magento_Msrp. Original exception message: Notice: Undefined index: attribute_id in D:\wamp64\www\magento2\vendor
\magento\module-msrp\Setup\Patch\Data\ChangeMsrpAttributeLabel.php on line 43

In ErrorHandler.php line 61:

Notice: Undefined index: attribute_id in D:\wamp64\www\magento2\vendor\magento\module-msrp\Setup\Patch\Data\ChangeMsrpAttributeLabel.php on line 43

I am also attaching screenshot of error. Can anyone please help me on that?

enter image description here

  • Hi, did you get the solution for the above problem? i am also facing this on windows system. Oct 6, 2020 at 11:41

2 Answers 2


Go to vendor\magento\module-msrp\Setup\Patch\Data\ChangePriceAttributeDefaultScope.php

comment line no 89 to 94


and in the file vendor\magento\module-msrp\Setup\Patch\Data\ChangeMsrpAttributeLabel.php comment out line no 41 to 46.

            'Minimum Advertised Price'

Run the setup command again to start installation.

php -dmemory_limit=-1 bin/magento setup:install --base-url= --db-host= --db-name=magento-24 --db-user=root --db-password='' --admin-firstname=test --admin-lastname=test [email protected] --admin-user=admin --admin-password=admin@123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host= --elasticsearch-port=9200

After installation uncomment the above files. Above solution worked fine.


I faced such error, and having investigated this question it was found out that the problem was that in the third-party module (which place in app/code or vendor/) which uses a patch to add attributes with method $eavSetup->addAttribute(), uses for class the interface \Magento\Framework\Setup\Patch\SchemaPatchInterface instead \Magento\Framework\Setup\Patch\DataPatchInterface and set that patch class to folder .../Setup/Patch/Schema/AddCustomAttirbute.php It means that when we use patch to add attribute we need use interface \Magento\Framework\Setup\Patch\DataPatchInterface to create patch class.

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.