Getting the below error while trying to install sample data and upgrading the setup in Magento 2.4.2-p1
Error: Unable to apply data patch MagentoCatalogRuleSampleDataSetupPatchDataInstallCatalogRuleSampleData for module Magento_CatalogRuleSampleData
. Original exception message: Rolled back transaction has not been completed correctly.
Please help.
4
Answers
Syntax error(s) are existed in the following sample csv files.
2 solutions for the above issue:
Fix and validate the above CSVs manually or online tool like https://csvlint.io/
Comment line of code, calling above CSVs
I had such a problem and recovered by running the command:
After upgrading, just run normally.
I also received the same error and invested four days rectifying it.
I also tried the above solution, i.e., commenting the line under install function from catalogue rule sample data and sales rule sample data. It too worked, but only temporarily. Because after following the above procedure, you cannot see the products from your Magento homepage, just banners only visible to you.
The real problem is that there is no sufficient space to deploy the sample data. Clear more than 4GB of space on your system and try it. It will work.
You need to set correct permissions for
var/ pub/ & generated/
directoriesafter above, your error will be vanished on
setup:upgrade