Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

Magento does not get installed when this module is enabled at the time of installation #36

Open
pranavgaikwad opened this issue Mar 19, 2018 · 3 comments

Comments

@pranavgaikwad
Copy link

pranavgaikwad commented Mar 19, 2018

How to reproduce :
Download fresh Magento code. Download this module using composer or directly put it under app/code. Try to run a fresh install using bin/magento setup:install command.

Error Log

Starting Magento installation:
File permissions check...
[Progress: 1 / 565]
Required extensions check...
[Progress: 2 / 565]
Enabling Maintenance Mode...
[Progress: 3 / 565]
Installing deployment configuration...
[Progress: 4 / 565]
Installing database schema:


                                                                                                                                                                                                     
  [Zend_Db_Statement_Exception]                                                                                                                                                                      
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'test.store_website' doesn't exist, query was: SELECT 'main_table'.* FROM 'store_website' AS 'main_table' ORDER BY main_table.sort_orde  
  r ASC, main_table.name ASC  

Exception trace:
 () at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235
 Zend_Db_Statement_Pdo->_execute() at /home/pranav/test/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:95
 Magento\Framework\DB\Statement\Pdo\Mysql->_execute() at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Statement.php:303
 Zend_Db_Statement->execute() at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:480
 Zend_Db_Adapter_Abstract->query() at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:238
 Zend_Db_Adapter_Pdo_Abstract->query() at /home/pranav/test/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:465
 Magento\Framework\DB\Adapter\Pdo\Mysql->_query() at /home/pranav/test/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:520
 Magento\Framework\DB\Adapter\Pdo\Mysql->query() at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737
 Zend_Db_Adapter_Abstract->fetchAll() at /home/pranav/test/vendor/magento/framework/Data/Collection/Db/FetchStrategy/Query.php:21
 Magento\Framework\Data\Collection\Db\FetchStrategy\Query->fetchAll() at /home/pranav/test/vendor/magento/framework/Data/Collection/Db/FetchStrategy/Cache.php:74
 Magento\Framework\Data\Collection\Db\FetchStrategy\Cache->fetchAll() at /home/pranav/test/vendor/magento/framework/Data/Collection/AbstractDb.php:772
 Magento\Framework\Data\Collection\AbstractDb->_fetchAll() at /home/pranav/test/vendor/magento/framework/Data/Collection/AbstractDb.php:668
 Magento\Framework\Data\Collection\AbstractDb->getData() at /home/pranav/test/vendor/magento/framework/Data/Collection/AbstractDb.php:572
 Magento\Framework\Data\Collection\AbstractDb->loadWithFilter() at /home/pranav/test/vendor/magento/framework/Data/Collection/AbstractDb.php:557
 Magento\Framework\Data\Collection\AbstractDb->load() at /home/pranav/test/vendor/magento/module-store/Model/ResourceModel/Website/Collection.php:119
 Magento\Store\Model\ResourceModel\Website\Collection->load() at /home/pranav/test/vendor/magento/framework/Data/Collection.php:820
 Magento\Framework\Data\Collection->getIterator() at /home/pranav/test/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:142
 Magento\Store\App\Config\Source\RuntimeConfigSource->getWebsitesData() at /home/pranav/test/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:106
 Magento\Store\App\Config\Source\RuntimeConfigSource->get() at /home/pranav/test/vendor/magento/framework/App/Config/ConfigSourceAggregated.php:40
 Magento\Framework\App\Config\ConfigSourceAggregated->get() at /home/pranav/test/var/generation/Magento/Framework/App/Config/ConfigSourceAggregated/Proxy.php:95
 Magento\Framework\App\Config\ConfigSourceAggregated\Proxy->get() at /home/pranav/test/vendor/magento/module-store/App/Config/Type/Scopes.php:50
 Magento\Store\App\Config\Type\Scopes->get() at /home/pranav/test/vendor/magento/framework/App/Config.php:139
 Magento\Framework\App\Config->get() at /home/pranav/test/vendor/magento/module-store/Model/WebsiteRepository.php:184
 Magento\Store\Model\WebsiteRepository->initDefaultWebsite() at /home/pranav/test/vendor/magento/module-store/Model/WebsiteRepository.php:143
 Magento\Store\Model\WebsiteRepository->getDefault() at /home/pranav/test/vendor/magento/module-store/Model/StoreResolver/Website.php:46
 Magento\Store\Model\StoreResolver\Website->getAllowedStoreIds() at /home/pranav/test/vendor/magento/module-store/Model/StoreResolver.php:136
 Magento\Store\Model\StoreResolver->readStoresData() at /home/pranav/test/vendor/magento/module-store/Model/StoreResolver.php:122
 Magento\Store\Model\StoreResolver->getStoresData() at /home/pranav/test/vendor/magento/module-store/Model/StoreResolver.php:85
 Magento\Store\Model\StoreResolver->getCurrentStoreId() at /home/pranav/test/vendor/magento/module-store/Model/StoreManager.php:154
 Magento\Store\Model\StoreManager->getStore() at /home/pranav/test/var/generation/Magento/Store/Model/StoreManagerInterface/Proxy.php:119
 Magento\Store\Model\StoreManagerInterface\Proxy->getStore() at /home/pranav/test/vendor/magento/module-store/Model/Resolver/Store.php:29
 Magento\Store\Model\Resolver\Store->getScope() at /home/pranav/test/vendor/magento/framework/App/Config/ScopeCodeResolver.php:49
 Magento\Framework\App\Config\ScopeCodeResolver->resolve() at /home/pranav/test/vendor/magento/framework/App/Config.php:79
 Magento\Framework\App\Config->getValue() at /home/pranav/test/vendor/magento/framework/Locale/Resolver.php:90
 Magento\Framework\Locale\Resolver->getDefaultLocale() at /home/pranav/test/vendor/magento/framework/Locale/Resolver.php:107
 Magento\Framework\Locale\Resolver->setLocale() at /home/pranav/test/vendor/magento/framework/Locale/Resolver.php:64
 Magento\Framework\Locale\Resolver->__construct() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:93
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:89
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/pranav/test/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/pranav/test/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/pranav/test/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/pranav/test/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:163
 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:139
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/pranav/test/vendor/magento/framework/ObjectManager/ObjectManager.php:57
 Magento\Framework\ObjectManager\ObjectManager->create() at /home/pranav/test/setup/src/Magento/Setup/Model/ObjectManagerProvider.php:78
 Magento\Setup\Model\ObjectManagerProvider->createCliCommands() at /home/pranav/test/setup/src/Magento/Setup/Model/ObjectManagerProvider.php:64
 Magento\Setup\Model\ObjectManagerProvider->get() at /home/pranav/test/setup/src/Magento/Setup/Module/SetupFactory.php:39
 Magento\Setup\Module\SetupFactory->create() at /home/pranav/test/setup/src/Magento/Setup/Model/Installer.php:775
 Magento\Setup\Model\Installer->installSchema() at n/a:n/a
 call_user_func_array() at /home/pranav/test/setup/src/Magento/Setup/Model/Installer.php:344
 Magento\Setup\Model\Installer->install() at /home/pranav/test/setup/src/Magento/Setup/Console/Command/InstallCommand.php:125
 Magento\Setup\Console\Command\InstallCommand->execute() at /home/pranav/test/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at /home/pranav/test/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /home/pranav/test/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /home/pranav/test/vendor/magento/framework/Console/Cli.php:96
 Magento\Framework\Console\Cli->doRun() at /home/pranav/test/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /home/pranav/test/bin/magento:23                                                                                                                                                                      
                                                                                                                                                                                                     


                                                                                                
  [PDOException]                                                                                
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'test.store_website' doesn't exist

Exception trace:
 () at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228
 PDOStatement->execute() at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228
 Zend_Db_Statement_Pdo->_execute() at /home/pranav/test/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:95
 Magento\Framework\DB\Statement\Pdo\Mysql->_execute() at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Statement.php:303
 Zend_Db_Statement->execute() at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:480
 Zend_Db_Adapter_Abstract->query() at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:238
 Zend_Db_Adapter_Pdo_Abstract->query() at /home/pranav/test/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:465
 Magento\Framework\DB\Adapter\Pdo\Mysql->_query() at /home/pranav/test/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:520
 Magento\Framework\DB\Adapter\Pdo\Mysql->query() at /home/pranav/test/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737
 Zend_Db_Adapter_Abstract->fetchAll() at /home/pranav/test/vendor/magento/framework/Data/Collection/Db/FetchStrategy/Query.php:21
 Magento\Framework\Data\Collection\Db\FetchStrategy\Query->fetchAll() at /home/pranav/test/vendor/magento/framework/Data/Collection/Db/FetchStrategy/Cache.php:74
 Magento\Framework\Data\Collection\Db\FetchStrategy\Cache->fetchAll() at /home/pranav/test/vendor/magento/framework/Data/Collection/AbstractDb.php:772
 Magento\Framework\Data\Collection\AbstractDb->_fetchAll() at /home/pranav/test/vendor/magento/framework/Data/Collection/AbstractDb.php:668
 Magento\Framework\Data\Collection\AbstractDb->getData() at /home/pranav/test/vendor/magento/framework/Data/Collection/AbstractDb.php:572
 Magento\Framework\Data\Collection\AbstractDb->loadWithFilter() at /home/pranav/test/vendor/magento/framework/Data/Collection/AbstractDb.php:557
 Magento\Framework\Data\Collection\AbstractDb->load() at /home/pranav/test/vendor/magento/module-store/Model/ResourceModel/Website/Collection.php:119
 Magento\Store\Model\ResourceModel\Website\Collection->load() at /home/pranav/test/vendor/magento/framework/Data/Collection.php:820
 Magento\Framework\Data\Collection->getIterator() at /home/pranav/test/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:142
 Magento\Store\App\Config\Source\RuntimeConfigSource->getWebsitesData() at /home/pranav/test/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:106
 Magento\Store\App\Config\Source\RuntimeConfigSource->get() at /home/pranav/test/vendor/magento/framework/App/Config/ConfigSourceAggregated.php:40
 Magento\Framework\App\Config\ConfigSourceAggregated->get() at /home/pranav/test/var/generation/Magento/Framework/App/Config/ConfigSourceAggregated/Proxy.php:95
 Magento\Framework\App\Config\ConfigSourceAggregated\Proxy->get() at /home/pranav/test/vendor/magento/module-store/App/Config/Type/Scopes.php:50
 Magento\Store\App\Config\Type\Scopes->get() at /home/pranav/test/vendor/magento/framework/App/Config.php:139
 Magento\Framework\App\Config->get() at /home/pranav/test/vendor/magento/module-store/Model/WebsiteRepository.php:184
 Magento\Store\Model\WebsiteRepository->initDefaultWebsite() at /home/pranav/test/vendor/magento/module-store/Model/WebsiteRepository.php:143
 Magento\Store\Model\WebsiteRepository->getDefault() at /home/pranav/test/vendor/magento/module-store/Model/StoreResolver/Website.php:46
 Magento\Store\Model\StoreResolver\Website->getAllowedStoreIds() at /home/pranav/test/vendor/magento/module-store/Model/StoreResolver.php:136
 Magento\Store\Model\StoreResolver->readStoresData() at /home/pranav/test/vendor/magento/module-store/Model/StoreResolver.php:122
 Magento\Store\Model\StoreResolver->getStoresData() at /home/pranav/test/vendor/magento/module-store/Model/StoreResolver.php:85
 Magento\Store\Model\StoreResolver->getCurrentStoreId() at /home/pranav/test/vendor/magento/module-store/Model/StoreManager.php:154
 Magento\Store\Model\StoreManager->getStore() at /home/pranav/test/var/generation/Magento/Store/Model/StoreManagerInterface/Proxy.php:119
 Magento\Store\Model\StoreManagerInterface\Proxy->getStore() at /home/pranav/test/vendor/magento/module-store/Model/Resolver/Store.php:29
 Magento\Store\Model\Resolver\Store->getScope() at /home/pranav/test/vendor/magento/framework/App/Config/ScopeCodeResolver.php:49
 Magento\Framework\App\Config\ScopeCodeResolver->resolve() at /home/pranav/test/vendor/magento/framework/App/Config.php:79
 Magento\Framework\App\Config->getValue() at /home/pranav/test/vendor/magento/framework/Locale/Resolver.php:90
 Magento\Framework\Locale\Resolver->getDefaultLocale() at /home/pranav/test/vendor/magento/framework/Locale/Resolver.php:107
 Magento\Framework\Locale\Resolver->setLocale() at /home/pranav/test/vendor/magento/framework/Locale/Resolver.php:64
 Magento\Framework\Locale\Resolver->__construct() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:93
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:89
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/pranav/test/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/pranav/test/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/pranav/test/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/pranav/test/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:163
 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:139
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/pranav/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/pranav/test/vendor/magento/framework/ObjectManager/ObjectManager.php:57
 Magento\Framework\ObjectManager\ObjectManager->create() at /home/pranav/test/setup/src/Magento/Setup/Model/ObjectManagerProvider.php:78
 Magento\Setup\Model\ObjectManagerProvider->createCliCommands() at /home/pranav/test/setup/src/Magento/Setup/Model/ObjectManagerProvider.php:64
 Magento\Setup\Model\ObjectManagerProvider->get() at /home/pranav/test/setup/src/Magento/Setup/Module/SetupFactory.php:39
 Magento\Setup\Module\SetupFactory->create() at /home/pranav/test/setup/src/Magento/Setup/Model/Installer.php:775
 Magento\Setup\Model\Installer->installSchema() at n/a:n/a
 call_user_func_array() at /home/pranav/test/setup/src/Magento/Setup/Model/Installer.php:344
 Magento\Setup\Model\Installer->install() at /home/pranav/test/setup/src/Magento/Setup/Console/Command/InstallCommand.php:125
 Magento\Setup\Console\Command\InstallCommand->execute() at /home/pranav/test/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at /home/pranav/test/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /home/pranav/test/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /home/pranav/test/vendor/magento/framework/Console/Cli.php:96
 Magento\Framework\Console\Cli->doRun() at /home/pranav/test/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /home/pranav/test/bin/magento:23

Magento Version : 2.1.10

I couldn't find the root cause. I assumed it could be because of incorrect load order of components. But, adding <module name="Magento_Store"/> under <sequence> in module.xml did not help.

@tushardatar
Copy link

@pranavgaikwad -
Its problem with magento 2.1.10 (maybe for earlier versions also).
setup:install fails when you have any module which add console commands.

Workaround -

Try using Factory classes or Interface in __construct.
In your case instead of Magento\Catalog\Model\ResourceModel\Product\Collection Try using Magento\Catalog\Model\ResourceModel\Product\CollectionFactory

@peterjaap
Copy link

@tushardatar that is not a workaround, but actually the correct solution :)

@pranavgaikwad
Copy link
Author

@peterjaap Tried @tushardatar's solution. Did not seem to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants