Closed (fixed)
Project:
Provision
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Aug 2010 at 09:21 UTC
Updated:
12 Nov 2010 at 14:00 UTC
Jump to comment: Most recent, Most recent file
I was setting up this server with a local interface (eth1) listening on (say) 10.0.0.1 and I forgot to change my "bind-address" in MySQL so that it listens on that interface, yet the install script happily told me:
master:~$ sh install.sh.txt aegir.master.koumbit.net
==> Aegir HEAD automated install script
==> MySQL is listening on 10.0.0.1.
... so there's clearly something wrong here, either in the wording of that message or in the test.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 894004.patch | 1.38 KB | mig5 |
Comments
Comment #1
anarcat commentedComment #2
Anonymous (not verified) commentedThe error is being lost in the redirection to /dev/null
Remove the 2>&1 and I think that'll be enough to fix, no?
Mig
Comment #3
anarcat commentedwell, we'd see the error, but we're supposed to *catch* it too...
Comment #4
anarcat commentedIn my opinion, this should be done in PHP, so that we have better error feedback.
Comment #5
Anonymous (not verified) commentedSo I have a mysql_connect in install.hostmaster.inc, is there a better drush command to do this (without it trying to bootstrap Drupal)?
It outputs and dies but I suppose the error isn't pretty, and I don't understand the quote() errors from provision's db.drush.inc that we always see when something goes wrong
Comment #6
adrian commentedwe use PDO
Comment #7
Anonymous (not verified) commentedSorry brain fart.
How do we feel about this. I am just blatantly hardcoding mysql as the dbtype here, for the time being, tell me if it could be more elegant.
I guess the other awkward thing is we make the superuser grants in the install.sh script, which might also fail there and press on - but we don't set the --host in those mysql commands, maybe we'd get away with it in most cases..
Example output
Comment #8
anarcat commentedI think you shouldn't use the PDO primitives directly, but rather work with the server object. So you want something like this:
Problem is then you end up with a chicken and egg problem: you can't grant credentials before the db server has been created!
I think our whole approach is flawed here anyways: why are we creating a *new* root user in the first place?! We're asking for root credentials... why not just use that? They should be working, otherwise we can't create the GRANTs anyways!!
So I have created a branch that does just that: it just rips out the grant creation code from install.sh. It also makes hostmaster-install default to "root" instead of "aegir-root" and will prompt the user for a password if missing. This looks something like this:
Maybe the order here is a little wrong but that's not the point. My idea here is to simplify the install.sh to the extreme, so that only very junior users will need it (ie. users that can't download drush and provision themselves).
I am assuming here a lot of people already have drush and can handle downloading one extra package. We could simplify the INSTALL.txt to this:
1. download drush
2. drush dl provision --destination ~/.drush/provision
3. drush hostmaster-install
Everything else is prompted. This way, we could even get totally rid of install.sh (which I recommend, actually).
This code is up on the dev-simplerinstaller branch in git:
http://git.aegirproject.org/?p=provision.git;a=shortlog;h=refs/heads/dev...
... for your review.
Comment #9
anarcat commentedSo here's what the complete output looks like:
Of course that quote() error is horrible and should be destroyed, but we need to fix that anyways. Obviously, the above is a failed call: the mysql server is down...
Comment #10
Anonymous (not verified) commentedSomehow in my previous patch there, I avoided the quote() weird shit, in the way I caught the exception in PDO. It was very clean, maybe something similar needs to be done here (disclaimer: i haven't actually read your modified code here yet)
I don't disagree with anything that's been said here. I do want you guys to be aware that the switching *back* to the old method of saying in the INSTALL.txt to manually download drush and provision will alienate some users (we switched to the install.sh.txt to try and avoid that 'human error' here), it is likely to result in a lot more support requests.
Why, just because of having to download two packages manually first?
Yes, that really is a big hurdle for some users, we learnt that in the 0.3 days.
All the same, both methods work, so why not.
Comment #11
anarcat commentedActually, if you look at the diff with master on that branch, I do update the INSTALL.txt and tell people to manually drush and provision *but* also leave the install.sh instructions in to help them with that.
My objective with 0.4 is to start providing packages for the big three (APT, RPM and... fink?) so that drush and provision are effectively installed automatically. From there INSTALL.txt is actually already installed alongside with provision and we don't even *need* to tell people how to download the thing and install it: that's done for them, and is outside the scope.
Of course while we wait for that to magically happen (ouch), install.sh still has its place.
As for the ugly quote() error, I think this should be caught beforehand and handled better. I've seen that error message elsewhere and it should be fixed because it doesn't say *anything*.
Comment #12
anarcat commentedSo this grew way beyond what I was expecting, but I think it's now much nicer.
After installing this on my laptop, I'm confident that it works better than what we had before, so I merged this into head:
You have seen how a failed install behaves, this is a successful install in all its beauty:
Note that I passed the FQDN and the email on the commandline just to avoid getting prompted for it.
The only thing that's missing right now is that this will wipe existing aliases in .drush: maybe we want to persist the answers across invocations?
Comment #13
anarcat commentedmerged on head, I'm satisfied this is fixed.