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

0.68.0: go panic w/ multiple bases/layers #623

Closed
bitsofinfo opened this issue May 29, 2019 · 3 comments · Fixed by #625
Closed

0.68.0: go panic w/ multiple bases/layers #623

bitsofinfo opened this issue May 29, 2019 · 3 comments · Fixed by #625

Comments

@bitsofinfo
Copy link
Contributor

continuation of #615

Running same exact scenario as described here:

#615 (comment)

bash-4.4$ ./helmfile -version
helmfile version v0.68.0

bash-4.4$ ./helmfile --log-level debug -f deployments.yaml -n default -e test1 apply

processing file "deployments.yaml" in directory "."
first-pass rendering starting for "deployments.yaml.part.0": inherited=&{test1 map[]}, overrode=<nil>
first-pass uses: &{test1 map[]}
error in first-pass rendering: result of "deployments.yaml.part.0":
 0: bases:
 1:   - envs.yaml
 2:

first-pass produced: &{test1 map[]}
first-pass rendering result of "deployments.yaml.part.0": {test1 map[]}
second-pass rendering result of "deployments.yaml.part.0":
 0: bases:
 1:   - envs.yaml
 2:

first-pass rendering starting for "envs.yaml.part.0": inherited=&{test1 map[]}, overrode=<nil>
first-pass uses: &{test1 map[]}
first-pass produced: &{test1 map[]}
panic: json: unsupported type: map[interface {}]interface {} [recovered]
	panic: json: unsupported type: map[interface {}]interface {}

goroutine 1 [running]:
github.com/urfave/cli.HandleAction.func1(0xc000240de0)
	/go/pkg/mod/github.com/urfave/cli@v0.0.0-20160620154522-6011f165dc28/app.go:474 +0x287
panic(0x14583a0, 0xc000061d30)
	/usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/roboll/helmfile/environment.Environment.DeepCopy(0x7ffeefbffa27, 0x5, 0xc000085c50, 0x13199d1, 0xc000148000, 0x0)
	/home/circleci/workspace/helmfile/environment/environment.go:18 +0x12b
github.com/roboll/helmfile/environment.(*Environment).Merge(0xc00022a6a8, 0x0, 0x14d9408, 0x17, 0xc00023f7e8)
	/home/circleci/workspace/helmfile/environment/environment.go:38 +0x142
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).twoPassRenderTemplateToYaml(0xc000150000, 0xc0001ac0c0, 0x0, 0x14d1ccc, 0x1, 0xc0001ce000, 0x10, 0xc0001cc000, 0x66, 0x266, ...)
	/home/circleci/workspace/helmfile/pkg/app/two_pass_renderer.go:86 +0x133
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).renderTemplatesToYamlWithEnv(...)
	/home/circleci/workspace/helmfile/pkg/app/two_pass_renderer.go:62
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).renderTemplatesToYaml(0xc000150000, 0x14d1ccc, 0x1, 0xc0001ce000, 0x10, 0xc0001cc000, 0x66, 0x266, 0xc0001ac0a0, 0x1, ...)
	/home/circleci/workspace/helmfile/pkg/app/two_pass_renderer.go:58 +0xd2
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).renderAndLoad(0xc000150000, 0x0, 0x0, 0x14d1ccc, 0x1, 0xc0000250f0, 0x9, 0xc0001cc000, 0x66, 0x266, ...)
	/home/circleci/workspace/helmfile/pkg/app/desired_state_file_loader.go:170 +0x6d3
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).loadFileWithOverrides(0xc000150000, 0x0, 0x0, 0x14d1ccc, 0x1, 0xc000024f80, 0x9, 0x0, 0x1974bd8, 0x1, ...)
	/home/circleci/workspace/helmfile/pkg/app/desired_state_file_loader.go:110 +0x1f4
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).loadFile(...)
	/home/circleci/workspace/helmfile/pkg/app/desired_state_file_loader.go:90
github.com/roboll/helmfile/state.(*StateCreator).loadBases(0xc000031680, 0x0, 0xc0001181c0, 0x14d1ccc, 0x1, 0x1, 0xc000152000, 0x10)
	/home/circleci/workspace/helmfile/state/create.go:146 +0xe2
github.com/roboll/helmfile/state.(*StateCreator).ParseAndLoad(0xc000031680, 0xc000142100, 0x15, 0x40, 0x14d1ccc, 0x1, 0xc000152000, 0x10, 0x7ffeefbffa27, 0x5, ...)
	/home/circleci/workspace/helmfile/state/create.go:135 +0xe6
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).load(0xc000150000, 0xc000142100, 0x15, 0x40, 0x14d1ccc, 0x1, 0xc000152000, 0x10, 0xc000158501, 0x0, ...)
	/home/circleci/workspace/helmfile/pkg/app/desired_state_file_loader.go:144 +0x11a
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).renderAndLoad(0xc000150000, 0x0, 0x0, 0x14d1ccc, 0x1, 0xc000152000, 0x10, 0xc000154000, 0x154, 0x354, ...)
	/home/circleci/workspace/helmfile/pkg/app/desired_state_file_loader.go:181 +0x345
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).loadFileWithOverrides(0xc000150000, 0x0, 0x0, 0x14d1ccc, 0x1, 0x7ffeefbffa08, 0x10, 0x1890101, 0x1977848, 0x203000, ...)
	/home/circleci/workspace/helmfile/pkg/app/desired_state_file_loader.go:110 +0x1f4
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).Load(0xc000150000, 0x7ffeefbffa08, 0x10, 0x18a6328, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/circleci/workspace/helmfile/pkg/app/desired_state_file_loader.go:59 +0x473
github.com/roboll/helmfile/pkg/app.(*App).loadDesiredStateFromYaml(0xc00001f7c0, 0x7ffeefbffa08, 0x10, 0xc0000cc4a8, 0x1, 0x1, 0xc0000cc320, 0xc000000000, 0xc0000cc378)
	/home/circleci/workspace/helmfile/pkg/app/app.go:140 +0x1c6
github.com/roboll/helmfile/pkg/app.(*App).VisitDesiredStates.func1(0x7ffeefbffa08, 0x10, 0xc00014e080, 0x7a, 0x0, 0x0)
	/home/circleci/workspace/helmfile/pkg/app/app.go:147 +0xf3
github.com/roboll/helmfile/pkg/app.(*App).visitStateFiles.func1(0x0, 0x0)
	/home/circleci/workspace/helmfile/pkg/app/app.go:111 +0x9a
github.com/roboll/helmfile/pkg/app.(*App).within(0xc00001f7c0, 0x14d1ccc, 0x1, 0xc000031640, 0xc0000cc820, 0x2)
	/home/circleci/workspace/helmfile/pkg/app/app.go:53 +0x722
github.com/roboll/helmfile/pkg/app.(*App).visitStateFiles(0xc00001f7c0, 0x7ffeefbffa08, 0x10, 0xc00006c720, 0x10, 0x1475180)
	/home/circleci/workspace/helmfile/pkg/app/app.go:105 +0x29f
github.com/roboll/helmfile/pkg/app.(*App).VisitDesiredStates(0xc00001f7c0, 0x7ffeefbffa08, 0x10, 0x18a6328, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/circleci/workspace/helmfile/pkg/app/app.go:146 +0xd4
github.com/roboll/helmfile/pkg/app.(*App).VisitDesiredStatesWithReleasesFiltered(0xc00001f7c0, 0x7ffeefbffa08, 0x10, 0xc00000d4a0, 0x10, 0x0)
	/home/circleci/workspace/helmfile/pkg/app/app.go:235 +0x10e
github.com/roboll/helmfile/cmd.FindAndIterateOverDesiredStatesUsingFlagsWithReverse(0xc0000bef00, 0xc00000d400, 0xc00000d480, 0x0, 0xc000085860)
	/home/circleci/workspace/helmfile/cmd/cmd.go:77 +0xe6
main.findAndIterateOverDesiredStatesUsingFlags(...)
	/home/circleci/workspace/helmfile/main.go:633
main.main.func7(0xc0000bef00, 0x0, 0x0)
	/home/circleci/workspace/helmfile/main.go:356 +0x8d
reflect.Value.call(0x14464e0, 0x14efde0, 0x13, 0x14d21a8, 0x4, 0xc0000ccd80, 0x1, 0x1, 0xc000030080, 0x1011bc3, ...)
	/usr/local/go/src/reflect/value.go:447 +0x461
reflect.Value.Call(0x14464e0, 0x14efde0, 0x13, 0xc0000ccd80, 0x1, 0x1, 0xc00008d040, 0xc00008d098, 0x140)
	/usr/local/go/src/reflect/value.go:308 +0xa4
github.com/urfave/cli.HandleAction(0x14464e0, 0x14efde0, 0xc0000bef00, 0x0, 0x0)
	/go/pkg/mod/github.com/urfave/cli@v0.0.0-20160620154522-6011f165dc28/app.go:483 +0x1ff
github.com/urfave/cli.Command.Run(0x14d2666, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14e85ba, 0x3f, 0x0, ...)
	/go/pkg/mod/github.com/urfave/cli@v0.0.0-20160620154522-6011f165dc28/command.go:186 +0x8d1
github.com/urfave/cli.(*App).Run(0xc000001200, 0xc00001e0a0, 0xa, 0xa, 0x0, 0x0)
	/go/pkg/mod/github.com/urfave/cli@v0.0.0-20160620154522-6011f165dc28/app.go:237 +0x601
main.main()
	/home/circleci/workspace/helmfile/main.go:592 +0x21e6
@mumoshu
Copy link
Collaborator

mumoshu commented May 30, 2019

@bitsofinfo Thanks again for the report! I've reproduced it locally, and will fix it soon.

mumoshu added a commit that referenced this issue May 30, 2019
mumoshu added a commit that referenced this issue May 30, 2019
* fix: 0.68.0: go panic w/ multiple bases/layers

Fixes #623

* fix: 0.64.1+: getOrNil/hasKey fails on Environment.Values with nested maps

Fixes #624
@bitsofinfo
Copy link
Contributor Author

verified this now works

@mumoshu
Copy link
Collaborator

mumoshu commented May 31, 2019

Thanks!

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

Successfully merging a pull request may close this issue.

2 participants