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: interface conversion: interface {} is resource.PropertyMap, not string #1231

Closed
stack72 opened this issue Aug 4, 2020 · 4 comments · Fixed by #1373
Closed

panic: interface conversion: interface {} is resource.PropertyMap, not string #1231

stack72 opened this issue Aug 4, 2020 · 4 comments · Fixed by #1373
Assignees
Labels
impact/panic This bug represents a panic or unexpected crash kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@stack72
Copy link
Contributor

stack72 commented Aug 4, 2020

pulumi:pulumi:Stack (argocd-dev):
    panic: interface conversion: interface {} is resource.PropertyMap, not string
    goroutine 68 [running]:
    github.com/pulumi/pulumi/sdk/v2/go/common/resource.PropertyValue.StringValue(...)
    	/home/travis/gopath/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/go/common/resource/properties.go:362
    github.com/pulumi/pulumi-kubernetes/provider/v2/pkg/provider.parseKubeconfigPropertyValue(0x266aae0, 0xc0004075f0, 0x275d654, 0xa, 0xc0001bf708)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-kubernetes/provider/pkg/provider/util.go:85 +0x169
    github.com/pulumi/pulumi-kubernetes/provider/v2/pkg/provider.(*kubeProvider).DiffConfig(0xc0000e2f00, 0x2a63b40, 0xc000407560, 0xc0006aa0e0, 0xc0000e2f00, 0x251c101, 0xc0006a8480)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-kubernetes/provider/pkg/provider/provider.go:290 +0x5d5
    github.com/pulumi/pulumi/sdk/v2/proto/go._ResourceProvider_DiffConfig_Handler.func1(0x2a63b40, 0xc000407560, 0x268f540, 0xc0006aa0e0, 0x26965c0, 0x3982808, 0x2a63b40, 0xc000407560)
    	/home/travis/gopath/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/proto/go/provider.pb.go:1773 +0x86
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x2a63b40, 0xc000406300, 0x268f540, 0xc0006aa0e0, 0xc0004a4680, 0xc0004a46a0, 0x0, 0x0, 0x2a16720, 0xc0003eaa10)
    	/home/travis/gopath/pkg/mod/github.com/grpc-ecosystem/[email protected]/go/otgrpc/server.go:57 +0x2eb
    github.com/pulumi/pulumi/sdk/v2/proto/go._ResourceProvider_DiffConfig_Handler(0x26e1e40, 0xc0000e2f00, 0x2a63b40, 0xc000406300, 0xc000288180, 0xc0003c2c00, 0x2a63b40, 0xc000406300, 0xc0006c2000, 0xf76)
    	/home/travis/gopath/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/proto/go/provider.pb.go:1775 +0x14b
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001ec680, 0x2a7a5e0, 0xc000093800, 0xc0008b0300, 0xc0002cde60, 0x393d830, 0x0, 0x0, 0x0)
    	/home/travis/gopath/pkg/mod/google.golang.org/[email protected]/server.go:1082 +0x50a
    google.golang.org/grpc.(*Server).handleStream(0xc0001ec680, 0x2a7a5e0, 0xc000093800, 0xc0008b0300, 0x0)
    	/home/travis/gopath/pkg/mod/google.golang.org/[email protected]/server.go:1405 +0xcc9
    google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000462550, 0xc0001ec680, 0x2a7a5e0, 0xc000093800, 0xc0008b0300)
    	/home/travis/gopath/pkg/mod/google.golang.org/[email protected]/server.go:746 +0xa1
    created by google.golang.org/grpc.(*Server).serveStreams.func1
    	/home/travis/gopath/pkg/mod/google.golang.org/[email protected]/server.go:744 +0xa1
@jaxxstorm
Copy link
Contributor

@stack72 and I have both seen this on many Kubernetes resources with the latest provider.

To repro:

  • deploy a new helm chart (or other resource) and do pulumi up - everything will be fine. The one we both deployed was argocd. You can see my repro code here
  • make some modification, like a transformation. Rerun pulumi up. You get the above error

@lukehoban
Copy link
Contributor

lukehoban commented Aug 4, 2020

That stack trace I believe means you passed an object instead of a string to the kubeconfig input on new k8s.Provider.

Of course - it definitely should fail more cleanly, and arguably it should also accept an object as well as a string, but I expect you can workaround by calling JSON.stringify when you pass this in?

That explanation and stack trace don't appear related to the repro steps @jaxxstorm mentions above though - is it possible that those repro steps lead to a different error? (or that they are not actually the exact repro steps that led here?)

@EvanBoyle
Copy link
Contributor

I fixed the panic via #1373 by making the provider handle kubeconfig specified as either string or kubeconfig.

The error happens during DiffConfig deserializing existing kubeconfig that was originally specified as an object. Our EKS library makes it very easy to get into this situation by specifying kubeconfig type as any. Is this intentional or can we tighten this up?

@EvanBoyle
Copy link
Contributor

I opened this issue to track improving the EKS typing for Cluster.kubeconfig pulumi/pulumi-eks#462

@EvanBoyle EvanBoyle reopened this Nov 12, 2020
@leezen leezen modified the milestones: current, 0.47 Nov 18, 2020
@EronWright EronWright added impact/panic This bug represents a panic or unexpected crash kind/bug Some behavior is incorrect or out of spec labels Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/panic This bug represents a panic or unexpected crash kind/bug Some behavior is incorrect or out of spec
Projects
None yet
6 participants