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

Converting terraform-aws-github-runner: panic: must not call MapVal with empty map #1053

Closed
justinvp opened this issue May 1, 2023 · 1 comment
Assignees
Labels
area/tf2pulumi Issues in pkg/tf2pulumi, which converts HCL to Pulumi code kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@justinvp
Copy link
Member

justinvp commented May 1, 2023

Using the latest bits, I'm getting the following panic converting https://github.com/philips-labs/terraform-aws-github-runner:

panic: must not call MapVal with empty map

goroutine 56 [running]:

github.com/zclconf/go-cty/cty.MapVal(0x1065bc450?)

	/Users/justin/go/pkg/mod/github.com/zclconf/go-cty@v1.13.1/cty/value_init.go:211 +0x464

github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tf2pulumi/convert.camelCaseObjectAttributes({{{0x1065bc450?, 0x14000b51a80?}}, {0x10624c820?, 0x140007b3950?}})

	/Users/justin/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.43.1-0.20230427084552-7c063858d2f5/pkg/tf2pulumi/convert/tf.go:1475 +0x530

github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tf2pulumi/convert.convertVariable(0x1062460a0?, 0x140022a0180?, 0x140009b4820)

	/Users/justin/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.43.1-0.20230427084552-7c063858d2f5/pkg/tf2pulumi/convert/tf.go:1505 +0x234

github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tf2pulumi/convert.translateModuleSourceCode(0x106241b40?, {0x1065c4e40, 0x107595dc8}, {0x1400049d040, 0x4d}, {0x1065c4dc0?, 0x140005f64e0?}, {0x140009473d0, 0xc}, {0x1065a0cc0, ...})

	/Users/justin/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.43.1-0.20230427084552-7c063858d2f5/pkg/tf2pulumi/convert/tf.go:2443 +0x14e4

github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tf2pulumi/convert.translateModuleSourceCode(0x140003cef30?, {0x1065c4e40, 0x107595dc8}, {0x1400035a280, 0x41}, {0x1065c4dc0?, 0x140005f64e0?}, {0x105ff32d0, 0x1}, {0x1065a0cc0, ...})

	/Users/justin/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.43.1-0.20230427084552-7c063858d2f5/pkg/tf2pulumi/convert/tf.go:2263 +0x3c6c

github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tf2pulumi/convert.TranslateModule(...)

	/Users/justin/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.43.1-0.20230427084552-7c063858d2f5/pkg/tf2pulumi/convert/tf.go:2523

main.(*tfConverter).ConvertProgram(0x14000ab17b8, {0x104e515fc?, 0x40?}, 0x1400050e420)

	/Users/justin/go/src/github.com/pulumi/pulumi-converter-terraform/cmd/pulumi-converter-terraform/main.go:53 +0x1c8

github.com/pulumi/pulumi/sdk/v3/proto/go._Converter_ConvertProgram_Handler.func1({0x1065b9350, 0x140005f4d20}, {0x10643b260?, 0x1400050e420})

	/Users/justin/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.65.1/proto/go/converter_grpc.pb.go:122 +0x74

github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x1065b9350, 0x140005f49c0}, {0x10643b260, 0x1400050e420}, 0x140005f61e0, 0x140005e8390)

	/Users/justin/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x308

github.com/pulumi/pulumi/sdk/v3/proto/go._Converter_ConvertProgram_Handler({0x1062ec9e0?, 0x107595dc8}, {0x1065b9350, 0x140005f49c0}, 0x140008d81c0, 0x140009480e0)

	/Users/justin/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.65.1/proto/go/converter_grpc.pb.go:124 +0x138

google.golang.org/grpc.(*Server).processUnaryRPC(0x14000792780, {0x1065c2e00, 0x14000583380}, 0x14000ac0120, 0x140008a7650, 0x10751e8f8, 0x0)

	/Users/justin/go/pkg/mod/google.golang.org/grpc@v1.54.0/server.go:1345 +0xc90

google.golang.org/grpc.(*Server).handleStream(0x14000792780, {0x1065c2e00, 0x14000583380}, 0x14000ac0120, 0x0)

	/Users/justin/go/pkg/mod/google.golang.org/grpc@v1.54.0/server.go:1722 +0x82c

google.golang.org/grpc.(*Server).serveStreams.func1.2()

	/Users/justin/go/pkg/mod/google.golang.org/grpc@v1.54.0/server.go:966 +0x84

created by google.golang.org/grpc.(*Server).serveStreams.func1

	/Users/justin/go/pkg/mod/google.golang.org/grpc@v1.54.0/server.go:964 +0x28c

return cty.MapVal(modifiedAttributes)

cty.MapVal will panic on empty maps. So will cty.ListVal.

@justinvp justinvp added kind/bug Some behavior is incorrect or out of spec area/tf2pulumi Issues in pkg/tf2pulumi, which converts HCL to Pulumi code labels May 1, 2023
@justinvp justinvp added this to the 0.88 milestone May 1, 2023
@justinvp justinvp self-assigned this May 1, 2023
@justinvp justinvp changed the title Panic converting terraform-aws-github-runner example Converting terraform-aws-github-runner: panic: must not call MapVal with empty map May 1, 2023
@justinvp justinvp added the resolution/fixed This issue was fixed label May 1, 2023
@justinvp
Copy link
Member Author

justinvp commented May 1, 2023

Fixed by #1054

@justinvp justinvp closed this as completed May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tf2pulumi Issues in pkg/tf2pulumi, which converts HCL to Pulumi code kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

1 participant