Problem deploying helm chart with array of hash for values

I’m trying to specify an array of hashes when deploying a helm chart. The yaml looks like this:
myvals:
- name: thefirsthost
token: apitoken1
- name: thesecondhost
token: apitoken2

If I only specify a few of them, I only get the below error for about a minute, and then it goes away and everything works fine. If I drop in 20+, the error never goes away. It seems like the number of errors thrown grows exponentially as I add elements. I’m trying to specify this as key=values in rancher like so:

  • myvals[0].name=thefirsthost
  • myvals[0].token=apitoken1
  • myvals[1].name=thesecondhost
  • myvals[1].token=apitoken2

It feels like the error below is telling me that myvals[0] is null and therefore I can’t access the .name and .token attributes. That makes sense, but I can’t think of another way to specify the overrides in rancher.

Helm template failed. panic: interface conversion: interface {} is nil, not map[string]interface {} goroutine 1 [running]: k8s.io/helm/pkg/strvals.(*parser).listItem(0xc4209537a0, 0xc42091dea0, 0x7, 0x7, 0x3, 0x1, 0x5b, 0x0, 0x0, 0x0)
(there is a slew of other go mess at the end, but the rancher forum isn’t letting me paste it in.

1 Like

Helm template failed. panic: interface conversion: interface {} is nil, not map[string]interface {} goroutine 1 [running]: k8s.io/helm/pkg/strvals.(*parser).listItem(0xc4209537a0, 0xc42091dea0, 0x7, 0x7, 0x3, 0x1, 0x5b, 0x0, 0x0, 0x0) /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/pkg/strvals/parser.go:247 +0xe07 k8s.io/helm/pkg/strvals.(*parser).key(0xc4209537a0, 0xc420903950, 0x0, 0x0) /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/pkg/strvals/parser.go:141 +0xb69 k8s.io/helm/pkg/strvals.(*parser).parse(0xc4209537a0, 0xc42091de30, 0x219) /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/pkg/strvals/parser.go:97 +0x38 k8s.io/helm/pkg/strvals.ParseInto(0x7ffc63112549, 0x219, 0xc420903950, 0x7ffc631124f5, 0x1f) /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/pkg/strvals/parser.go:71 +0xbe main.vals(0x0, 0x0, 0x0, 0xc4202c5b40, 0x1, 0x1, 0x20f3490, 0x0, 0x0, 0x20cfbc0, …) /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/cmd/helm/install.go:364 +0x3d0 main.(*templateCmd).run(0xc42091e0e0, 0xc4209386c0, 0xc42091ddc0, 0x1, 0x7, 0x0, 0x0) /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/cmd/helm/template.go:154 +0x618 main.(*templateCmd).(main.run)-fm(0xc4209386c0, 0xc42091ddc0, 0x1, 0x7, 0x0, 0x0) /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/cmd/helm/template.go:90 +0x52 k8s.io/helm/vendor/github.com/spf13/cobra.(*Command).execute(0xc4209386c0, 0xc42091dd50, 0x7, 0x7, 0xc4209386c0, 0xc42091dd50) /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/vendor/github.com/spf13/cobra/command.go:599 +0x3db k8s.io/helm/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc420804240, 0xc4209386c0, 0xc420938900, 0xc420938b40) /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/vendor/github.com/spf13/cobra/command.go:689 +0x2d4 k8s.io/helm/vendor/github.com/spf13/cobra.(*Command).Execute(0xc420804240, 0x8, 0x8) /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/vendor/github.com/spf13/cobra/command.go:648 +0x2b main.main() /home/darren/.gpath/3ef6bc96094c0cb608fe5ee0babfa6c6abd39686/src/k8s.io/helm/cmd/helm/helm.go:160 +0x75 : exit status 2

I’ve got same error in Rancher v2.1.8 / Rancher-CLI v2.2.0. Is there any workarounds?

The only “workaround” is to hardcode your values into the questions.yaml or values.yaml. I’ve mostly done questions yaml - took the approach of having only a a couple of questions for the person to answer - like “environment” = PRD, QA, DEV. And from that answer, i just assume the values they want. Would love a better workaround.

Rancher team is working on a fix for this. See https://github.com/rancher/rancher/issues/20310

1 Like