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
Drush si should not continue if it can't connect to the database; outputs misleading error #511
Comments
Not sure the best way to catch this. I'll think about it. Meanwhile, [5K of HTML barf] is a problem for me too. Drupal should not assume that it is serving an HTML page. |
+1 - same thing happened to me today, but without the "Can't connect to MySQL server" error to clue me in, so I blamed my fresh pull of core and spun my wheels trying to find which recent commit to blame. An underlying issue here is that AlreadyInstalledException is thrown from various places, it would be helpful if core provided a specific hint at each place as to why it thinks Drupal is already installed... |
Core issue: https://www.drupal.org/node/2459671 |
The first time Drush tries to connect to Db we are checking if the target DB exists. The way we do that currently makes it hard to distinguish between DB needing to be created and mysql being unavailable. Needs a little refactor. |
I'm confused...
|
Yes, I get the same error after trying to re-install with "drush si --writable" This may be because setting.php was being overridden from a previous install attempt |
Whats --writable? Thats not in core Drush. |
The same issue still happens when drush fails to delete all tables(sql-drop) before si. In my case this happen because there was way too many tables left after simpletest(~7.2k) and PostgreSQL was running out of memory to wrap transaction |
Seeing this with Drush 10:
|
Yeah, that’s much better, IMO we ca close this. |
It's better, but it's still needlessly doing all this:
|
That’s new logging in Drush 10 that I've found helpful. Installer errors are often hard to debug. This helps a bunch. It also helps identify why Drupal's installer is so slow. Otherwise we hwave a prompt that says nothing for 30 seconds. I suppose they could be info level instead of notice level if these messages bothered more people. |
What I mean is (to quote webchick from years ago) this:
|
Ah, I see. Basically, we don't know if install will succeed at that point. All we know is that we failed to drop existing tables. Often that happens because there is no |
I forgot to say that you can run all but sql:* commands without a |
If someone wants to work on quitting earlier, |
In yet another fabulous display of PEBCAK, today I attempted to use drush si whilst Acquia Dev Desktop was turned off, so there was no MySQL database / Apache process to serve drush's request. drush si of course failed. However, rather than Drush bailing out when it couldn't find the database, it proceeded along anyway, so I ended up getting a Drupal\Core\Installer\Exception\AlreadyInstalledException which sent me down a few rabbit holes before I finally gave up and resigned myself to a manual install through the UI and thereby instantly realized my mistake. :P
Suggestion would be:
The text was updated successfully, but these errors were encountered: