Fix start errors without database connection #125
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:composer require justbetter/magento2-sentry && bin/magento setup:upgrade
n98-magerun2 db:info
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 inapp/etc/env.php
.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
With the changes in this pull request, we can successfully import a database with n98-magerun2.
The changes here include:
Magento\Framework\DB\Adapter\TableNotFoundException
when attempting to load configuration values. This is the bug-fix / reason for this pull request.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.