When a remote server is renamed to a new domain, that server's sites also need the db_host value in sites/example.com/drushrc.php changed. This will then update the db_host value in the vhost.

We believe this was causing a mysql connection error:
PDOException: SQLSTATE[HY000] [1129] Host 'old.name.com' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' in lock_may_be_available() (line 167 of /var/aegir/platforms/prod/drupal-7.10-1.3/includes/lock.inc).

Comments

Steven Jones’s picture

Title: renaming server domain doesn't update db_host » Renaming server domain doesn't update db_host
Version: 6.x-1.8 » 6.x-1.9
Component: Drush integration » Code

Good point, maybe we should pick up that the verify task has just renamed the server, and re-verify any sites that use it as a DB server.

ergonlogic’s picture

Version: 6.x-1.9 » 7.x-3.x-dev
Issue summary: View changes

Is this still an issue in Aegir 3.x?

helmo’s picture

Not sure what the status is, but #2072267: Change site database password? might have some usefull hints.

colan’s picture

Just ran into this myself so it's still an issue. I was renaming the DB from db.staging to db.staging.example.com, where the former no longer resolves. Here's the error for findability:

PDOException: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known in lock_may_be_available() (line 167 of /var/aegir/hostmaster-7.x-3.11.2/includes/lock.inc).

To fix manually for each site (after editing and saving the DB server node):

  1. Update the value in the site's drushrc.php.
  2. Run drush @staging.example.com provision-verify.

On the DB server, you then need to run the following:

  use mysql
  UPDATE db SET Host = 'web.staging.example.com' WHERE Host = 'web.staging';
  UPDATE user SET Host = 'web.staging.example.com' WHERE Host = 'web.staging';
  flush privileges;
  flush hosts;