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

Using the new toToml template function crashes tiller #2271

Closed
mattsch opened this issue Apr 13, 2017 · 0 comments · Fixed by #2354
Closed

Using the new toToml template function crashes tiller #2271

mattsch opened this issue Apr 13, 2017 · 0 comments · Fixed by #2354
Assignees

Comments

@mattsch
Copy link

mattsch commented Apr 13, 2017

I'm trying to use toToml to render a simple key/value pair and getting the traceback attached. The template works just fine when using toJson or toYaml, but toToml fails every time.

Template code:

{{ toToml .Values.telegraf.global_tags }}

Relevant values:

telegraf:
  global_tags:
    foo: bar

Traceback:

2017-04-13T13:22:56.286967774Z panic: reflect: call of reflect.Value.NumField on map Value [recovered]
2017-04-13T13:22:56.287034472Z 	panic: reflect: call of reflect.Value.NumField on map Value
2017-04-13T13:22:56.287039565Z 
2017-04-13T13:22:56.287043072Z goroutine 134 [running]:
2017-04-13T13:22:56.287046483Z panic(0x15567c0, 0xc420a14a20)
2017-04-13T13:22:56.287049992Z 	/usr/local/go/src/runtime/panic.go:500 +0x1a1
2017-04-13T13:22:56.287053503Z text/template.errRecover(0xc420b4d100)
2017-04-13T13:22:56.287057143Z 	/usr/local/go/src/text/template/exec.go:146 +0x18e
2017-04-13T13:22:56.287060974Z panic(0x15567c0, 0xc420a14a20)
2017-04-13T13:22:56.287064124Z 	/usr/local/go/src/runtime/panic.go:458 +0x243
2017-04-13T13:22:56.287067615Z reflect.flag.mustBe(0x15, 0x19)
2017-04-13T13:22:56.287070808Z 	/usr/local/go/src/reflect/value.go:201 +0xae
2017-04-13T13:22:56.287084135Z reflect.Value.NumField(0x1576700, 0xc420fa2180, 0x15, 0x2016720)
2017-04-13T13:22:56.287088978Z 	/usr/local/go/src/reflect/value.go:1152 +0x34
2017-04-13T13:22:56.287093279Z k8s.io/helm/vendor/github.com/naoina/toml.marshal(0x0, 0x0, 0x0, 0x0, 0x0, 0x1576700, 0xc420fa2180, 0x15, 0xc420b40000, 0x612041, ...)
2017-04-13T13:22:56.287107048Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/vendor/github.com/naoina/toml/encode.go:77 +0xdc
2017-04-13T13:22:56.287113348Z k8s.io/helm/vendor/github.com/naoina/toml.Marshal(0x1576700, 0xc420fa2180, 0x412815, 0xc420a14a00, 0x10, 0x10, 0xc4204b90e0)
2017-04-13T13:22:56.287116872Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/vendor/github.com/naoina/toml/encode.go:44 +0x95
2017-04-13T13:22:56.287120119Z k8s.io/helm/pkg/chartutil.ToToml(0x1576700, 0xc420fa2180, 0x0, 0x0)
2017-04-13T13:22:56.287123438Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/pkg/chartutil/files.go:200 +0x39
2017-04-13T13:22:56.287126761Z reflect.Value.call(0x151a400, 0x17f9508, 0x13, 0x171ddc5, 0x4, 0xc420a149e0, 0x1, 0x1, 0x14ed6a0, 0xc4206522e0, ...)
2017-04-13T13:22:56.287130312Z 	/usr/local/go/src/reflect/value.go:434 +0x5c8
2017-04-13T13:22:56.287133852Z reflect.Value.Call(0x151a400, 0x17f9508, 0x13, 0xc420a149e0, 0x1, 0x1, 0x200f180, 0xc420ac7800, 0x1542a80)
2017-04-13T13:22:56.287137144Z 	/usr/local/go/src/reflect/value.go:302 +0xa4
2017-04-13T13:22:56.287140914Z text/template.(*state).evalCall(0xc420b4d080, 0x162c180, 0xc42093de60, 0x15, 0x151a400, 0x17f9508, 0x13, 0x200f0c0, 0xc420ac7740, 0xc420515846, ...)
2017-04-13T13:22:56.287144164Z 	/usr/local/go/src/text/template/exec.go:658 +0x530
2017-04-13T13:22:56.287147345Z text/template.(*state).evalFunction(0xc420b4d080, 0x162c180, 0xc42093de60, 0x15, 0xc420ac7770, 0x200f0c0, 0xc420ac7740, 0xc42024d840, 0x2, 0x2, ...)
2017-04-13T13:22:56.287150592Z 	/usr/local/go/src/text/template/exec.go:530 +0x195
2017-04-13T13:22:56.287155452Z text/template.(*state).evalCommand(0xc420b4d080, 0x162c180, 0xc42093de60, 0x15, 0xc420ac7740, 0x0, 0x0, 0x0, 0xc420b4cca8, 0x60e262, ...)
2017-04-13T13:22:56.287158772Z 	/usr/local/go/src/text/template/exec.go:427 +0x6f7
2017-04-13T13:22:56.287161969Z text/template.(*state).evalPipeline(0xc420b4d080, 0x162c180, 0xc42093de60, 0x15, 0xc4201353b0, 0x0, 0x0, 0xc420fa2180)
2017-04-13T13:22:56.287165204Z 	/usr/local/go/src/text/template/exec.go:400 +0xee
2017-04-13T13:22:56.287168343Z text/template.(*state).walk(0xc420b4d080, 0x162c180, 0xc42093de60, 0x15, 0x200ef40, 0xc420ac7830)
2017-04-13T13:22:56.287171528Z 	/usr/local/go/src/text/template/exec.go:226 +0x423
2017-04-13T13:22:56.287174572Z text/template.(*state).walk(0xc420b4d080, 0x162c180, 0xc42093de60, 0x15, 0x200f2a0, 0xc420ac76e0)
2017-04-13T13:22:56.287177738Z 	/usr/local/go/src/text/template/exec.go:234 +0x13d
2017-04-13T13:22:56.287180694Z text/template.(*state).walkIfOrWith(0xc420b4d080, 0xa, 0x162c180, 0xc42093de60, 0x15, 0xc420453f90, 0xc420ac76e0, 0x0)
2017-04-13T13:22:56.287183824Z 	/usr/local/go/src/text/template/exec.go:264 +0x1d0
2017-04-13T13:22:56.287186749Z text/template.(*state).walk(0xc420b4d080, 0x162c180, 0xc42093de60, 0x15, 0x200f240, 0xc42025d580)
2017-04-13T13:22:56.287189818Z 	/usr/local/go/src/text/template/exec.go:231 +0x2e8
2017-04-13T13:22:56.287199959Z text/template.(*state).walk(0xc420b4d080, 0x162c180, 0xc42093de60, 0x15, 0x200f2a0, 0xc420ac7140)
2017-04-13T13:22:56.287203312Z 	/usr/local/go/src/text/template/exec.go:234 +0x13d
2017-04-13T13:22:56.287206309Z text/template.(*Template).execute(0xc42025ca80, 0x1ff6d80, 0xc4201ea770, 0x162c180, 0xc42093de60, 0x0, 0x0)
2017-04-13T13:22:56.287209692Z 	/usr/local/go/src/text/template/exec.go:189 +0x204
2017-04-13T13:22:56.287212628Z text/template.(*Template).Execute(0xc42025ca80, 0x1ff6d80, 0xc4201ea770, 0x162c180, 0xc42093de60, 0x0, 0x0)
2017-04-13T13:22:56.287215838Z 	/usr/local/go/src/text/template/exec.go:175 +0x53
2017-04-13T13:22:56.287219069Z text/template.(*Template).ExecuteTemplate(0xc420813300, 0x1ff6d80, 0xc4201ea770, 0xc420fa2630, 0x2e, 0x162c180, 0xc42093de60, 0xc4209b1000, 0x705)
2017-04-13T13:22:56.287222388Z 	/usr/local/go/src/text/template/exec.go:165 +0xb3
2017-04-13T13:22:56.287225381Z k8s.io/helm/pkg/engine.(*Engine).render(0xc4201fc010, 0xc420fa2240, 0xc420fa2240, 0xc42087d085, 0xc420fa4788)
2017-04-13T13:22:56.287228978Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/pkg/engine/engine.go:199 +0xbdc
2017-04-13T13:22:56.287232045Z k8s.io/helm/pkg/engine.(*Engine).Render(0xc4201fc010, 0xc420402420, 0xc42093de60, 0xc4201fc010, 0x2066320, 0x454b90)
2017-04-13T13:22:56.287235263Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/pkg/engine/engine.go:117 +0x4d
2017-04-13T13:22:56.287238804Z k8s.io/helm/pkg/tiller.(*ReleaseServer).renderResources(0xc4203d98a0, 0xc420402420, 0xc42093de60, 0xc42093dda0, 0xc42000bb60, 0xc420124630, 0x7, 0x100, 0x1, 0xc4202c7420, ...)
2017-04-13T13:22:56.287242184Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/pkg/tiller/release_server.go:781 +0x99
2017-04-13T13:22:56.287245254Z k8s.io/helm/pkg/tiller.(*ReleaseServer).prepareRelease(0xc4203d98a0, 0xc420402360, 0xc420af6140, 0x1, 0xc420124730)
2017-04-13T13:22:56.287248448Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/pkg/tiller/release_server.go:714 +0x21d
2017-04-13T13:22:56.287251703Z k8s.io/helm/pkg/tiller.(*ReleaseServer).InstallRelease(0xc4203d98a0, 0x7f527efed9d8, 0xc420159710, 0xc420402360, 0x2010860, 0x18, 0x18)
2017-04-13T13:22:56.287254999Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/pkg/tiller/release_server.go:647 +0x4d
2017-04-13T13:22:56.287258912Z k8s.io/helm/pkg/proto/hapi/services._ReleaseService_InstallRelease_Handler.func1(0x7f527efed9d8, 0xc420159710, 0x15faf80, 0xc420402360, 0xc420386100, 0xc420124470, 0xc42099ba90, 0x411d48)
2017-04-13T13:22:56.287262324Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/pkg/proto/hapi/services/tiller.pb.go:849 +0xa2
2017-04-13T13:22:56.287266343Z k8s.io/helm/pkg/tiller.newUnaryInterceptor.func1(0x7f527efed9d8, 0xc420159710, 0x15faf80, 0xc420402360, 0xc4202e66a0, 0xc4202e66c0, 0x6e26, 0xc4207eab38, 0x0, 0xc4207eab28)
2017-04-13T13:22:56.287269999Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/pkg/tiller/server.go:58 +0x18c
2017-04-13T13:22:56.287273195Z k8s.io/helm/pkg/proto/hapi/services._ReleaseService_InstallRelease_Handler(0x16e0640, 0xc4203d98a0, 0x7f527efed9d8, 0xc420159710, 0xc420af60a0, 0x17f96d0, 0x0, 0x0, 0x0, 0x0)
2017-04-13T13:22:56.287279308Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/pkg/proto/hapi/services/tiller.pb.go:851 +0x166
2017-04-13T13:22:56.287282699Z k8s.io/helm/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc4203860c0, 0x2010860, 0xc420808240, 0xc4200b6c30, 0xc42015dd40, 0x2057788, 0xc420159620, 0x0, 0x0)
2017-04-13T13:22:56.287286046Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/vendor/google.golang.org/grpc/server.go:638 +0xc14
2017-04-13T13:22:56.287289483Z k8s.io/helm/vendor/google.golang.org/grpc.(*Server).handleStream(0xc4203860c0, 0x2010860, 0xc420808240, 0xc4200b6c30, 0xc420159620)
2017-04-13T13:22:56.287292829Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/vendor/google.golang.org/grpc/server.go:796 +0x6b0
2017-04-13T13:22:56.287296054Z k8s.io/helm/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc42012a580, 0xc4203860c0, 0x2010860, 0xc420808240, 0xc4200b6c30)
2017-04-13T13:22:56.287299374Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/vendor/google.golang.org/grpc/server.go:449 +0xab
2017-04-13T13:22:56.287302535Z created by k8s.io/helm/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
2017-04-13T13:22:56.287306005Z 	/home/ubuntu/.go_workspace/src/k8s.io/helm/vendor/google.golang.org/grpc/server.go:450 +0xa3
@technosophos technosophos added this to the 2.3.2 - Bug Fixes milestone Apr 13, 2017
@technosophos technosophos self-assigned this Apr 28, 2017
technosophos added a commit to technosophos/k8s-helm that referenced this issue Apr 28, 2017
This fixes a TOML panic by replacing one parser library with another.
The older library did not gracefully handle reflection issues, and so
was prone to panic. The new one is not great, but it doesn't seem to
panic.

Closes helm#2271
technosophos added a commit to technosophos/k8s-helm that referenced this issue Apr 28, 2017
This fixes a TOML panic by replacing one parser library with another.
The older library did not gracefully handle reflection issues, and so
was prone to panic. The new one is not great, but it doesn't seem to
panic.

Closes helm#2271
technosophos added a commit to technosophos/k8s-helm that referenced this issue May 1, 2017
This fixes a TOML panic by replacing one parser library with another.
The older library did not gracefully handle reflection issues, and so
was prone to panic. The new one is not great, but it doesn't seem to
panic.

Closes helm#2271
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