magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

php bin/magento setup:di:compile requires database connection #36845

Closed gwharton closed 1 year ago

gwharton commented 1 year ago

Preconditions and environment

Steps to reproduce

Deploy vanilla magento Dump database config to file - php bin/magento app:config:dump scopes themes system i18n Clear all caches - php bin/magento cache:clean Shutdown MySQL Server Attempt to Compile - php bin/magento setup:di:compile -vvv

Expected result

Compilation was started.
Plugin list generation... 9/9 [============================] 100% 43 secs 398.0 MiB
Generated code and dependency injection configuration successfully.

Actual result

Compilation was started.
Plugin list generation... 9/9 [============================] 100% 43 secs 398.0 MiB
Generated code and dependency injection configuration successfully.

In Abstract.php line 144:

  [Zend_Db_Adapter_Exception (2002)]       
  SQLSTATE[HY000] [2002] Invalid argument  

Exception trace:
  at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144
 Zend_Db_Adapter_Pdo_Abstract->_connect() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Mysql.php:111
 Zend_Db_Adapter_Pdo_Mysql->_connect() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:428
 Magento\Framework\DB\Adapter\Pdo\Mysql->_connect() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:460
 Zend_Db_Adapter_Abstract->query() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:238
 Zend_Db_Adapter_Pdo_Abstract->query() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:564
 Magento\Framework\DB\Adapter\Pdo\Mysql->_query() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:634
 Magento\Framework\DB\Adapter\Pdo\Mysql->query() at /home/lubefinder/magento/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:95
 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->query() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737
 Zend_Db_Adapter_Abstract->fetchAll() at /home/lubefinder/magento/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:1085
 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->fetchAll() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:101
 Magento\Store\App\Config\Source\RuntimeConfigSource->getEntities() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:61
 Magento\Store\App\Config\Source\RuntimeConfigSource->get() at /home/lubefinder/magento/vendor/magento/framework/App/Config/ConfigSourceAggregated.php:42
 Magento\Framework\App\Config\ConfigSourceAggregated->get() at /home/lubefinder/magento/generated/code/Magento/Framework/App/Config/ConfigSourceAggregated/Proxy.php:95
 Magento\Framework\App\Config\ConfigSourceAggregated\Proxy->get() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Type/Scopes.php:63
 Magento\Store\App\Config\Type\Scopes->get() at /home/lubefinder/magento/vendor/magento/framework/App/Config.php:132
 Magento\Framework\App\Config->get() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreRepository.php:106
 Magento\Store\Model\StoreRepository->getById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreRepository.php:127
 Magento\Store\Model\StoreRepository->getActiveStoreById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreResolver.php:181
 Magento\Store\Model\StoreResolver->getDefaultStoreById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreResolver.php:126
 Magento\Store\Model\StoreResolver->getCurrentStoreId() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreManager.php:160
 Magento\Store\Model\StoreManager->getStore() at /home/lubefinder/magento/generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php:119
 Magento\Store\Model\StoreManagerInterface\Proxy->getStore() at /home/lubefinder/magento/vendor/magento/module-store/Model/Resolver/Store.php:30
 Magento\Store\Model\Resolver\Store->getScope() at /home/lubefinder/magento/vendor/magento/framework/App/Config/ScopeCodeResolver.php:49
 Magento\Framework\App\Config\ScopeCodeResolver->resolve() at /home/lubefinder/magento/vendor/magento/framework/App/Config.php:69
 Magento\Framework\App\Config->getValue() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:111
 Magento\Framework\Locale\Resolver->getDefaultLocale() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:129
 Magento\Framework\Locale\Resolver->setLocale() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:83
 Magento\Framework\Locale\Resolver->__construct() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:206
 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:182
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:206
 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:182
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:206
 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:182
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:56
 Magento\Framework\ObjectManager\ObjectManager->create() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:154
 Magento\Framework\Console\Cli->getApplicationCommands() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:135
 Magento\Framework\Console\Cli->getDefaultCommands() at /home/lubefinder/magento/vendor/symfony/console/Application.php:1286
 Symfony\Component\Console\Application->init() at /home/lubefinder/magento/vendor/symfony/console/Application.php:631
 Symfony\Component\Console\Application->find() at /home/lubefinder/magento/vendor/symfony/console/Application.php:237
 Symfony\Component\Console\Application->doRun() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:116
 Magento\Framework\Console\Cli->doRun() at /home/lubefinder/magento/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /home/lubefinder/magento/bin/magento:23

In Abstract.php line 128:

  [PDOException (2002)]                    
  SQLSTATE[HY000] [2002] Invalid argument  

Exception trace:
  at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128
 PDO->__construct() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128
 Zend_Db_Adapter_Pdo_Abstract->_connect() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Mysql.php:111
 Zend_Db_Adapter_Pdo_Mysql->_connect() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:428
 Magento\Framework\DB\Adapter\Pdo\Mysql->_connect() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:460
 Zend_Db_Adapter_Abstract->query() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:238
 Zend_Db_Adapter_Pdo_Abstract->query() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:564
 Magento\Framework\DB\Adapter\Pdo\Mysql->_query() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:634
 Magento\Framework\DB\Adapter\Pdo\Mysql->query() at /home/lubefinder/magento/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:95
 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->query() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737
 Zend_Db_Adapter_Abstract->fetchAll() at /home/lubefinder/magento/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:1085
 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->fetchAll() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:101
 Magento\Store\App\Config\Source\RuntimeConfigSource->getEntities() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:61
 Magento\Store\App\Config\Source\RuntimeConfigSource->get() at /home/lubefinder/magento/vendor/magento/framework/App/Config/ConfigSourceAggregated.php:42
 Magento\Framework\App\Config\ConfigSourceAggregated->get() at /home/lubefinder/magento/generated/code/Magento/Framework/App/Config/ConfigSourceAggregated/Proxy.php:95
 Magento\Framework\App\Config\ConfigSourceAggregated\Proxy->get() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Type/Scopes.php:63
 Magento\Store\App\Config\Type\Scopes->get() at /home/lubefinder/magento/vendor/magento/framework/App/Config.php:132
 Magento\Framework\App\Config->get() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreRepository.php:106
 Magento\Store\Model\StoreRepository->getById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreRepository.php:127
 Magento\Store\Model\StoreRepository->getActiveStoreById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreResolver.php:181
 Magento\Store\Model\StoreResolver->getDefaultStoreById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreResolver.php:126
 Magento\Store\Model\StoreResolver->getCurrentStoreId() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreManager.php:160
 Magento\Store\Model\StoreManager->getStore() at /home/lubefinder/magento/generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php:119
 Magento\Store\Model\StoreManagerInterface\Proxy->getStore() at /home/lubefinder/magento/vendor/magento/module-store/Model/Resolver/Store.php:30
 Magento\Store\Model\Resolver\Store->getScope() at /home/lubefinder/magento/vendor/magento/framework/App/Config/ScopeCodeResolver.php:49
 Magento\Framework\App\Config\ScopeCodeResolver->resolve() at /home/lubefinder/magento/vendor/magento/framework/App/Config.php:69
 Magento\Framework\App\Config->getValue() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:111
 Magento\Framework\Locale\Resolver->getDefaultLocale() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:129
 Magento\Framework\Locale\Resolver->setLocale() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:83
 Magento\Framework\Locale\Resolver->__construct() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:206
 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:182
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:206
 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:182
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:206
 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:182
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276
 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:56
 Magento\Framework\ObjectManager\ObjectManager->create() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:154
 Magento\Framework\Console\Cli->getApplicationCommands() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:135
 Magento\Framework\Console\Cli->getDefaultCommands() at /home/lubefinder/magento/vendor/symfony/console/Application.php:1286
 Symfony\Component\Console\Application->init() at /home/lubefinder/magento/vendor/symfony/console/Application.php:631
 Symfony\Component\Console\Application->find() at /home/lubefinder/magento/vendor/symfony/console/Application.php:237
 Symfony\Component\Console\Application->doRun() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:116
 Magento\Framework\Console\Cli->doRun() at /home/lubefinder/magento/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /home/lubefinder/magento/bin/magento:23

Additional information

According to https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/deployment/build-system.html?lang=en a connection to the database is not required during the build phase if the config is stored in config.php

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @gwharton. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

gwharton commented 1 year ago

php bin/magento results in the same exact stack trace. So is this something wrong with all cli commands?

1228bdbc118d:~/magento# php bin/magento -vvv
Magento CLI 2.4.5-p1

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help                                     Display help for a command
  list                                     List commands
 admin
  admin:user:create                        Creates an administrator
 i18n
  i18n:collect-phrases                     Discovers phrases in the codebase
  i18n:pack                                Saves language package
 info
  info:adminuri                            Displays the Magento Admin URI
  info:backups:list                        Prints list of available backup files
  info:currency:list                       Displays the list of available currencies
  info:dependencies:show-framework         Shows number of dependencies on Magento framework
  info:dependencies:show-modules           Shows number of dependencies between modules
  info:dependencies:show-modules-circular  Shows number of circular dependencies between modules
  info:language:list                       Displays the list of available language locales
  info:timezone:list                       Displays the list of available timezones
 module
  module:config:status                     Checks the modules configuration in the 'app/etc/config.php' file and reports if they are up to date or not
  module:disable                           Disables specified modules
  module:enable                            Enables specified modules
  module:status                            Displays status of modules
  module:uninstall                         Uninstalls modules installed by composer
 setup
  setup:backup                             Takes backup of Magento Application code base, media and database
  setup:config:set                         Creates or modifies the deployment configuration
  setup:db-data:upgrade                    Installs and upgrades data in the DB
  setup:db-schema:upgrade                  Installs and upgrades the DB schema
  setup:db:status                          Checks if DB schema or data requires upgrade
  setup:di:compile                         Generates DI configuration and all missing classes that can be auto-generated
  setup:install                            Installs the Magento application
  setup:performance:generate-fixtures      Generates fixtures
  setup:rollback                           Rolls back Magento Application codebase, media and database
  setup:static-content:deploy              Deploys static view files
  setup:store-config:set                   Installs the store configuration. Deprecated since 2.2.0. Use config:set instead
  setup:uninstall                          Uninstalls the Magento application
  setup:upgrade                            Upgrades the Magento application, DB data, and schema

In Abstract.php line 144:

  [Zend_Db_Adapter_Exception (2002)]       
  SQLSTATE[HY000] [2002] Invalid argument  

Exception trace:
  at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144
 Zend_Db_Adapter_Pdo_Abstract->_connect() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Mysql.php:111
 Zend_Db_Adapter_Pdo_Mysql->_connect() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:428
 Magento\Framework\DB\Adapter\Pdo\Mysql->_connect() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:460
 Zend_Db_Adapter_Abstract->query() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:238
 Zend_Db_Adapter_Pdo_Abstract->query() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:564
 Magento\Framework\DB\Adapter\Pdo\Mysql->_query() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:634
 Magento\Framework\DB\Adapter\Pdo\Mysql->query() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737
 Zend_Db_Adapter_Abstract->fetchAll() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:101
 Magento\Store\App\Config\Source\RuntimeConfigSource->getEntities() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:61
 Magento\Store\App\Config\Source\RuntimeConfigSource->get() at /home/lubefinder/magento/vendor/magento/framework/App/Config/ConfigSourceAggregated.php:42
 Magento\Framework\App\Config\ConfigSourceAggregated->get() at /home/lubefinder/magento/generated/code/Magento/Framework/App/Config/ConfigSourceAggregated/Proxy.php:95
 Magento\Framework\App\Config\ConfigSourceAggregated\Proxy->get() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Type/Scopes.php:63
 Magento\Store\App\Config\Type\Scopes->get() at /home/lubefinder/magento/vendor/magento/framework/App/Config.php:132
 Magento\Framework\App\Config->get() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreRepository.php:106
 Magento\Store\Model\StoreRepository->getById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreRepository.php:127
 Magento\Store\Model\StoreRepository->getActiveStoreById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreResolver.php:181
 Magento\Store\Model\StoreResolver->getDefaultStoreById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreResolver.php:126
 Magento\Store\Model\StoreResolver->getCurrentStoreId() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreManager.php:160
 Magento\Store\Model\StoreManager->getStore() at /home/lubefinder/magento/generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php:119
 Magento\Store\Model\StoreManagerInterface\Proxy->getStore() at /home/lubefinder/magento/vendor/magento/module-store/Model/Resolver/Store.php:30
 Magento\Store\Model\Resolver\Store->getScope() at /home/lubefinder/magento/vendor/magento/framework/App/Config/ScopeCodeResolver.php:49
 Magento\Framework\App\Config\ScopeCodeResolver->resolve() at /home/lubefinder/magento/vendor/magento/framework/App/Config.php:69
 Magento\Framework\App\Config->getValue() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:111
 Magento\Framework\Locale\Resolver->getDefaultLocale() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:129
 Magento\Framework\Locale\Resolver->setLocale() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:83
 Magento\Framework\Locale\Resolver->__construct() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:108
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:125
 Magento\Framework\ObjectManager\Factory\Compiled->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:86
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:125
 Magento\Framework\ObjectManager\Factory\Compiled->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:86
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:125
 Magento\Framework\ObjectManager\Factory\Compiled->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:86
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:56
 Magento\Framework\ObjectManager\ObjectManager->create() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:154
 Magento\Framework\Console\Cli->getApplicationCommands() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:135
 Magento\Framework\Console\Cli->getDefaultCommands() at /home/lubefinder/magento/vendor/symfony/console/Application.php:1286
 Symfony\Component\Console\Application->init() at /home/lubefinder/magento/vendor/symfony/console/Application.php:631
 Symfony\Component\Console\Application->find() at /home/lubefinder/magento/vendor/symfony/console/Application.php:237
 Symfony\Component\Console\Application->doRun() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:116
 Magento\Framework\Console\Cli->doRun() at /home/lubefinder/magento/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /home/lubefinder/magento/bin/magento:23

In Abstract.php line 128:

  [PDOException (2002)]                    
  SQLSTATE[HY000] [2002] Invalid argument  

Exception trace:
  at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128
 PDO->__construct() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128
 Zend_Db_Adapter_Pdo_Abstract->_connect() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Mysql.php:111
 Zend_Db_Adapter_Pdo_Mysql->_connect() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:428
 Magento\Framework\DB\Adapter\Pdo\Mysql->_connect() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:460
 Zend_Db_Adapter_Abstract->query() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:238
 Zend_Db_Adapter_Pdo_Abstract->query() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:564
 Magento\Framework\DB\Adapter\Pdo\Mysql->_query() at /home/lubefinder/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:634
 Magento\Framework\DB\Adapter\Pdo\Mysql->query() at /home/lubefinder/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737
 Zend_Db_Adapter_Abstract->fetchAll() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:101
 Magento\Store\App\Config\Source\RuntimeConfigSource->getEntities() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Source/RuntimeConfigSource.php:61
 Magento\Store\App\Config\Source\RuntimeConfigSource->get() at /home/lubefinder/magento/vendor/magento/framework/App/Config/ConfigSourceAggregated.php:42
 Magento\Framework\App\Config\ConfigSourceAggregated->get() at /home/lubefinder/magento/generated/code/Magento/Framework/App/Config/ConfigSourceAggregated/Proxy.php:95
 Magento\Framework\App\Config\ConfigSourceAggregated\Proxy->get() at /home/lubefinder/magento/vendor/magento/module-store/App/Config/Type/Scopes.php:63
 Magento\Store\App\Config\Type\Scopes->get() at /home/lubefinder/magento/vendor/magento/framework/App/Config.php:132
 Magento\Framework\App\Config->get() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreRepository.php:106
 Magento\Store\Model\StoreRepository->getById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreRepository.php:127
 Magento\Store\Model\StoreRepository->getActiveStoreById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreResolver.php:181
 Magento\Store\Model\StoreResolver->getDefaultStoreById() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreResolver.php:126
 Magento\Store\Model\StoreResolver->getCurrentStoreId() at /home/lubefinder/magento/vendor/magento/module-store/Model/StoreManager.php:160
 Magento\Store\Model\StoreManager->getStore() at /home/lubefinder/magento/generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php:119
 Magento\Store\Model\StoreManagerInterface\Proxy->getStore() at /home/lubefinder/magento/vendor/magento/module-store/Model/Resolver/Store.php:30
 Magento\Store\Model\Resolver\Store->getScope() at /home/lubefinder/magento/vendor/magento/framework/App/Config/ScopeCodeResolver.php:49
 Magento\Framework\App\Config\ScopeCodeResolver->resolve() at /home/lubefinder/magento/vendor/magento/framework/App/Config.php:69
 Magento\Framework\App\Config->getValue() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:111
 Magento\Framework\Locale\Resolver->getDefaultLocale() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:129
 Magento\Framework\Locale\Resolver->setLocale() at /home/lubefinder/magento/vendor/magento/framework/Locale/Resolver.php:83
 Magento\Framework\Locale\Resolver->__construct() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:108
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:125
 Magento\Framework\ObjectManager\Factory\Compiled->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:86
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:125
 Magento\Framework\ObjectManager\Factory\Compiled->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:86
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:79
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:150
 Magento\Framework\ObjectManager\Factory\Compiled->get() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:125
 Magento\Framework\ObjectManager\Factory\Compiled->parseArray() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php:86
 Magento\Framework\ObjectManager\Factory\Compiled->create() at /home/lubefinder/magento/vendor/magento/framework/ObjectManager/ObjectManager.php:56
 Magento\Framework\ObjectManager\ObjectManager->create() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:154
 Magento\Framework\Console\Cli->getApplicationCommands() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:135
 Magento\Framework\Console\Cli->getDefaultCommands() at /home/lubefinder/magento/vendor/symfony/console/Application.php:1286
 Symfony\Component\Console\Application->init() at /home/lubefinder/magento/vendor/symfony/console/Application.php:631
 Symfony\Component\Console\Application->find() at /home/lubefinder/magento/vendor/symfony/console/Application.php:237
 Symfony\Component\Console\Application->doRun() at /home/lubefinder/magento/vendor/magento/framework/Console/Cli.php:116
 Magento\Framework\Console\Cli->doRun() at /home/lubefinder/magento/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /home/lubefinder/magento/bin/magento:23
madalinignisca commented 1 year ago

Can this issue be opened again? I am very confused for how to prepare a perfect to deploy container with Magento.

I'm on the side that a containerized application must never on deployment change it's state (it's files by "compiling on deployement").

As the steps for:

Also, same would be for a multiserver deployment, what guarantees that all instances will be 100% identical on deployment?

PS: not acceptable any idea with shared filesystem, not accepted in many organisations.

Edit: Adobe documentation gives understanding that all this should be possible, hopping I'm understanding right: https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/deployment/overview.html?lang=en

Build system—One system on which you deploy static assets and compile code for your production system. Because you build these assets on a system not in production, your production system’s downtime is minimized.

Your build system does not have to have Commerce installed on it. It needs only the Commerce code but no database connection is required. Also, your build system does not need to be a physically separate server.

composer setup:di:compile will not even try to run without a fully working magento installation.

From my point of view, having to do build steps on deployment, breaks the Twelve Factor Apps which Magento says it is modelled after.

madalinignisca commented 1 year ago

Found out faster some missing steps.

You need to have config.php, which you can get it with app:config:dump.

Did not find anything in the official docs that dive deeper in this.

I managed to do my "production" build by using this (as a secret in the pipeline, as I saw it contains also some sensitive data), but I'm looking in how to ensure a better workflow, probably by figuring out what is actually only needed from it.

dfelton commented 1 year ago

@madalinignisca & @gwharton Just reading through this and wanted to provide some additional thoughts / observations based off my own experiences in trying to setup a deployment pipeline.

madalinignisca commented 1 year ago

@dfelton in most of corporate systems, even read only access is forbidden to the build system.

Consider the following scenario, often met in SME and Corporations (example):

And I'll highlight again, build system to access even read only production stateful database is anti 12 app factor, which Adobe claims Magento follows.

For myself, after debugging the build system, I managed to get my enhanced config.php and build env.php and all works, but the work I went through to do this, made me realise that in certain corporate environments, such coding practices within Magento, might make it turned down as selected main component, including Adobe Commerce.

PS: the above enforcements where done by INFOSEC departments in both companies.

hostep commented 1 year ago

You guys might be interested in https://github.com/magento/magento2/pull/37424

I feel like it might solve the issue reported here as it has the same stacktrace I noticed in https://github.com/magento/magento2/issues/37409

ihor-sviziev commented 1 year ago

The issue was fixed in https://github.com/magento/magento2/commit/4095595b63a7ce48a7d3a6302395ff75478d3284 (changes from https://github.com/magento/magento2/pull/37424).

dfelton commented 1 year ago

@madalinignisca Just noticing your response. I agree with your sentiment and assertions here. A better wording than "acceptable" in my original comment would have been "I have found it to work with read-only..."

Really glad to see there has been progress on this front though. Thank you for the update @ihor-sviziev.