Before describing this bug, I need to describe my setup.

* webserver A: main aegir production sites, bunch of sites, connected to:
* database server B: main mysql server, serving the production site
* webserver C: test aegir site, with a local MySQL server

To be clear: C is isolated from A or B and runs its own mysql server.

I made an Aegir backup of site.example.com on webserver A and tried to provision-deploy it on webserver C. A clone of the platform from webserver A was done using drush generate-makefile and drush make (awesome thing). During the provision-deploy, I see the following lines:

Granting privileges to site_1781_0@127.0.0.1 on site_1781_0 [29.24      [notice]
sec, 9.87 MB]
Created site_1781_0 database [29.34 sec, 9.87 MB]                    [success]
Found database dump at                                                 [message]
/var/hostmaster/drupal-6.15-1.0-prod/sites/sitetest.example.com/database.sql.
[29.34 sec, 9.87 MB]
Database dump at                                                       [message]
/var/hostmaster/drupal-6.15-1.0-prod/sites/sitetest.example.com/database.sql
is readable [29.34 sec, 9.87 MB]
Importing database using command: mysql --defaults-file=/dev/fd/3       [notice]
site_1781_0 [29.34 sec, 9.87 MB]
Database import failed: ERROR 1045 (28000): Access denied for user   [error]
'site_1781_0'@'192.168.0.122' (using password: YES)
 [30.05 sec, 9.88 MB]
An error occurred at function :                                      [error]
drush_provision_mysql_provision_deploy [30.05 sec, 9.87 MB]
Dropping database site_1781_0 [30.05 sec, 9.88 MB]                      [notice]
Revoking privileges of site_1781_0@127.0.0.1 from site_1781_0 [30.05    [notice]
sec, 9.88 MB]

Provision was called as such:

 drush provision-deploy sitetest.example.com ~anarcat/site.example.com-20100125.201505.tar.gz --debug

Quite recent HEAD on both installs, a bit more recent on server C.

Comments

anarcat’s picture

Status: Active » Needs work
Issue tags: +multiserver

So the trick here is to specify a db_host on the commandline, as such:

drush provision-deploy sitetest.example.com ~anarcat/site.example.com-20100125.201505.tar.gz --debug --db_host=127.0.0.1

Shouldn't we use the database from the platform? It's not as if we had access to anything else in the first place...

Also consider how this relates to #605414: multiple database server support.

adrian’s picture

This will be resolved by -

#723288: Introduce the concept of 'shortnames' for all major entities.

Aegir will manage individual records for each of the servers it would need to connect to.

So it would be

[?
drush platformid provision-deploy url.com tarball --db_server=dbalias
?]

adrian’s picture

That's for the next alpha.

adrian’s picture

Status: Needs work » Fixed

This works in head.

The db_server is stred inside the site alias, and is maintained when migrating.

Status: Fixed » Closed (fixed)
Issue tags: -multiserver

Automatically closed -- issue fixed for 2 weeks with no activity.