Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloud-images should contain libnss-myhostname #2283

Closed
ubuntu-server-builder opened this issue May 9, 2023 · 8 comments
Closed

cloud-images should contain libnss-myhostname #2283

ubuntu-server-builder opened this issue May 9, 2023 · 8 comments
Labels
enhancement New feature or request launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1039213

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = 2019-05-07T04:17:28.478006+00:00
date_created = 2012-08-20T20:36:27.083445+00:00
date_fix_committed = None
date_fix_released = None
id = 1039213
importance = wishlist
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1039213
milestone = None
owner = lloydde
owner_name = Lloyd Dewolf
private = False
status = expired
submitter = lloydde
submitter_name = Lloyd Dewolf
tags = []
duplicates = []

Launchpad user Lloyd Dewolf(lloydde) wrote on 2012-08-20T20:36:27.083445+00:00

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.

@ubuntu-server-builder ubuntu-server-builder added enhancement New feature or request launchpad Migrated from Launchpad labels May 9, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2012-08-21T00:03:20.747164+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Lloyd Dewolf(lloydde) wrote on 2012-08-21T16:43:03.197369+00:00

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?

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2012-09-05T12:27:37.313537+00:00

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.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Tyler North(ty-north) wrote on 2013-07-09T17:20:16.618638+00:00

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.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user goliy(musor-zdes) wrote on 2017-06-05T17:22:59.265807+00:00

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!

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Dan Watkins(oddbloke) wrote on 2019-03-06T22:32:22.895461+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2019-03-07T14:02:55+00:00

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 daniel.watkins@canonical.com 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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Launchpad Janitor(janitor) wrote on 2019-05-07T04:17:28.344006+00:00

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

@ubuntu-server-builder ubuntu-server-builder closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant