magento / magento2-sample-data

Magento 2 Sample Data
Open Software License 3.0
213 stars 271 forks source link

Fatal error when installing sample data from CLI #47

Open eduards-magebit opened 7 years ago

eduards-magebit commented 7 years ago

Hello.

I've run into the following error when trying to install sample data from CLI in Magento 2.1.5 CE. This error occurs when running php bin/magento setup:upgrade, the first command php bin/magento sampledata:deploy executed with no problems.

Module 'Magento_SalesSampleData':
Installing data... PHP Fatal error:  Uncaught Error: Call to a member function getDataByKey() on null in /var/www/dysandbox/public_html/htdocs/vendor/magento/module-sales-sample-data/Model/Order/Converter.php:191
Stack trace:
#0 /var/www/dysandbox/public_html/htdocs/vendor/magento/module-sales-sample-data/Model/Order/Converter.php(171): Magento\SalesSampleData\Model\Order\Converter->getProductAttributes(Array)
#1 /var/www/dysandbox/public_html/htdocs/vendor/magento/module-sales-sample-data/Model/Order/Converter.php(76): Magento\SalesSampleData\Model\Order\Converter->convertProductData(Array)
#2 /var/www/dysandbox/public_html/htdocs/vendor/magento/module-sales-sample-data/Model/Order.php(101): Magento\SalesSampleData\Model\Order\Converter->convertRow(Array)
#3 /var/www/dysandbox/public_html/htdocs/vendor/magento/module-sales-sample-data/Setup/Installer.php(30): Magento\SalesSampleData\Model\Order->install(Array)
#4 [internal function]: Magento\SalesSampleData\Setup\Installer->install()
#5 /var/www/dysandbox/public_html/htdocs/vendor/magento/frame in /var/www/dysandbox/public_html/htdocs/vendor/magento/module-sales-sample-data/Model/Order/Converter.php on line 191

Thanks in advance.

eduards-magebit commented 7 years ago

Worked around it by creating an upgrade script, which adds two product attribute options:

MagentoListrak commented 7 years ago

It looks like the issue is the fixtures/orders.csv file is not serialized when the code is expecting it to be.

jjewel commented 5 years ago

I had this issue and was able to resolve it by following this stackexchange post https://magento.stackexchange.com/questions/144042/complete-the-sample-data-installation-error

The issue was related to the CRLF file endings

Anantkprajapati commented 5 years ago

Hello @jjewel - this is not working after apply your suggesting in windows

mm19in

Thank you