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

nomad cli panic runtime error if var file does not exist #10567

Closed
resmo opened this issue May 11, 2021 · 3 comments · Fixed by #10569
Closed

nomad cli panic runtime error if var file does not exist #10567

resmo opened this issue May 11, 2021 · 3 comments · Fixed by #10569

Comments

@resmo
Copy link
Contributor

resmo commented May 11, 2021

Nomad version

Output from nomad version
Nomad v1.0.4 (9294f35)

Operating system and Environment details

WSL1 (Debian)

Issue

if the file -var-file does not exist, an panic runtime error is thrown.

Reproduction steps

nomad job plan -var-file=does-no-exist.hcl https://raw.githubusercontent.com/hashicorp/demo-nomad-101/master/lab-2/http-echo.nomad

Expected Result

Proper error message the var file does not exist

Actual Result

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2799a3b]

goroutine 1 [running]:
github.com/hashicorp/nomad/jobspec2.(*jobConfig).collectInputVariableValues(0xc000969420, 0xc000050800, 0x1f, 0x1f, 0xc000216128, 0x1, 0x1, 0xc000581170, 0xc000837800, 0x2, ...)
        github.com/hashicorp/nomad/jobspec2/types.variables.go:548 +0x113b
github.com/hashicorp/nomad/jobspec2.(*jobConfig).decodeBody(0xc000969420, 0x3a4c740, 0xc000421080, 0xc000216120, 0x1, 0x1)
        github.com/hashicorp/nomad/jobspec2/types.config.go:66 +0x245
github.com/hashicorp/nomad/jobspec2.decode(0xc000969420, 0xc000969420, 0x34f6f55)
        github.com/hashicorp/nomad/jobspec2/parse.go:95 +0x258
github.com/hashicorp/nomad/jobspec2.ParseWithConfig(0xc0004209a0, 0xc0004209a0, 0x1f, 0xc0002160e0)
        github.com/hashicorp/nomad/jobspec2/parse.go:44 +0xa8
github.com/hashicorp/nomad/command.(*JobGetter).ApiJobWithArgs(0xc0003afc50, 0x7ffff1ddfa60, 0x57, 0x0, 0x0, 0x0, 0xc0004a9e60, 0x1, 0x1, 0x0, ...)
        github.com/hashicorp/nomad/command/helpers.go:455 +0x41f
github.com/hashicorp/nomad/command.(*JobPlanCommand).Run(0xc0003afba0, 0xc00004e0d0, 0x2, 0x2, 0xc0004a88c0)
        github.com/hashicorp/nomad/command/job_plan.go:145 +0x3e5
github.com/mitchellh/cli.(*CLI).Run(0xc000375540, 0xc000375540, 0xc000118880, 0x37)
        github.com/mitchellh/cli@v1.1.0/cli.go:260 +0x1cf
main.RunCustom(0xc00004e0b0, 0x4, 0x4, 0xc0000b2058)
        github.com/hashicorp/nomad/main.go:142 +0x4a5
main.Run(...)
        github.com/hashicorp/nomad/main.go:87
main.main()
        github.com/hashicorp/nomad/main.go:83 +0x65

Job file (if appropriate)

Nomad Server logs (if appropriate)

Nomad Client logs (if appropriate)

@resmo resmo added the type/bug label May 11, 2021
@drewbailey drewbailey added this to Needs Triage in Nomad - Community Issues Triage via automation May 11, 2021
@drewbailey drewbailey moved this from Needs Triage to In Progress in Nomad - Community Issues Triage May 12, 2021
@drewbailey drewbailey self-assigned this May 12, 2021
@drewbailey
Copy link
Contributor

@resmo sorry you ran into this, thanks for reporting. We'll have a fix shortly

@drewbailey
Copy link
Contributor

@resmo this has been fixed in #10569 and will be included in the next release cycle 1.1.0 beta/rc & 1.0.x backport

@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 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants