justbetter / magento2-sentry

Magento 2 module to log to Sentry
MIT License
161 stars 70 forks source link

Fix start errors without database connection #125

Closed fredden closed 6 months ago

fredden commented 9 months ago

Summary

While working on a website which has this module installed, I was unable to import a database with n98-magerun2. Steps to reproduce are as follows:

  1. Start with a running / confirmed-working Magento2 instance
  2. Install this extension via Composer: composer require justbetter/magento2-sentry && bin/magento setup:upgrade
  3. Confirm that Magento still works.
  4. Print out database connection details: n98-magerun2 db:info
  5. Drop the database: n98-magerun2 db:drop Note that this will destroy data; ensure you have a back-up of any valuable information. An alternative here would be to change some database connection details in app/etc/env.php.
  6. Print out database connection details: n98-magerun2 db:info

The actual steps which lead to this discovery are to get a Magento code-base installed, and run n98-magerun2 db:import ... in a fresh / blank environment (in order to create a new staging website). The above steps are enough to show the problem.

Result

Before the changes in this pull request, an exception is thrown.

Exception details including stack trace ``` app@7f7f0307c964:~/html$ vendor/bin/n98-magerun2 db:info -v Magento Core Commands cannot be loaded. Please verify if "bin/magento" is running. Only n98-magerun2 commands are available until the issue is fixed. In Mysql.php line 603: [Magento\Framework\DB\Adapter\TableNotFoundException (1146)] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.mag_theme' doesn't exist, query was: SELECT `main_table`.* FROM `mag_theme` AS `main_table` WHERE (`area` = 'frontend') AND (`theme_path` = 'OnTap/burton') Exception trace: at /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:603 Magento\Framework\DB\Adapter\Pdo\Mysql->_query() at /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:634 Magento\Framework\DB\Adapter\Pdo\Mysql->query() at /var/www/html/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:95 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->query() at /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737 Zend_Db_Adapter_Abstract->fetchAll() at /var/www/html/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:1085 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->fetchAll() at /var/www/html/vendor/magento/framework/Data/Collection/Db/FetchStrategy/Query.php:21 Magento\Framework\Data\Collection\Db\FetchStrategy\Query->fetchAll() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:782 Magento\Framework\Data\Collection\AbstractDb->_fetchAll() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:677 Magento\Framework\Data\Collection\AbstractDb->getData() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:446 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->getData() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:580 Magento\Framework\Data\Collection\AbstractDb->loadWithFilter() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:428 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->loadWithFilter() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:565 Magento\Framework\Data\Collection\AbstractDb->load() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:419 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->load() at /var/www/html/vendor/magento/framework/Data/Collection.php:300 Magento\Framework\Data\Collection->getFirstItem() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:563 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->getFirstItem() at /var/www/html/vendor/magento/module-theme/Model/ResourceModel/Theme/Collection.php:146 Magento\Theme\Model\ResourceModel\Theme\Collection->getThemeByFullPath() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:86 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->getThemeByFullPath() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Proxy.php:151 Magento\Theme\Model\ResourceModel\Theme\Collection\Proxy->getThemeByFullPath() at /var/www/html/vendor/magento/module-theme/Model/Config/Processor/DesignTheme.php:80 Magento\Theme\Model\Config\Processor\DesignTheme->changeThemeFullPathToIdentifier() at /var/www/html/vendor/magento/module-theme/Model/Config/Processor/DesignTheme.php:54 Magento\Theme\Model\Config\Processor\DesignTheme->process() at /var/www/html/generated/code/Magento/Theme/Model/Config/Processor/DesignTheme/Proxy.php:95 Magento\Theme\Model\Config\Processor\DesignTheme\Proxy->process() at /var/www/html/vendor/magento/framework/App/Config/PreProcessorComposite.php:35 Magento\Framework\App\Config\PreProcessorComposite->process() at /var/www/html/vendor/magento/module-config/App/Config/Type/System/Reader.php:60 Magento\Config\App\Config\Type\System\Reader->read() at /var/www/html/generated/code/Magento/Config/App/Config/Type/System/Reader/Proxy.php:95 Magento\Config\App\Config\Type\System\Reader\Proxy->read() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:395 Magento\Config\App\Config\Type\System->readData() at /var/www/html/vendor/magento/framework/Cache/LockGuardedCacheLoader.php:136 Magento\Framework\Cache\LockGuardedCacheLoader->lockedLoadData() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:281 Magento\Config\App\Config\Type\System->loadDefaultScopeData() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:207 Magento\Config\App\Config\Type\System->getWithParts() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:181 Magento\Config\App\Config\Type\System->get() at /var/www/html/vendor/magento/framework/App/Config.php:132 Magento\Framework\App\Config->get() at /var/www/html/generated/code/Magento/Framework/App/Config/Interceptor.php:50 Magento\Framework\App\Config\Interceptor->get() at /var/www/html/vendor/magento/framework/App/Config.php:80 Magento\Framework\App\Config->getValue() at /var/www/html/generated/code/Magento/Framework/App/Config/Interceptor.php:23 Magento\Framework\App\Config\Interceptor->getValue() at /var/www/html/vendor/justbetter/magento2-sentry/Helper/Data.php:198 JustBetter\Sentry\Helper\Data->collectModuleConfig() at /var/www/html/vendor/justbetter/magento2-sentry/Helper/Data.php:102 JustBetter\Sentry\Helper\Data->__construct() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/Interception/PluginList/PluginList.php:174 Magento\Framework\Interception\PluginList\PluginList->getPlugin() at /var/www/html/vendor/magento/framework/Interception/Interceptor.php:133 N98\Magento\Framework\App\Magerun\Interceptor->Magento\Framework\Interception\{closure}() at /var/www/html/vendor/magento/framework/Interception/Interceptor.php:153 N98\Magento\Framework\App\Magerun\Interceptor->___callPlugins() at /var/www/html/generated/code/N98/Magento/Framework/App/Magerun/Interceptor.php:23 N98\Magento\Framework\App\Magerun\Interceptor->launch() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application/Magento2Initializer.php:63 N98\Magento\Application\Magento2Initializer->init() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php:278 N98\Magento\Application->initMagento() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Util/Console/Helper/MagentoHelper.php:401 N98\Util\Console\Helper\MagentoHelper->initBaseConfig() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Util/Console/Helper/MagentoHelper.php:385 N98\Util\Console\Helper\MagentoHelper->getBaseConfig() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Util/Console/Helper/DatabaseHelper.php:71 N98\Util\Console\Helper\DatabaseHelper->detectDbSettings() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/Database/AbstractDatabaseCommand.php:63 N98\Magento\Command\Database\AbstractDatabaseCommand->detectDbSettings() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/Database/InfoCommand.php:52 N98\Magento\Command\Database\InfoCommand->execute() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Command/Command.php:298 Symfony\Component\Console\Command\Command->run() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/AbstractMagentoCommand.php:249 N98\Magento\Command\AbstractMagentoCommand->run() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php:1058 Symfony\Component\Console\Application->doRunCommand() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php:301 Symfony\Component\Console\Application->doRun() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php:254 N98\Magento\Application->doRun() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php:171 Symfony\Component\Console\Application->run() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php:363 N98\Magento\Application->run() at /var/www/html/vendor/n98/magerun2-dist/n98-magerun2:8 include() at /var/www/html/vendor/bin/n98-magerun2:119 In Mysql.php line 109: [Zend_Db_Statement_Exception (42)] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.mag_theme' doesn't exist, query was: SELECT `main_table`.* FROM `mag_theme` AS `main_table` WHERE (`area` = 'frontend') AND (`theme_path` = 'OnTap/burton') Exception trace: at /var/www/html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:109 Magento\Framework\DB\Statement\Pdo\Mysql->tryExecute() at /var/www/html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:91 Magento\Framework\DB\Statement\Pdo\Mysql->_execute() at /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php:313 Zend_Db_Statement->execute() at /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:480 Zend_Db_Adapter_Abstract->query() at /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:238 Zend_Db_Adapter_Pdo_Abstract->query() at /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:564 Magento\Framework\DB\Adapter\Pdo\Mysql->_query() at /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:634 Magento\Framework\DB\Adapter\Pdo\Mysql->query() at /var/www/html/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:95 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->query() at /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737 Zend_Db_Adapter_Abstract->fetchAll() at /var/www/html/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:1085 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->fetchAll() at /var/www/html/vendor/magento/framework/Data/Collection/Db/FetchStrategy/Query.php:21 Magento\Framework\Data\Collection\Db\FetchStrategy\Query->fetchAll() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:782 Magento\Framework\Data\Collection\AbstractDb->_fetchAll() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:677 Magento\Framework\Data\Collection\AbstractDb->getData() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:446 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->getData() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:580 Magento\Framework\Data\Collection\AbstractDb->loadWithFilter() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:428 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->loadWithFilter() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:565 Magento\Framework\Data\Collection\AbstractDb->load() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:419 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->load() at /var/www/html/vendor/magento/framework/Data/Collection.php:300 Magento\Framework\Data\Collection->getFirstItem() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:563 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->getFirstItem() at /var/www/html/vendor/magento/module-theme/Model/ResourceModel/Theme/Collection.php:146 Magento\Theme\Model\ResourceModel\Theme\Collection->getThemeByFullPath() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:86 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->getThemeByFullPath() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Proxy.php:151 Magento\Theme\Model\ResourceModel\Theme\Collection\Proxy->getThemeByFullPath() at /var/www/html/vendor/magento/module-theme/Model/Config/Processor/DesignTheme.php:80 Magento\Theme\Model\Config\Processor\DesignTheme->changeThemeFullPathToIdentifier() at /var/www/html/vendor/magento/module-theme/Model/Config/Processor/DesignTheme.php:54 Magento\Theme\Model\Config\Processor\DesignTheme->process() at /var/www/html/generated/code/Magento/Theme/Model/Config/Processor/DesignTheme/Proxy.php:95 Magento\Theme\Model\Config\Processor\DesignTheme\Proxy->process() at /var/www/html/vendor/magento/framework/App/Config/PreProcessorComposite.php:35 Magento\Framework\App\Config\PreProcessorComposite->process() at /var/www/html/vendor/magento/module-config/App/Config/Type/System/Reader.php:60 Magento\Config\App\Config\Type\System\Reader->read() at /var/www/html/generated/code/Magento/Config/App/Config/Type/System/Reader/Proxy.php:95 Magento\Config\App\Config\Type\System\Reader\Proxy->read() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:395 Magento\Config\App\Config\Type\System->readData() at /var/www/html/vendor/magento/framework/Cache/LockGuardedCacheLoader.php:136 Magento\Framework\Cache\LockGuardedCacheLoader->lockedLoadData() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:281 Magento\Config\App\Config\Type\System->loadDefaultScopeData() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:207 Magento\Config\App\Config\Type\System->getWithParts() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:181 Magento\Config\App\Config\Type\System->get() at /var/www/html/vendor/magento/framework/App/Config.php:132 Magento\Framework\App\Config->get() at /var/www/html/generated/code/Magento/Framework/App/Config/Interceptor.php:50 Magento\Framework\App\Config\Interceptor->get() at /var/www/html/vendor/magento/framework/App/Config.php:80 Magento\Framework\App\Config->getValue() at /var/www/html/generated/code/Magento/Framework/App/Config/Interceptor.php:23 Magento\Framework\App\Config\Interceptor->getValue() at /var/www/html/vendor/justbetter/magento2-sentry/Helper/Data.php:198 JustBetter\Sentry\Helper\Data->collectModuleConfig() at /var/www/html/vendor/justbetter/magento2-sentry/Helper/Data.php:102 JustBetter\Sentry\Helper\Data->__construct() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/Interception/PluginList/PluginList.php:174 Magento\Framework\Interception\PluginList\PluginList->getPlugin() at /var/www/html/vendor/magento/framework/Interception/Interceptor.php:133 N98\Magento\Framework\App\Magerun\Interceptor->Magento\Framework\Interception\{closure}() at /var/www/html/vendor/magento/framework/Interception/Interceptor.php:153 N98\Magento\Framework\App\Magerun\Interceptor->___callPlugins() at /var/www/html/generated/code/N98/Magento/Framework/App/Magerun/Interceptor.php:23 N98\Magento\Framework\App\Magerun\Interceptor->launch() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application/Magento2Initializer.php:63 N98\Magento\Application\Magento2Initializer->init() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php:278 N98\Magento\Application->initMagento() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Util/Console/Helper/MagentoHelper.php:401 N98\Util\Console\Helper\MagentoHelper->initBaseConfig() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Util/Console/Helper/MagentoHelper.php:385 N98\Util\Console\Helper\MagentoHelper->getBaseConfig() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Util/Console/Helper/DatabaseHelper.php:71 N98\Util\Console\Helper\DatabaseHelper->detectDbSettings() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/Database/AbstractDatabaseCommand.php:63 N98\Magento\Command\Database\AbstractDatabaseCommand->detectDbSettings() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/Database/InfoCommand.php:52 N98\Magento\Command\Database\InfoCommand->execute() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Command/Command.php:298 Symfony\Component\Console\Command\Command->run() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/AbstractMagentoCommand.php:249 N98\Magento\Command\AbstractMagentoCommand->run() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php:1058 Symfony\Component\Console\Application->doRunCommand() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php:301 Symfony\Component\Console\Application->doRun() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php:254 N98\Magento\Application->doRun() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php:171 Symfony\Component\Console\Application->run() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php:363 N98\Magento\Application->run() at /var/www/html/vendor/n98/magerun2-dist/n98-magerun2:8 include() at /var/www/html/vendor/bin/n98-magerun2:119 In Mysql.php line 90: [PDOException (42S02)] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.mag_theme' doesn't exist Exception trace: at /var/www/html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:90 PDOStatement->execute() at /var/www/html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:90 Magento\Framework\DB\Statement\Pdo\Mysql->Magento\Framework\DB\Statement\Pdo\{closure}() at /var/www/html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:106 Magento\Framework\DB\Statement\Pdo\Mysql->tryExecute() at /var/www/html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:91 Magento\Framework\DB\Statement\Pdo\Mysql->_execute() at /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php:313 Zend_Db_Statement->execute() at /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:480 Zend_Db_Adapter_Abstract->query() at /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:238 Zend_Db_Adapter_Pdo_Abstract->query() at /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:564 Magento\Framework\DB\Adapter\Pdo\Mysql->_query() at /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:634 Magento\Framework\DB\Adapter\Pdo\Mysql->query() at /var/www/html/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:95 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->query() at /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737 Zend_Db_Adapter_Abstract->fetchAll() at /var/www/html/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:1085 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->fetchAll() at /var/www/html/vendor/magento/framework/Data/Collection/Db/FetchStrategy/Query.php:21 Magento\Framework\Data\Collection\Db\FetchStrategy\Query->fetchAll() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:782 Magento\Framework\Data\Collection\AbstractDb->_fetchAll() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:677 Magento\Framework\Data\Collection\AbstractDb->getData() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:446 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->getData() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:580 Magento\Framework\Data\Collection\AbstractDb->loadWithFilter() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:428 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->loadWithFilter() at /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php:565 Magento\Framework\Data\Collection\AbstractDb->load() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:419 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->load() at /var/www/html/vendor/magento/framework/Data/Collection.php:300 Magento\Framework\Data\Collection->getFirstItem() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:563 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->getFirstItem() at /var/www/html/vendor/magento/module-theme/Model/ResourceModel/Theme/Collection.php:146 Magento\Theme\Model\ResourceModel\Theme\Collection->getThemeByFullPath() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Interceptor.php:86 Magento\Theme\Model\ResourceModel\Theme\Collection\Interceptor->getThemeByFullPath() at /var/www/html/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Proxy.php:151 Magento\Theme\Model\ResourceModel\Theme\Collection\Proxy->getThemeByFullPath() at /var/www/html/vendor/magento/module-theme/Model/Config/Processor/DesignTheme.php:80 Magento\Theme\Model\Config\Processor\DesignTheme->changeThemeFullPathToIdentifier() at /var/www/html/vendor/magento/module-theme/Model/Config/Processor/DesignTheme.php:54 Magento\Theme\Model\Config\Processor\DesignTheme->process() at /var/www/html/generated/code/Magento/Theme/Model/Config/Processor/DesignTheme/Proxy.php:95 Magento\Theme\Model\Config\Processor\DesignTheme\Proxy->process() at /var/www/html/vendor/magento/framework/App/Config/PreProcessorComposite.php:35 Magento\Framework\App\Config\PreProcessorComposite->process() at /var/www/html/vendor/magento/module-config/App/Config/Type/System/Reader.php:60 Magento\Config\App\Config\Type\System\Reader->read() at /var/www/html/generated/code/Magento/Config/App/Config/Type/System/Reader/Proxy.php:95 Magento\Config\App\Config\Type\System\Reader\Proxy->read() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:395 Magento\Config\App\Config\Type\System->readData() at /var/www/html/vendor/magento/framework/Cache/LockGuardedCacheLoader.php:136 Magento\Framework\Cache\LockGuardedCacheLoader->lockedLoadData() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:281 Magento\Config\App\Config\Type\System->loadDefaultScopeData() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:207 Magento\Config\App\Config\Type\System->getWithParts() at /var/www/html/vendor/magento/module-config/App/Config/Type/System.php:181 Magento\Config\App\Config\Type\System->get() at /var/www/html/vendor/magento/framework/App/Config.php:132 Magento\Framework\App\Config->get() at /var/www/html/generated/code/Magento/Framework/App/Config/Interceptor.php:50 Magento\Framework\App\Config\Interceptor->get() at /var/www/html/vendor/magento/framework/App/Config.php:80 Magento\Framework\App\Config->getValue() at /var/www/html/generated/code/Magento/Framework/App/Config/Interceptor.php:23 Magento\Framework\App\Config\Interceptor->getValue() at /var/www/html/vendor/justbetter/magento2-sentry/Helper/Data.php:198 JustBetter\Sentry\Helper\Data->collectModuleConfig() at /var/www/html/vendor/justbetter/magento2-sentry/Helper/Data.php:102 JustBetter\Sentry\Helper\Data->__construct() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/Interception/PluginList/PluginList.php:174 Magento\Framework\Interception\PluginList\PluginList->getPlugin() at /var/www/html/vendor/magento/framework/Interception/Interceptor.php:133 N98\Magento\Framework\App\Magerun\Interceptor->Magento\Framework\Interception\{closure}() at /var/www/html/vendor/magento/framework/Interception/Interceptor.php:153 N98\Magento\Framework\App\Magerun\Interceptor->___callPlugins() at /var/www/html/generated/code/N98/Magento/Framework/App/Magerun/Interceptor.php:23 N98\Magento\Framework\App\Magerun\Interceptor->launch() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application/Magento2Initializer.php:63 N98\Magento\Application\Magento2Initializer->init() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php:278 N98\Magento\Application->initMagento() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Util/Console/Helper/MagentoHelper.php:401 N98\Util\Console\Helper\MagentoHelper->initBaseConfig() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Util/Console/Helper/MagentoHelper.php:385 N98\Util\Console\Helper\MagentoHelper->getBaseConfig() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Util/Console/Helper/DatabaseHelper.php:71 N98\Util\Console\Helper\DatabaseHelper->detectDbSettings() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/Database/AbstractDatabaseCommand.php:63 N98\Magento\Command\Database\AbstractDatabaseCommand->detectDbSettings() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/Database/InfoCommand.php:52 N98\Magento\Command\Database\InfoCommand->execute() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Command/Command.php:298 Symfony\Component\Console\Command\Command->run() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/AbstractMagentoCommand.php:249 N98\Magento\Command\AbstractMagentoCommand->run() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php:1058 Symfony\Component\Console\Application->doRunCommand() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php:301 Symfony\Component\Console\Application->doRun() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php:254 N98\Magento\Application->doRun() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php:171 Symfony\Component\Console\Application->run() at phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php:363 N98\Magento\Application->run() at /var/www/html/vendor/n98/magerun2-dist/n98-magerun2:8 include() at /var/www/html/vendor/bin/n98-magerun2:119 db:info [--connection CONNECTION] [--format [FORMAT]] [--] [] app@7f7f0307c964:~/html$ ```

With the changes in this pull request, we can successfully import a database with n98-magerun2.

The changes here include:

The changes in this pull request are best viewed with "ignore white-space" enabled as the indentation of some lines has changes, but their content has not.

royduin commented 6 months ago

@indykoning

indykoning commented 6 months ago

We've released it under 3.5.2 🚀 Thank you for this fix!