Here are some notes on recent upgrades I've done using the .debs, and some of the challenges I've faced. Note that the more difficult ones are not vanilla Aegir installs, but have a custom makefile, or Aegir1-style Provision extensions that had to live *in* the 'provision' directory (remote_import). I'm marking this as a 'support request' for the time-being, as at least one of these is due to human error. Also, we may want to move it to the 'Documentation' component at some point...

The hardest one to recover from involved using a custom makefile. Now unfortunately, the way we'd built this makefile was to include aegir.make via raw git output. Unfortunately, it pointed to the 6.x-1.x branch of provision. So we ended up with a 2.x backend and a 1.x frontend. Anyway, needless to say, it took a couple hours to first discover the nature of the mistake, and the fully recover. I don't think there's anything the packaging can do about that, except perhaps a prominent warning to pay special attention to any custom makefiles.

Another one had a failure due to a 'duplicate function definition' error early on in the process, apparently due to remote_import being in the provision directory. This resulted in the site being rolled-back to the 1.x platform, but remaining inaccessible. I suspect this was due to the lack of the link to aegir.conf, since the .deb install didn't complete. Once I moved remote_import out of the way, I could confirm that aegir-provision2 installed properly, but started getting errors during the front-end install:

Executing hosting_server_update_6200                                 [success]
Duplicate entry '1' for key 'PRIMARY'            [warning]
query: UPDATE hosting_ip_addresses SET id=1 WHERE nid=4 AND
ip_address='127.0.0.1' database.mysqli.inc:134
Duplicate entry '2' for key 'PRIMARY'            [warning]
query: UPDATE hosting_ip_addresses SET id=2 WHERE nid=4 AND
ip_address='127.0.0.1' database.mysqli.inc:134
Duplicate entry '3' for key 'PRIMARY'            [warning]
query: UPDATE hosting_ip_addresses SET id=3 WHERE nid=10 AND
ip_address='54.208.11.76' database.mysqli.inc:134
Duplicate entry '4' for key 'PRIMARY'            [warning]
query: UPDATE hosting_ip_addresses SET id=4 WHERE nid=81 AND
ip_address='54.208.16.119' database.mysqli.inc:134
Duplicate entry '5' for key 'PRIMARY'            [warning]
query: UPDATE hosting_ip_addresses SET id=5 WHERE nid=96 AND
ip_address='54.235.219.240' database.mysqli.inc:134
Duplicate entry '6' for key 'PRIMARY'            [warning]
query: UPDATE hosting_ip_addresses SET id=6 WHERE nid=93 AND
ip_address='54.235.219.240' database.mysqli.inc:134
Duplicate entry '7' for key 'PRIMARY'            [warning]
query: UPDATE hosting_ip_addresses SET id=7 WHERE nid=98 AND
ip_address='54.235.219.240' database.mysqli.inc:134
Duplicate entry '8' for key 'PRIMARY'            [warning]
query: UPDATE hosting_ip_addresses SET id=8 WHERE nid=104 AND
ip_address='107.21.249.26' database.mysqli.inc:134
Duplicate entry '9' for key 'PRIMARY'            [warning]
query: UPDATE hosting_ip_addresses SET id=9 WHERE nid=108 AND
ip_address='54.235.219.240' database.mysqli.inc:134
Duplicate entry '10' for key 'PRIMARY'           [warning]
query: UPDATE hosting_ip_addresses SET id=10 WHERE nid=451 AND
ip_address='54.208.11.76' database.mysqli.inc:134
Duplicate entry '11' for key 'PRIMARY'           [warning]
query: UPDATE hosting_ip_addresses SET id=11 WHERE nid=454 AND
ip_address='54.208.11.76' database.mysqli.inc:134
ALTER TABLE {hosting_ip_addresses} DROP INDEX vid                    [success]
ALTER TABLE {hosting_ip_addresses} DROP vid                          [success]
ALTER TABLE {hosting_ip_addresses} ADD `id` INT unsigned             [success]
auto_increment DEFAULT NULL, ADD PRIMARY KEY (id)
ALTER TABLE {hosting_ip_addresses} CHANGE `id` `id` INT unsigned NOT [success]
NULL auto_increment
UPDATE {hosting_ip_addresses} SET id=0 WHERE nid=2 AND               [success]
ip_address='54.208.11.76'
UPDATE {hosting_ip_addresses} SET id=1 WHERE nid=4 AND               [error]
ip_address='127.0.0.1'
UPDATE {hosting_ip_addresses} SET id=2 WHERE nid=4 AND               [error]
ip_address='127.0.0.1'
UPDATE {hosting_ip_addresses} SET id=3 WHERE nid=10 AND              [error]
ip_address='54.208.11.76'
UPDATE {hosting_ip_addresses} SET id=4 WHERE nid=81 AND              [error]
ip_address='54.208.16.119'
UPDATE {hosting_ip_addresses} SET id=5 WHERE nid=96 AND              [error]
ip_address='54.235.219.240'
UPDATE {hosting_ip_addresses} SET id=6 WHERE nid=93 AND              [error]
ip_address='54.235.219.240'
UPDATE {hosting_ip_addresses} SET id=7 WHERE nid=98 AND              [error]
ip_address='54.235.219.240'
UPDATE {hosting_ip_addresses} SET id=8 WHERE nid=104 AND             [error]
ip_address='107.21.249.26'
UPDATE {hosting_ip_addresses} SET id=9 WHERE nid=108 AND             [error]
ip_address='54.235.219.240'
UPDATE {hosting_ip_addresses} SET id=10 WHERE nid=451 AND            [error]
ip_address='54.208.11.76'
UPDATE {hosting_ip_addresses} SET id=11 WHERE nid=454 AND            [error]
ip_address='54.208.11.76'
ALTER TABLE {hosting_ip_addresses} ADD INDEX nid (nid)               [success]
'all' cache was cleared in                                           [success]
/var/aegir/hostmaster-6.x-2.0-rc2#test.poetic.aegirvps.net
Finished performing updates.                                         [ok]
Drush was not able to start (bootstrap) the Drupal database.         [error]
Hint: This may occur when Drush is trying to:
 * bootstrap a site that has not been installed or does not have a
configured database. In this case you can select another site with a
working database setup by specifying the URI to use with the --uri
parameter on the command line. See `drush topic docs-aliases` for
details.

Temporarily commenting-out the following line in hosting_server_update_6200() allowed the install to complete:

$ret[] = update_sql("UPDATE {hosting_ip_addresses} SET id=$i WHERE nid={$row->nid} AND ip_address='{$row->ip_address}'");

All of these upgrades had difficulties with getting the hosting-queued service running, so I'll document that separately.

Comments

anarcat’s picture

This was an upgrade from 1.9?

ergonlogic’s picture

I'd previously updated 1.9->1.10. this happened on the upgrade from 1.10-2.0-rc2

Dane Powell’s picture

I also got the hosting_ip_addresses error on upgrading from 1.10 to 2.0-rc4, and had to use the workaround in OP.

Dane Powell’s picture

Is there any way that this error or workaround could have resulted in #2102455: Frontend missing after upgrade? It's the only significant error I encountered during the upgrade process, so I have to wonder if it's connected.

anarcat’s picture

Status: Active » Postponed (maintainer needs more info)

I don't understand how those ip_addresses errors can happen, looking at the code:

function hosting_server_update_6200() {
  $ret = array();
  db_drop_index($ret, 'hosting_ip_addresses', 'vid');
  db_drop_field($ret, "hosting_ip_addresses", "vid");
  db_add_field($ret, "hosting_ip_addresses", "id", array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('id')));
  $r = db_query("SELECT nid, ip_address FROM {hosting_ip_addresses}");
  for ($i = 0; $row = db_fetch_object($r); $i++) {
    $ret[] = update_sql("UPDATE {hosting_ip_addresses} SET id=$i WHERE nid={$row->nid} AND ip_address='{$row->ip_address}'");
  }
  db_add_index($ret, 'hosting_ip_addresses', 'nid', array('nid'));
  return $ret;
}

the "id" field is *new* - if you get duplicated rows, it's because that code ran twice, and it should have failed at the add_field too, actually.

i am not sure what we can do to help you here. :)

ergonlogic’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Well, I think most of this probably stemmed from the initial problem with the broken custom makefile, and the oddity of having to install some provision extensions within the provision directory itself.

I updated http://community.aegirproject.org/upgrading/path with some additional advice that covers the pitfalls I fell into here, so I'm closing this issue.

j0nathan’s picture

Version: 6.x-2.0-rc2 » 6.x-2.0-rc5
Status: Closed (works as designed) » Active

I am trying to upgrade from 1.10 to 2.0-rc5 and having these "UPDATE hosting_ip_addresses" errors on my local machine with basic aegir installation from debian packages on ubuntu.

I think these errors should be fixed instead of "works as designed". Don't you ?

j0nathan’s picture

I have no custom makefile for aegir.

I don't know why and since when, before the upgrade, the packages for aegir 1.10 where not installed as per synaptic.

Before the upgrade and at this moment too, when I access my local webserver, it shows the page from apache /var/www/index.html instead of my usual aegir frontend.

Actually these packages are installed:

# dpkg -l |grep -i aegir
rc  aegir-hostmaster                                            1.10+246.efcd0a3                           mass Drupal hosting system - frontend
rc  aegir-provision                                             1.10+246.efcd0a3                           mass Drupal hosting system - backend
iF  aegir2-hostmaster                                           2.0~rc5.1                                  mass Drupal hosting system - frontend
ii  aegir2-provision                                            2.0~rc5.1                                  mass Drupal hosting system - backend
ii  kplatforms                                                  8.1.11+0~1382052928.132~1.gbp6cf9e4        kPlatforms - Koumbit Platforms for the Aegir hosting system.

I'm lost.

helmo’s picture

In "iF aegir2-hostmaster", the F stands for "halF-conf". So i guess that something went wrong during the installation of that package. Resulting in a broken/missing hostmaster site.

Does /var/aegir/hostmaster-6.x-2.0-rc5 have a valid drupal installation?

Related?
#2118857: upgrading from 1.x ditches a /var/aegir symlink
#1930670: Duplicate entry 0 for key PRIMARY in hosting_ip_addresses when installing / upgrading

The full logs might help...

j0nathan’s picture

Does /var/aegir/hostmaster-6.x-2.0-rc5 have a valid drupal installation?

It seems so.

$ ls -la /var/aegir/hostmaster-6.x-2.0-rc5.1/
total 248
drwxrwxr-x  9 aegir aegir  4096 Oct 24 11:12 .
drwxr-xr-x 14 aegir aegir  4096 Oct 24 11:12 ..
-rw-rw-r--  1 aegir aegir 46312 Oct 17 11:18 CHANGELOG.txt
-rw-rw-r--  1 aegir aegir  1023 Oct 17 11:18 COPYRIGHT.txt
-rw-rw-r--  1 aegir aegir   206 Oct 17 11:18 cron.php
-rw-rw-r--  1 aegir aegir  4161 Oct 17 11:18 .htaccess
drwxrwxr-x  2 aegir aegir  4096 Oct 24 11:12 includes
-rw-rw-r--  1 aegir aegir   923 Oct 17 11:18 index.php
-rw-rw-r--  1 aegir aegir  1269 Oct 17 11:18 INSTALL.mysql.txt
-rw-rw-r--  1 aegir aegir  1011 Oct 17 11:18 INSTALL.pgsql.txt
-rw-rw-r--  1 aegir aegir 47349 Oct 17 11:18 install.php
-rw-rw-r--  1 aegir aegir 15572 Oct 17 11:18 INSTALL.txt
-rw-rw-r--  1 aegir aegir 18092 Oct 17 11:18 LICENSE.txt
-rw-rw-r--  1 aegir aegir  1867 Oct 17 11:18 MAINTAINERS.txt
drwxrwxr-x  3 aegir aegir  4096 Oct 24 11:12 misc
drwxrwxr-x 35 aegir aegir  4096 Oct 24 11:12 modules
-rw-rw-r--  1 aegir aegir   192 Oct 24 11:12 PATCHES.txt
drwxrwxr-x  4 aegir aegir  4096 Oct 24 11:12 profiles
-rw-rw-r--  1 aegir aegir  1521 Oct 17 11:18 robots.txt
drwxrwxr-x  2 aegir aegir  4096 Oct 24 11:12 scripts
drwxrwxr-x  5 aegir aegir  4096 Oct 25 08:06 sites
drwxrwxr-x  7 aegir aegir  4096 Oct 24 11:12 themes
-rw-rw-r--  1 aegir aegir 26301 Oct 17 11:18 update.php
-rw-rw-r--  1 aegir aegir  4864 Oct 17 11:18 UPGRADE.txt
-rw-rw-r--  1 aegir aegir   294 Oct 17 11:18 xmlrpc.php
$ ls -la /var/aegir/hostmaster-6.x-2.0-rc5.1/sites/mylocalaegir/
total 120
drwxr-xr-x  7 aegir aegir     4096 Oct 25 08:06 .
drwxrwxr-x  5 aegir aegir     4096 Oct 25 08:06 ..
-r--r-----  1 aegir aegir    82449 Oct 25 08:16 drushrc.php
drwxrws--- 10 aegir www-data  4096 Oct 15  2012 files
drwxrwsr-x  2 aegir aegir     4096 Oct 15  2012 libraries
drwxrwsr-x  9 aegir aegir     4096 Jul 18 11:32 modules
drwxrws---  4 aegir www-data  4096 Oct 15  2012 private
-r--r-----  1 aegir www-data  4391 Oct 25 08:15 settings.php
drwxrwsr-x  2 aegir aegir     4096 Oct 15  2012 themes
j0nathan’s picture

I just did "apt-get install aegir2" and now I have access to the aegir frontend.

# dpkg -l |grep -i aegir
rc  aegir-hostmaster                                            1.10+246.efcd0a3                           mass Drupal hosting system - frontend
rc  aegir-provision                                             1.10+246.efcd0a3                           mass Drupal hosting system - backend
ii  aegir2                                                      2.0~rc5.1                                  mass Drupal hosting system
ii  aegir2-hostmaster                                           2.0~rc5.1                                  mass Drupal hosting system - frontend
ii  aegir2-provision                                            2.0~rc5.1                                  mass Drupal hosting system - backend
ii  kplatforms                                                  8.1.11+0~1382052928.132~1.gbp6cf9e4        kPlatforms - Koumbit Platforms for the Aegir hosting system.
j0nathan’s picture

Status: Active » Fixed

It works for me now.
I mark the support request as fixed.
Feel free to reopen if needed.

Status: Fixed » Closed (fixed)

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