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 nil, not map[string]interface {} batch.needsJobDefUpdate #38684

Closed
sasmital opened this issue Aug 5, 2024 · 4 comments · Fixed by #38716
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/batch Issues and PRs that pertain to the batch service.
Milestone

Comments

@sasmital
Copy link

sasmital commented Aug 5, 2024

Terraform Core Version

1.8.0

AWS Provider Version

5.60.0, 5.61.0

Affected Resource(s)

  • aws_batch_job_definition

Expected Behavior

Plan should succeed

Actual Behavior

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 761 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/batch.needsJobDefUpdate(0xc003e70800)

Relevant Error/Panic Output Snippet

Stack trace from the terraform-provider-aws_v5.61.0_x5 plugin:

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 761 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/batch.needsJobDefUpdate(0xc003e70800)
github.com/hashicorp/terraform-provider-aws/internal/service/batch/job_definition.go:569 +0x1074
github.com/hashicorp/terraform-provider-aws/internal/service/batch.jobDefinitionCustomizeDiff({0x13f75fa0?, 0x208b4340?}, 0xc003e70800, {0xe?, 0xc002598340?})
github.com/hashicorp/terraform-provider-aws/internal/service/batch/job_definition.go:464 +0x3a
github.com/hashicorp/terraform-provider-aws/internal/service/batch.ResourceJobDefinition.Sequence.func23({0x170b2cc8, 0xc003cdf080}, 0xc003e70800, {0x14e571c0, 0xc002598340})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/customdiff/compose.go:69 +0x84
github.com/hashicorp/terraform-provider-aws/internal/provider.New.(*wrappedResource).CustomizeDiff.func5({0x170b2cc8?, 0xc0023c5dd0?}, 0xc003e70800, {0x14e571c0, 0xc002598340})
github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:186 +0x63
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc000beb380, {0x170b2cc8, 0xc0023c5dd0}, 0xc001a2f1e0, 0xc0001b51d0, 0xc001078b88, {0x14e571c0, 0xc002598340}, 0x0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/schema.go:698 +0x4b4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x170b30f8?, {0x170b2cc8?, 0xc0023c5dd0?}, 0xc001a2f1e0, 0xc0023c5e00?, {0x14e571c0?, 0xc002598340?})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:990 +0xdb
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).PlanResourceChange(0xc003697068, {0x170b2cc8?, 0xc0023c5ce0?}, 0xc000deda90)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/grpc_provider.go:858 +0xbe8
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).PlanResourceChange(0xc0014921c0, {0x170b2cc8?, 0xc0023c5a10?}, 0xc000deda90)
github.com/hashicorp/terraform-plugin-mux@v0.16.0/tf5muxserver/mux_server_PlanResourceChange.go:73 +0x2ad
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).PlanResourceChange(0xc001997cc0, {0x170b2cc8?, 0xc0023c51d0?}, 0xc0006d3d80)
github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/tf5server/server.go:825 +0x3f0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler({0x14c3fb20, 0xc001997cc0}, {0x170b2cc8, 0xc0023c51d0}, 0xc0006d3d00, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:500 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000a60200, {0x170b2cc8, 0xc0023c5140}, {0x17116620, 0xc000002000}, 0xc001f7c6c0, 0xc0025afd40, 0x208231e0, 0x0)
google.golang.org/grpc@v1.63.2/server.go:1369 +0xdf8
google.golang.org/grpc.(*Server).handleStream(0xc000a60200, {0x17116620, 0xc000002000}, 0xc001f7c6c0)
google.golang.org/grpc@v1.63.2/server.go:1780 +0xe8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/grpc@v1.63.2/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 41
google.golang.org/grpc@v1.63.2/server.go:1030 +0x125

Error: The terraform-provider-aws_v5.61.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Terraform Configuration Files

...terraform config...

Steps to Reproduce

Our apply process occurs in a Terraform Enterprise workspace.

terraform apply

Debug Output

No response

Panic Output

Stack trace from the terraform-provider-aws_v5.61.0_x5 plugin:

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 761 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/batch.needsJobDefUpdate(0xc003e70800)
github.com/hashicorp/terraform-provider-aws/internal/service/batch/job_definition.go:569 +0x1074
github.com/hashicorp/terraform-provider-aws/internal/service/batch.jobDefinitionCustomizeDiff({0x13f75fa0?, 0x208b4340?}, 0xc003e70800, {0xe?, 0xc002598340?})
github.com/hashicorp/terraform-provider-aws/internal/service/batch/job_definition.go:464 +0x3a
github.com/hashicorp/terraform-provider-aws/internal/service/batch.ResourceJobDefinition.Sequence.func23({0x170b2cc8, 0xc003cdf080}, 0xc003e70800, {0x14e571c0, 0xc002598340})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/customdiff/compose.go:69 +0x84
github.com/hashicorp/terraform-provider-aws/internal/provider.New.(*wrappedResource).CustomizeDiff.func5({0x170b2cc8?, 0xc0023c5dd0?}, 0xc003e70800, {0x14e571c0, 0xc002598340})
github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:186 +0x63
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc000beb380, {0x170b2cc8, 0xc0023c5dd0}, 0xc001a2f1e0, 0xc0001b51d0, 0xc001078b88, {0x14e571c0, 0xc002598340}, 0x0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/schema.go:698 +0x4b4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x170b30f8?, {0x170b2cc8?, 0xc0023c5dd0?}, 0xc001a2f1e0, 0xc0023c5e00?, {0x14e571c0?, 0xc002598340?})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:990 +0xdb
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).PlanResourceChange(0xc003697068, {0x170b2cc8?, 0xc0023c5ce0?}, 0xc000deda90)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/grpc_provider.go:858 +0xbe8
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).PlanResourceChange(0xc0014921c0, {0x170b2cc8?, 0xc0023c5a10?}, 0xc000deda90)
github.com/hashicorp/terraform-plugin-mux@v0.16.0/tf5muxserver/mux_server_PlanResourceChange.go:73 +0x2ad
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).PlanResourceChange(0xc001997cc0, {0x170b2cc8?, 0xc0023c51d0?}, 0xc0006d3d80)
github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/tf5server/server.go:825 +0x3f0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler({0x14c3fb20, 0xc001997cc0}, {0x170b2cc8, 0xc0023c51d0}, 0xc0006d3d00, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:500 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000a60200, {0x170b2cc8, 0xc0023c5140}, {0x17116620, 0xc000002000}, 0xc001f7c6c0, 0xc0025afd40, 0x208231e0, 0x0)
google.golang.org/grpc@v1.63.2/server.go:1369 +0xdf8
google.golang.org/grpc.(*Server).handleStream(0xc000a60200, {0x17116620, 0xc000002000}, 0xc001f7c6c0)
google.golang.org/grpc@v1.63.2/server.go:1780 +0xe8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/grpc@v1.63.2/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 41
google.golang.org/grpc@v1.63.2/server.go:1030 +0x125

Error: The terraform-provider-aws_v5.61.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Important Factoids

apply runs successfully if there is no jobdefinition. Fails when there are existing AWS Batch setup.

References

No response

Would you like to implement a fix?

None

@sasmital sasmital added the bug Addresses a defect in current functionality. label Aug 5, 2024
Copy link

github-actions bot commented Aug 5, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added crash Results from or addresses a Terraform crash or kernel panic. service/batch Issues and PRs that pertain to the batch service. labels Aug 5, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 5, 2024
@jar-b jar-b removed the needs-triage Waiting for first response or review from a maintainer. label Aug 7, 2024
Copy link

github-actions bot commented Aug 7, 2024

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.62.0 milestone Aug 7, 2024
Copy link

github-actions bot commented Aug 9, 2024

This functionality has been released in v5.62.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Sep 9, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/batch Issues and PRs that pertain to the batch service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants