-
-
Notifications
You must be signed in to change notification settings - Fork 556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent "The specified database connection is not defined: [db_name]" when not installed #3733
Comments
I've just now started to debug this a little bit. I've noticed the error is being triggered in Drupal Core:
So, as you can see the callstack enters Drupal console in #18. As far as I can tell, at that point, commands are not available yet, as they are added in Is this even possible without a big rewrite? |
Fixed with PR #3750 Now is possible to define which command shows the error messages? I defaulted boot error messages to show only on |
Problem
When you're running commands in a Drupal setup which is not installed it will always trigger this error. I think this error should not be triggered since all commands that are available are suited to be run against a uninstalled setup. This error makes it hard to use DC as a automation tool, since in this state you always receive an error.
Use case
For example, I've created a custom command that does some stuff on a non-installed Drupal setup, every time a colleague runs that command they are assuming something went wrong. That's not the case, it's just Drupal Core that's trying to bootstrap and cannot find a
default
database.Suggestion
I'd suggest not showing this error. If there are commands that need to show feedback that they are unable to process or are only partly showing information etc... I think the warning should be more specific. Some practical examples to visualise what I mean:
drupal list
Replace database error and replace with a warning something like:
No installed Drupal setup found, only showing commands that are available in uninstalled state
.drupal multisite:new
Now shows a [OK] message about successfully creating the multisite structure and directly after that shows the database ERROR, which makes no sense as output for this command. Remove the error.
![image](https://user-images.githubusercontent.com/503360/35262775-5a2241e2-0016-11e8-8445-a21aaa6e5cb5.png)
drupal dotenv:init
First shows me a relevant information about files that have been created and then shows the database ERROR, which is irrelevant.
And more...
Those were just some examples, I think that this should be suffice the portrait what I'm saying. 😃
Resolution
drupal list
) add more descriptive warnings.The text was updated successfully, but these errors were encountered: