Skip to content

panic: reflect: call of reflect.Value.Set on zero Value #31750

@tamcore

Description

@tamcore

What happened?

With helm v4.0.5 the example below works just fine. With helm v4.1.0 it ends in a panic.

$ helm template test ./test
panic: reflect: call of reflect.Value.Set on zero Value

goroutine 1 [running]:
reflect.flag.mustBeExportedSlow(0x10?)
	reflect/value.go:232 +0xb8
reflect.flag.mustBeExported(...)
	reflect/value.go:226
reflect.Value.Set({0x10468f4c0?, 0x1400022a7c0?, 0x194?}, {0x0?, 0x0?, 0x1400088b360?})
	reflect/value.go:2126 +0x88
helm.sh/helm/v4/internal/copystructure.copyValue({0x104548f60, 0x1400024d5c0, 0x97})
	helm.sh/helm/v4/internal/copystructure/copystructure.go:96 +0x624
helm.sh/helm/v4/internal/copystructure.copyValue({0x10468f4c0, 0x1400022a7b0, 0x94})
	helm.sh/helm/v4/internal/copystructure/copystructure.go:46 +0x5c
helm.sh/helm/v4/internal/copystructure.copyValue({0x10475ac40, 0x14000715e30, 0x15})
	helm.sh/helm/v4/internal/copystructure/copystructure.go:66 +0x7a8
helm.sh/helm/v4/internal/copystructure.copyValue({0x10468f4c0, 0x1400022a790, 0x94})
	helm.sh/helm/v4/internal/copystructure/copystructure.go:46 +0x5c
helm.sh/helm/v4/internal/copystructure.copyValue({0x10475ac40, 0x140003f2a50, 0x15})
	helm.sh/helm/v4/internal/copystructure/copystructure.go:66 +0x7a8
helm.sh/helm/v4/internal/copystructure.Copy({0x10475ac40?, 0x140003f2a50?})
	helm.sh/helm/v4/internal/copystructure/copystructure.go:30 +0x64
helm.sh/helm/v4/pkg/chart/common/util.coalesceValues(0x104aacb08, {0x10499d960, 0x140001c6680}, 0x140002cb530, {0x0, 0x0}, 0x0)
	helm.sh/helm/v4/pkg/chart/common/util/coalesce.go:212 +0xf8
helm.sh/helm/v4/pkg/chart/common/util.coalesce(0x104aacb08, {0x10499d960, 0x140001c6680}, 0x140002cb530, {0x0, 0x0}, 0x0)
	helm.sh/helm/v4/pkg/chart/common/util/coalesce.go:100 +0x38
helm.sh/helm/v4/pkg/chart/common/util.CoalesceValues({0x10499d960, 0x140001c6680}, 0x14000b05b60)
	helm.sh/helm/v4/pkg/chart/common/util/coalesce.go:50 +0x64
helm.sh/helm/v4/pkg/chart/common/util.ToRenderValuesWithSchemaValidation({0x10499d960, 0x140001c6680}, 0x14000b05b60, {{0x16d784f96, 0x4}, {0x140000f66d0, 0x7}, 0x1, 0x0, 0x1}, ...)
	helm.sh/helm/v4/pkg/chart/common/util/values.go:57 +0x3b0
helm.sh/helm/v4/pkg/action.(*Install).RunWithContext(0x14000182c40, {0x104ad43c8, 0x140005ffc70}, {0x10499d960?, 0x140001c6680?}, 0x14000b05b60)
	helm.sh/helm/v4/pkg/action/install.go:346 +0xcd4
helm.sh/helm/v4/pkg/cmd.runInstall({0x140001a9860, 0x2, 0x2}, 0x14000182c40, 0x140003ecf30, {0x104ab8f48, 0x140001a6028})
	helm.sh/helm/v4/pkg/cmd/install.go:326 +0x668
helm.sh/helm/v4/pkg/cmd.newTemplateCmd.func2(0x14000971b08, {0x140001a9860, 0x2, 0x2})
	helm.sh/helm/v4/pkg/cmd/template.go:108 +0x1fc
github.com/spf13/cobra.(*Command).execute(0x14000971b08, {0x140001a9820, 0x2, 0x2})
	github.com/spf13/cobra@v1.10.2/command.go:1015 +0x7d4
github.com/spf13/cobra.(*Command).ExecuteC(0x140003f4308)
	github.com/spf13/cobra@v1.10.2/command.go:1148 +0x350
github.com/spf13/cobra.(*Command).Execute(0x104ab8f48?)
	github.com/spf13/cobra@v1.10.2/command.go:1071 +0x1c
main.main()
	helm.sh/helm/v4/cmd/helm/helm.go:43 +0x140

What did you expect to happen?

Helm completes successfully

How can we reproduce it (as minimally and precisely as possible)?

mkdir -p test

cat > test/Chart.yaml <<EOC
apiVersion: v2
name: test
version: 0.1.0
EOC

cat > test/values.yaml <<EOC
server:
  extraArgs:
    -
EOC

helm template test ./test

Helm version

Details
$ helm version
version.BuildInfo{Version:"v4.1.0", GitCommit:"4553a0a96e5205595079b6757236cc6f969ed1b9", GitTreeState:"clean", GoVersion:"go1.25.6", KubeClientVersion:"v1.35"}

Kubernetes version

Does not apply

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions