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

Panic when planning #134

Closed
mikenomitch opened this issue Oct 20, 2021 · 5 comments
Closed

Panic when planning #134

mikenomitch opened this issue Oct 20, 2021 · 5 comments
Labels

Comments

@mikenomitch
Copy link
Contributor

I get this error when I try to plan a pack. It works properly when rendering and when running though.

➜  pack plan ./packs/promtail

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

goroutine 1 [running]:
github.com/hashicorp/nomad-pack/internal/runner/job.formatTaskGroupDiff({0x0, 0xc0006908a0, 0x0, 0xc00009e618, 0xc000690890, 0x0}, 0x2, 0x0, {0x2036ed8, 0xc00054c8a0})
	/Users/mike/Code/nomad-pack/internal/runner/job/format.go:105 +0x3ab
github.com/hashicorp/nomad-pack/internal/runner/job.formatJobDiff({0xc00009e480, 0xc0006905f0, 0x0, 0xc00009e528, 0xc0006905e0}, 0x0, {0x2036ed8, 0xc00054c8a0})
	/Users/mike/Code/nomad-pack/internal/runner/job/format.go:90 +0x5a5
github.com/hashicorp/nomad-pack/internal/runner/job.(*Runner).outputPlannedJob(0xc00091fb08, {0x2036ed8, 0xc00054c8a0}, 0xc00022ea20, 0xc0004e7a80)
	/Users/mike/Code/nomad-pack/internal/runner/job/plan.go:118 +0xab
github.com/hashicorp/nomad-pack/internal/runner/job.(*Runner).PlanDeployment(0xc000540190, {0x2036ed8, 0xc00054c8a0}, 0xc00009e498)
	/Users/mike/Code/nomad-pack/internal/runner/job/plan.go:57 +0x627
github.com/hashicorp/nomad-pack/cli.(*PlanCommand).Run(0xc00009e1b0, {0xc0000300e0, 0x0, 0x0})
	/Users/mike/Code/nomad-pack/cli/plan.go:104 +0x659
github.com/mitchellh/cli.(*CLI).Run(0xc00012e140)
	/Users/mike/go/pkg/mod/github.com/mitchellh/[email protected]/cli.go:262 +0x5f8
github.com/hashicorp/nomad-pack/cli.Main({0xc0000300c0, 0x3, 0x3})
	/Users/mike/Code/nomad-pack/cli/main.go:94 +0x2ad
main.main()
	/Users/mike/Code/nomad-pack/main.go:12 +0x7f
@jrasell jrasell added stage/accepted theme/runner/job Relates to the internal job runner labels Oct 20, 2021
@jrasell
Copy link
Member

jrasell commented Oct 21, 2021

@mikenomitch thanks for raising the issue, could you provide any additional details on how to reproduce this?

@mikenomitch
Copy link
Contributor Author

I just tried to nomad-pack plan promtail with the code from this PR - hashicorp/nomad-pack-community-registry#46

@groggemans
Copy link

groggemans commented Oct 21, 2021

I had a similar issue where the only difference was the job type (service worked, system failed)
Using this pack; https://github.com/groggemans/nomad-pack-community-registry/tree/feature/prometheus-snmp-exporter-pack/packs/prometheus_snmp_exporter

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

goroutine 1 [running]:
github.com/hashicorp/nomad-pack/internal/runner/job.formatTaskGroupDiff(0xc00078b3e0, 0xc0001f5b20, 0xc00078b440, 0xc00078b560, 0xc0001f5b10, 0x0, 0x0, 0xc0004eb900, 0x1682128, 0xc000114440)
        /home/circleci/project/project/internal/runner/job/format.go:105 +0x30a
github.com/hashicorp/nomad-pack/internal/runner/job.formatJobDiff(0xc00078b1a0, 0xc0001f5680, 0xc00078b230, 0xc00078b2f0, 0xc0001f5670, 0x1669e00, 0x1682128, 0xc000114440)
        /home/circleci/project/project/internal/runner/job/format.go:90 +0x4d6
github.com/hashicorp/nomad-pack/internal/runner/job.(*Runner).outputPlannedJob(0xc000614000, 0x1682128, 0xc000114440, 0xc0007aeea0, 0xc000046a80, 0xc000046a80)
        /home/circleci/project/project/internal/runner/job/plan.go:118 +0x23a
github.com/hashicorp/nomad-pack/internal/runner/job.(*Runner).PlanDeployment(0xc000614000, 0x1682128, 0xc000114440, 0xc000210498, 0x0, 0xc0004b3f90, 0x167ca48, 0xc000614000)
        /home/circleci/project/project/internal/runner/job/plan.go:57 +0x558
github.com/hashicorp/nomad-pack/cli.(*PlanCommand).Run(0xc0002101b0, 0xc0000300b0, 0x1, 0x1, 0xc00060e290)
        /home/circleci/project/project/cli/plan.go:104 +0x99d
github.com/mitchellh/cli.(*CLI).Run(0xc000618140, 0xc0002dfef8, 0xc00000e048, 0x1)
        /go/pkg/mod/github.com/mitchellh/[email protected]/cli.go:262 +0x41a
github.com/hashicorp/nomad-pack/cli.Main(0xc000030090, 0x3, 0x3, 0x0)
        /home/circleci/project/project/cli/main.go:94 +0x225
main.main()
        /home/circleci/project/project/main.go:12 +0xa5

Now I'm only seeming to get this when there is a datacenter configured that doesn't exist in my cluster. (with job type service it doesn't error even with the non existing dc)

@mikenomitch
Copy link
Contributor Author

Anybody have a current repro of this issue?

@mikenomitch
Copy link
Contributor Author

Closing this out as I don't think it is an issue anymore. Please comment if you see the issue on the latest version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants