I am trying to install Magento2 by using command line.
I did execute this command reinstall -s
I am getting following exception and can not install sample data.
Please help me to fix this issue.
[SUCCESS]: Magento installation complete.
/vagrant/data/magento2
Installing sample data...
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
exception 'Magento\Framework\Exception\LocalizedException' with message 'Area code is not set' in /vagrant/data/magento2/lib/internal/Magento/Framework/App/State.php:154
Stack trace:
#0 /vagrant/data/magento2/lib/internal/Magento/Framework/Session/SessionManager.php(173): Magento\Framework\App\State->getAreaCode()
#1 /vagrant/data/magento2/lib/internal/Magento/Framework/Session/SessionManager.php(130): Magento\Framework\Session\SessionManager->start()
#2 /vagrant/data/magento2/app/code/Magento/Backend/Model/Auth/Session.php(98): Magento\Framework\Session\SessionManager->__construct(Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Session\SidResolver\Proxy), Object(Magento\Framework\Session\Config), Object(Magento\Framework\Session\SaveHandler), Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage), Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State))
#3 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(148): Magento\Backend\Model\Auth\Session->__construct(Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Session\SidResolver\Proxy), Object(Magento\Framework\Session\Config), Object(Magento\Framework\Session\SaveHandler), Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage), Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State), Object(Magento\Framework\Acl\Builder\Proxy), Object(Magento\Backend\Model\Url), Object(Magento\Backend\App\Config))
#4 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(91): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Backend...', Array)
#5 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Backend...')
#6 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Backend...')
#7 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Backend...', NULL, 'session', 'Magento\Tools\S...')
#8 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(84): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Tools\S...', Array, Array)
#9 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Tools\S...')
#10 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Tools\S...')
#11 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Tools\S...', NULL, 'installer', 'Magento\Tools\S...')
#12 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(84): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Tools\S...', Array, Array)
#13 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Tools\S...', Array)
#14 /vagrant/data/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(220): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Tools\S...', Array)
#15 /vagrant/data/magento2/dev/tools/Magento/Tools/SampleData/install.php(29): Magento\Framework\App\Bootstrap->createApplication('Magento\Tools\S...', Array)
#16 {main}
Next exception 'Magento\Framework\Exception\SessionException' with message 'Area code not set: Area code must be set before starting a session.' in /vagrant/data/magento2/lib/internal/Magento/Framework/Session/SessionManager.php:175
Stack trace:
#0 /vagrant/data/magento2/lib/internal/Magento/Framework/Session/SessionManager.php(130): Magento\Framework\Session\SessionManager->start()
#1 /vagrant/data/magento2/app/code/Magento/Backend/Model/Auth/Session.php(98): Magento\Framework\Session\SessionManager->__construct(Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Session\SidResolver\Proxy), Object(Magento\Framework\Session\Config), Object(Magento\Framework\Session\SaveHandler), Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage), Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State))
#2 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(148): Magento\Backend\Model\Auth\Session->__construct(Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Session\SidResolver\Proxy), Object(Magento\Framework\Session\Config), Object(Magento\Framework\Session\SaveHandler), Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage), Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State), Object(Magento\Framework\Acl\Builder\Proxy), Object(Magento\Backend\Model\Url), Object(Magento\Backend\App\Config))
#3 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(91): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Backend...', Array)
#4 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Backend...')
#5 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Backend...')
#6 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Backend...', NULL, 'session', 'Magento\Tools\S...')
#7 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(84): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Tools\S...', Array, Array)
#8 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Tools\S...')
#9 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Tools\S...')
#10 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Tools\S...', NULL, 'installer', 'Magento\Tools\S...')
#11 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(84): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Tools\S...', Array, Array)
#12 /vagrant/data/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Tools\S...', Array)
#13 /vagrant/data/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(220): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Tools\S...', Array)
#14 /vagrant/data/magento2/dev/tools/Magento/Tools/SampleData/install.php(29): Magento\Framework\App\Bootstrap->createApplication('Magento\Tools\S...', Array)
#15 {main}vagrant@mage2:/vagrant/data/magento2$ clear
vagrant@mage2:/vagrant/data/magento2$ clear