1

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:
/home/aesa/demo/magento/generated/code/Composer
/home/aesa/demo/magento/generated/code/Dotdigitalgroup
/home/aesa/demo/magento/generated/code/Magento
...
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

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 
--backend-frontname="admin" 
--session-save="files" 
--db-host="127.0.0.1:9200" 
--db-name="magento24" 
--db-user="root" 
--db-password="admin123" 
--base-url="https://local.m24.com/" 
--base-url-secure="https://local.m24.com/" 
--admin-user="admin" 
--admin-password="admin123" 
--admin-email="admin@admin.com" 
--admin-firstname="Rafael" 
--admin-lastname="Gomes"
--elasticsearch-host=elasticsearch
--use-sample-data 
--cleanup-database

# 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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