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

[cli] Fix panic while running latest deployment command witch -latest flag #3166

Merged
merged 1 commit into from
Sep 6, 2017

Conversation

pkrolikowski
Copy link

Trying to check latest deployment of a job which has no deployments (no update stanza), nomad fails witch this error

$ nomad job deployments -latest nomad-exporter

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

goroutine 1 [running]:
github.com/hashicorp/nomad/command.formatDeployment(0x0, 0x8, 0xe, 0x0)
	/opt/gopath/src/github.com/hashicorp/nomad/command/deployment_status.go:169 +0x3a
github.com/hashicorp/nomad/command.(*JobDeploymentsCommand).Run(0xc420449880, 0xc420074080, 0x2, 0x2, 0xc4201655f0)
	/opt/gopath/src/github.com/hashicorp/nomad/command/job_deployments.go:138 +0x7b6
github.com/hashicorp/nomad/vendor/github.com/mitchellh/cli.(*CLI).Run(0xc4203eaa20, 0xc4203eaa20, 0x2a, 0x14c84a8)
	/opt/gopath/src/github.com/hashicorp/nomad/vendor/github.com/mitchellh/cli/cli.go:242 +0x229
main.RunCustom(0xc420074060, 0x4, 0x4, 0xc42040f740, 0x0)
	/opt/gopath/src/github.com/hashicorp/nomad/main.go:54 +0xf2d
main.Run(0xc420074060, 0x4, 0x4, 0xc4200001a0)
	/opt/gopath/src/github.com/hashicorp/nomad/main.go:24 +0x56
main.main()
	/opt/gopath/src/github.com/hashicorp/nomad/main.go:20 +0x64

@dadgar
Copy link
Contributor

dadgar commented Sep 6, 2017

Awesome thanks for the PR. I am going to merge and add a test!

@dadgar dadgar merged commit bb578ab into hashicorp:master Sep 6, 2017
@pkrolikowski pkrolikowski deleted the fix-panic-deployment-latest branch September 7, 2017 08:39
@github-actions
Copy link

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 Mar 24, 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.

2 participants