Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error when installing sample data from CLI #47

Open
eduards-magebit opened this issue Apr 19, 2017 · 4 comments
Open

Fatal error when installing sample data from CLI #47

eduards-magebit opened this issue Apr 19, 2017 · 4 comments

Comments

@eduards-magebit
Copy link

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
Copy link
Author

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

  • option "size" with value "XS"
  • option "color" with value "Red" (mind the capitalization, there was already an option with value "red" in the database, but it still threw the same error)

@MagentoListrak
Copy link

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

@jjewel
Copy link

jjewel commented Nov 28, 2018

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
Copy link

Anantkprajapati commented Feb 3, 2019

Hello @jjewel - this is not working after apply your suggesting in windows
#mm19in
Thank you

magento-devops-reposync-svc pushed a commit that referenced this issue Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants