cloud-images should contain libnss-myhostname

Bug #1039213 reported by Lloyd Dewolf
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Wishlist
Unassigned

Bug Description

Upon running 'sudo -i' receive error:
sudo: unable to resolve host myhostname

Warning message appears to be only symptom, ie sudo to root is successful.

ENV: http://cloud-images.ubuntu.com/releases/precise/release/ubuntu-12.04-server-cloudimg-amd64-disk1.img

Also confirmed issue still exists in http://cloud-images.ubuntu.com/releases/12.10/alpha-3/quantal-server-cloudimg-amd64-disk1.img

POSSIBLE SOLUTION

Looks like either need to more generally make 'sudo' use 'localhost' as hostname, or add inserting an entry in '/etc/hosts' for the hostname.

Lloyd Dewolf (lloydde)
description: updated
Revision history for this message
Scott Moser (smoser) wrote :

Hi,
 could you give some information about the environment or cloud that you're running this in?
 Something told cloud-init that your hostname was 'myhostname', and cloud-init set the system's hostname to that value. 'sudo' is merely complaining that it cannot resolve 'myhostname'.

 This is configurable, see the documentation in doc/examples/cloud-config.txt [1]. The default behavior assumes that your "datasource" (which gave cloud-init the value of 'myhostname') will also provide for resolving that value (and thus you would not see the error).

--
[1] http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config.txt

Revision history for this message
Lloyd Dewolf (lloydde) wrote :

Thanks for the speedy response smoser.

This issue reproduces on every version of of OpenStack devstack: Diablo, Essex, and trunk (folsom)

Fedora 15-17 don't exhibit this symptom.

Oh, I see what it is: the cloud image needs 'libnss-myhostname' and in
# /etc/nsswitch.conf
hosts: files dns myhostname

How do I re-route this bug report?

Revision history for this message
Scott Moser (smoser) wrote :

Lloyd,
  Thanks for the bug and the suggestion of libnss-myhostname.
  This would be one solution. In most cases, it would be suitable for you to use one of the cloud-init mechanisms for managing /etc/hosts. I'll leave this bug as "triaged" and change the subject ot mention libnss-myhostname. However, adding this is not something we'd do in a SRU (addressing anything already released) and I dont think terribly important for quantal even given that we have other ways of managing that.

summary: - sudo: unable to resolve host myhostname
+ cloud-images should contain libnss-myhostname
Changed in cloud-init:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Tyler North (ty-north) wrote :

Bug also persists in 13.04-Raring Cloud images.
Downloaded from http://cloud-images.ubuntu.com/raring/current/raring-server-cloudimg-amd64-disk1.img
Tested on Openstack Folsom and Grizzly.

Revision history for this message
goliy (musor-zdes) wrote :

incredible. so old issues and still here. all cloud providers were forced to do workarounds by adding a name into hosts by themselves. Ubuntu, please!

Revision history for this message
Dan Watkins (oddbloke) wrote :

Hi,

Thanks for filing this bug! I wasn't able to reproduce it even in a precise lxd container. Is this still an issue you are seeing in more recent versions of cloud-init? If it is, please do give us steps to reproduce and set this bug back to New.

Thanks!

Dan

Changed in cloud-init:
status: Triaged → Incomplete
Revision history for this message
Scott Moser (smoser) wrote : Re: [Bug 1039213] Re: cloud-images should contain libnss-myhostname

Dan,

You wont' be able to reproduce this in an lxd container. that's
because lxd provides the necessary infrastructure to resolve
'hostname' via dns. Other clouds sometimes do not provide such
infrastructure.

I suspect that you can reproduce this on your "serverstack" (openstack) cloud.

On Wed, Mar 6, 2019 at 5:46 PM Dan Watkins <email address hidden> wrote:
>
> Hi,
>
> Thanks for filing this bug! I wasn't able to reproduce it even in a
> precise lxd container. Is this still an issue you are seeing in more
> recent versions of cloud-init? If it is, please do give us steps to
> reproduce and set this bug back to New.
>
>
> Thanks!
>
> Dan
>
>
> ** Changed in: cloud-init
> Status: Triaged => Incomplete
>
> --
> You received this bug notification because you are subscribed to cloud-
> init.
> https://bugs.launchpad.net/bugs/1039213
>
> Title:
> cloud-images should contain libnss-myhostname
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/cloud-init/+bug/1039213/+subscriptions

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for cloud-init because there has been no activity for 60 days.]

Changed in cloud-init:
status: Incomplete → Expired
Revision history for this message
James Falcon (falcojr) wrote :
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.