I've installed Magento 2.4 (fresh) with the Composer.

Installation work fine (frontend and admin)

But when try to install demo data using manual get an error.

$ magento deploy:mode:show         
Current application mode: developer. (Note: Environment variables may override this value.)

$ magento sampledata:deploy
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 20 installs, 0 updates, 0 removals
  - Installing magento/module-catalog-sample-data (100.4.0): Loading from cache
  - Installing magento/module-bundle-sample-data (100.4.0): Loading from cache
- Installing magento/sample-data-media (100.4.0): Loading from cache
<warning>Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.</warning>
<warning>Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.</warning>
<warning>Package sebastian/finder-facade is abandoned, you should avoid using it. No replacement was suggested.</warning>
Writing lock file
Generating autoload files
PHP CodeSniffer Config installed_paths set to ../../phpcompatibility/php-compatibility,../../magento/magento-coding-standard                        

$ magento setup:upgrade    
Cache cleared successfully
File system cleanup:
The directory '/home/aesa/demo/magento/generated/metadata/' doesn't exist - skipping cleanup
Updating modules:
Schema creation/updates:
Module 'Magento_AdminAnalytics':
Module 'Magento_Store':

Module 'Magento_GroupedCatalogInventory':
Module 'Magento_GroupedImportExport':
Module 'Magento_CatalogSampleData':
Unable to apply data patch Magento\CatalogSampleData\Setup\Patch\Data\InstallCatalogSampleData for module Magento_CatalogSampleData. Original exception message: Rolled back transaction has not been completed correctly.

Any ideas?

2 Answers 2


It seems like it can be related to Composer cache or your compose.json. Try to follow these steps below to install it. In the code below I'll:

  • Get the Magento 2.4 via composer
  • Install it via CLI with sample data
  • Update Composer dependencies
  • Compile it
# Get Magento 2.4
composer create-project --repository-url=https://repo.magento.com magento/project-community-edition=2.4.0 m24
cd m24

# Install it with sample data
php bin/magento setup:install 
--admin-email="[email protected]" 

# Update Composer
composer clear-cache
composer update -vvv

# Compile
bin/magento deploy:mode:set developer
bin/magento setup:upgrade
bin/magento setup:static-content:deploy -f
bin/magento setup:di:compile
bin/magento index:reindex
bin/magento cache:clean

Check for log in var/log/debug.log . There should be error message.

For me the error was due to problem in saving product. I tried saving product from admin panel but could not. I scheduled update the index and the admin panel product save worked and also the sample data deploy.

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.