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

Backport of client: defer nobody user lookup so Windows doesn't panic into release/1.4.x #14794

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #14790 to be assessed for backporting due to the inclusion of the label backport/1.4.x.

The below text is copied from the body of the original PR.


In #14742 we introduced a cached lookup of the nobody user, which is only ever called on Unixish machines. But the initial caching was being done in an init block, which meant it was being run on Windows as well. This prevents the Nomad agent from starting on Windows.

An alternative fix here would be to have a separate init block for Windows and Unix, but this potentially masks incorrect behavior if we accidentally added a call to the Nobody() method on Windows later. This way we're forced to handle the error in the caller.


Before:

C:\opt> C:\opt\nomad.exe agent -config C:\etc\nomad.d"
panic: unable to lookup the nobody user: No mapping between account names and security IDs was done.

goroutine 1 [running]:
github.com/hashicorp/nomad/helper/users.init.0()
        github.com/hashicorp/nomad/helper/users/lookup.go:28 +0xfd

After:

C:\opt> C:\opt\nomad.exe agent -config C:\etc\nomad.d
==> Loaded configuration from C:\etc\nomad.d\base.hcl, C:\etc\nomad.d\client-windows-0.hcl, C:\etc\no
mad.d\client-windows.hcl, C:\etc\nomad.d\consul.hcl, C:\etc\nomad.d\tls.hcl, C:\etc\nomad.d\vault.hcl
==> Starting Nomad agent...
...

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/user-lookup-windows/remotely-distinct-kingfish branch from 6e502f9 to c9426ed Compare October 4, 2022 15:52
@hc-github-team-nomad-core hc-github-team-nomad-core merged commit 2ef073c into release/1.4.x Oct 4, 2022
@hc-github-team-nomad-core hc-github-team-nomad-core deleted the backport/user-lookup-windows/remotely-distinct-kingfish branch October 4, 2022 15:52
@github-actions
Copy link

github-actions bot commented Feb 3, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants