← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1837106] [NEW] "socket.getaddrinfo" of "metadata.google.internal" fails on GCE

 

Public bug reported:

When booting an Ubuntu 18.04 based image on GCE, we see the following
messages in the log:

2019-05-30 00:05:27,818 - util.py[DEBUG]: Resolving URL: http://metadata.google.internal/computeMetadata/v1/ took 0.001 seconds
2019-05-30 00:05:27,818 - DataSourceGCE.py[DEBUG]: http://metadata.google.internal/computeMetadata/v1/ is not resolvable
2019-05-30 00:05:27,818 - util.py[DEBUG]: Crawl of GCE metadata service took 0.013 seconds
2019-05-30 00:05:27,818 - DataSourceGCE.py[WARNING]: address "http://metadata.google.internal/computeMetadata/v1/"; is not resolvable 

Further, the contents of "/run/cloud-init/instance-data.json" doesn't
have any meaningful data.

What I've found is that, read_md() in DataSourceGCE.py will call
util.is_resolvable_url() on the address
"http://metadata.google.internal/computeMetadata/v1/";, which results is
calling socket.getaddrinfo() for "metadata.google.internal", and it's
this socket.getaddrinfo() call that fails.

This failure appears to be due to the fact that "cloud-init.service"
does not ensure it waits for DNS (i.e. "systemd-resolved.service") to be
working before it runs. I say this because:

1. If I add "After=systemd-resolved.service" to the "cloud-init.service"
definition, this failures goes away.

2. If I run "cloud-init init" after the system has booted up (i.e. after
enough time has passed, such that DNS is working), the failure doesn't
occur.

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1837106

Title:
  "socket.getaddrinfo" of "metadata.google.internal" fails on GCE

Status in cloud-init:
  New

Bug description:
  When booting an Ubuntu 18.04 based image on GCE, we see the following
  messages in the log:

  2019-05-30 00:05:27,818 - util.py[DEBUG]: Resolving URL: http://metadata.google.internal/computeMetadata/v1/ took 0.001 seconds
  2019-05-30 00:05:27,818 - DataSourceGCE.py[DEBUG]: http://metadata.google.internal/computeMetadata/v1/ is not resolvable
  2019-05-30 00:05:27,818 - util.py[DEBUG]: Crawl of GCE metadata service took 0.013 seconds
  2019-05-30 00:05:27,818 - DataSourceGCE.py[WARNING]: address "http://metadata.google.internal/computeMetadata/v1/"; is not resolvable 

  Further, the contents of "/run/cloud-init/instance-data.json" doesn't
  have any meaningful data.

  What I've found is that, read_md() in DataSourceGCE.py will call
  util.is_resolvable_url() on the address
  "http://metadata.google.internal/computeMetadata/v1/";, which results
  is calling socket.getaddrinfo() for "metadata.google.internal", and
  it's this socket.getaddrinfo() call that fails.

  This failure appears to be due to the fact that "cloud-init.service"
  does not ensure it waits for DNS (i.e. "systemd-resolved.service") to
  be working before it runs. I say this because:

  1. If I add "After=systemd-resolved.service" to the "cloud-
  init.service" definition, this failures goes away.

  2. If I run "cloud-init init" after the system has booted up (i.e.
  after enough time has passed, such that DNS is working), the failure
  doesn't occur.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1837106/+subscriptions


Follow ups