I've updated magento from 2.0.4 to 2.0.7 via composer. And then I tried to remove sample data using CLI

php70 bin/magento sampledata:remove

and got following error.

     PHP Fatal error: Uncaught TypeError: Argument 1 passed to 
    must be of the type array, object given, called in
on line 97 and defined in 
        Stack trace:
        #0 /srv/mat24/web/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(97): Symfony\Component\Console\Input\ArrayInput->__construct(Object(Magento\Framework\ObjectManager\ObjectManager))
        #1 /srv/mat24/web/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Symfony\Compone...', Array)
        #2 /srv/mat24/web/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Compiled->create('Symfony\Compone...', Array)
        #3 /srv/mat24/web/var/generation/Symfony/Component/Console/Input/ArrayInputFactory.php(43): Magento\Framework\Obje in /srv/mat24/web/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php on line 37

What could be the reason and how to fix that?

3 Answers 3


This is an (unresolved) issue with ArrayInputFactory in production mode (see here and here). Since your command is "one shot" you can switch your store in developer mode, launch the command, and then switch back to production mode.

BUT... sample data cannot really be removed



$./bin/magento setup:upgrade 
$ ./bin/magento cache:flush

And then remove the sample content

  • I did it many times. Thanx, but it doesn't work.
    – white-imp
    Commented May 25, 2016 at 19:27

Have you done all these steps after upgrading :

  • php bin/magento setup:upgrade
  • php bin/magento setup:static-content:deploy
  • php bin/magento indexer:reindex.
  • Delete folders except .htaccess file from , m2_root_directory > pub > static and then m2_root_directory > var > view_preprocessed.
  • Flush Magento cache by typing “php bin/magento cache:flush” in CMD.
  • Then recheck it once.

    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.