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

Non-existant vars file causes nomad run to trigger a segmentation fault #10867

Closed
andrewgwalker opened this issue Jul 8, 2021 · 3 comments
Closed

Comments

@andrewgwalker
Copy link

andrewgwalker commented Jul 8, 2021

Nomad version

Output from nomad version

Nomad v1.0.4+ent (72adb9f)

Operating system and Environment details

Red Hat Enterprise Linux Server release 7.9 (Maipo)

Issue

Trying to run a job from the nomad command line tool produces a segmentation fault when the vars file does not exist.

Reproduction steps

Try and run any job and pass in a var file that does not actually exist e.g

nomad job run --var-file="non_existent_file.vars" workers.nomad

Expected Result

An error message regarding the non-existent vars file.

Actual Result

[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x28cdbbb]

goroutine 1 [running]:
github.com/hashicorp/nomad/jobspec2.(*jobConfig).collectInputVariableValues(0xc0002ae4d0, 0xc000102a80, 0x18, 0x18, 0xc000132f80, 0x1, 0x1, 0xc0004c3140, 0xc00085d790, 0x2, ...)
	github.com/hashicorp/nomad/jobspec2/types.variables.go:548 +0x113b
github.com/hashicorp/nomad/jobspec2.(*jobConfig).decodeBody(0xc0002ae4d0, 0x3cfe020, 0xc000873290, 0xc000132f78, 0x1, 0x1)
	github.com/hashicorp/nomad/jobspec2/types.config.go:66 +0x245
github.com/hashicorp/nomad/jobspec2.decode(0xc0002ae4d0, 0xc0002ae4d0, 0x375f715)
	github.com/hashicorp/nomad/jobspec2/parse.go:95 +0x258
github.com/hashicorp/nomad/jobspec2.ParseWithConfig(0xc0001f6580, 0xc0001f6580, 0x18, 0xc000132a50)
	github.com/hashicorp/nomad/jobspec2/parse.go:44 +0xa8
github.com/hashicorp/nomad/command.(*JobGetter).ApiJobWithArgs(0xc00001f1c0, 0x7ffec9c3d6be, 0xd, 0x0, 0x0, 0x0, 0xc0001a9420, 0x1, 0x1, 0x0, ...)
	github.com/hashicorp/nomad/command/helpers.go:455 +0x41f
github.com/hashicorp/nomad/command.(*JobRunCommand).Run(0xc00001f110, 0xc000136030, 0x2, 0x2, 0xc000453c40)
	github.com/hashicorp/nomad/command/job_run.go:197 +0x6ef
github.com/mitchellh/cli.(*CLI).Run(0xc00015cf00, 0xc00015cf00, 0xc0003ba240, 0x3b)
	github.com/mitchellh/cli@v1.1.0/cli.go:260 +0x1cf
main.RunCustom(0xc000136010, 0x4, 0x4, 0xc00010e058)
	github.com/hashicorp/nomad/main.go:142 +0x496
main.Run(...)
	github.com/hashicorp/nomad/main.go:87
main.main()
	github.com/hashicorp/nomad/main.go:83 +0x65

Job file (if appropriate)

N/A

Nomad Server logs (if appropriate)

Nomad Client logs (if appropriate)

@jrasell jrasell self-assigned this Jul 8, 2021
@jrasell
Copy link
Member

jrasell commented Jul 8, 2021

Hi @andrewgwalker and apologies you ran into this. This issue has been fixed as part of the 1.0.6 and 1.1.0 releases via PR #10569, which I have confirmed locally. Please let me know if you have any follow up questions before I close this issue.

@andrewgwalker
Copy link
Author

@jrasell That's great news! We'll update to the latest version, glad it got fixed.

@jrasell jrasell closed this as completed Jul 8, 2021
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants