ec2-set-apt-sources fails in new us-east-1d availability zone

Bug #387027 reported by Abernix
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EC2 init scripts
Fix Released
Undecided
Unassigned
Ubuntu on EC2
Fix Released
Undecided
Unassigned

Bug Description

This is a bug in Amazon's new us-east-1d availability zone, but I am curious if a change should be made to ec2-set-apt-sources to prevent it. The problem crops up because ec2-set-apt-sources assumes that it will figure out what the current availability zone is. If it doesn't find it, it doesn't have a 'failover' archive that it will use for apt sources.

I am running image 5d59be34, Ubuntu 8.04.2.

See, currently, if you try to get the availability-zone in the new availability zone that was just launched on June 9th (us-east-1d), you will get the following error:

$ curl http://169.254.169.254/latest/meta-data/placement/availability-zone
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html>

This obviously differs from the other zones where you would get:

$ curl http://169.254.169.254/latest/meta-data/placement/availability-zone
us-east-1c

When ec2-set-apt-sources does this it just fails because it does not set the archive successfully. Therefore, when you go to apt-get update, you get errors:

W: GPG error: http://ppa.launchpad.net hardy Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E048451D9EE6D873

If you set a default archive (see attached hack for an example solution), the problem goes away.

So, the question is, should ec2-set-apt-sources have a failover archive and if so, what should it be? My feeling is that it should have at least SOMETHING to ensure that if Amazon does drop the ball with their API (like they currently have), the aptitude functions will still continue to operate properly, even if it is at the cost of transferring data inter-zone or beyond.

Tags: ec2-init
Revision history for this message
Abernix (abernix) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

Thanks for the bug report. It does make sense for there to be a failover archive if amazon doesnt return the right information.

Regards
chuck

Changed in ubuntu-on-ec2:
status: New → Confirmed
tags: added: ec2-init
Soren Hansen (soren)
Changed in ubuntu-on-ec2:
status: Confirmed → Fix Committed
Changed in ec2-init:
status: New → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote :

verified fixed in http://ec2-images.ubuntu.com/karmic/20090811.2/ubuntu-
ec2-karmic-amd64.img.gz (ec2-init 0.4.99-0ubuntu2)

$ dpkg-query --showformat '${version}\n' --show "ec2-init"
0.4.99-0ubuntu2

ec2init/__init__.py now has method get_mirror_from_availability_zone that does:

    def get_mirror_from_availability_zone(self, availability_zone):
        if availability_zone.startswith("us"):
            return 'http://us.ec2.archive.ubuntu.com/ubuntu/'
        elif availability_zone.startswith("eu"):
            return 'http://eu.ec2.archive.ubuntu.com/ubuntu/'

        return 'http://archive.ubuntu.com/ubuntu/'

the above essentially does the same as the listed hack.

I'll just note here, that some debug/apparently-dead code leaked in on this.
   __init__.py has a 'location_archive_map' which is completely unused.

Changed in ubuntu-on-ec2:
status: Fix Committed → Fix Released
Changed in ec2-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.