[Bug 424065] Re: ec2-init hangs waiting for ec2 meta-data service

David Favor david at davidfavor.com
Sat Sep 5 14:23:23 UTC 2009


Someone's smokin' crack and while under the influence has created this
problem.

In /usr/lib/python2.6/dist-packages/ec2init/__init__.py around line 106
this code exists...

    def wait_for_metadata_service(self):
        timeout = 2
        # This gives us about half an hour before we ultimately bail out
        for x in range(10):
            s = socket.socket()
            try:
                address = '169.254.169.254'
                port = 80
                s.connect((address,port))
                s.close()
                return True
            except socket.error, e:
                time.sleep(timeout)
                timeout = timeout * 2
        return False

Thus 'service ec2-init start' hangs forever trying to connect to the
hard coded address.

Looking back through the code /etc/ec2-init/ec2-config.cfg exists as a
config file, so most likely the developer meant to have this address
(perhaps for an AMI instance) live in the cfg file.

Even this seems a poor choice. Better to have this IP address set
through an environment variable although this is still cumbersome as it
appear the ec2-init service must then be bounced each time interaction
with a different instance is required.

-- 
ec2-init hangs waiting for ec2 meta-data service
https://bugs.launchpad.net/bugs/424065
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list