FIX: Try rebooting the server and repeating the bin/magento setup:upgrade command.
I can confirm I get this same issue. This is my 6th clone of Magento 2.4 exactly per this guide (which is excellent, thanks Craig), this is the first time I’ve tried adding the sample data, and can confirm it gives the error reported as above.
At php bin/magento setup:upgrade …
[email protected]:/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata$ php bin/magento setup:upgrade
Cache types config flushed successfully
Cache cleared successfully
File system cleanup:
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/generated/code/Composer
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/generated/code/Dotdigitalgroup
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/generated/code/Magento
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/generated/code/PayPal
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/generated/code/Psr
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/generated/code/Symfony
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/generated/code/Yotpo
The directory ‘/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/generated/metadata/’ doesn’t exist - skipping cleanup
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/pub/static/adminhtml
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/pub/static/deployed_version.txt
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/pub/static/frontend
/mnt/HDD_160GB/ubuntu-pi/www/vanillawithdata/var/view_preprocessed/pub
Updating modules:
Could not validate a connection to Elasticsearch. No alive nodes found in your cluster
I confirmed elasticsearch was broken by login in to the backend of another magento installation and clicking Stores > Configuration > Catalog > Catalog > Catalog Search > Test Connection - got and error message like “No Node Available”
I rebooted the server and repeated the command
php bin/magento setup:upgrade and the upgrade worked as normal