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

azurerm_api_management_api - Fix nilpointer #21740

Merged
merged 4 commits into from
May 10, 2023

Conversation

aristosvo
Copy link
Collaborator

@aristosvo aristosvo commented May 10, 2023

Fixes #21714

Reproduced it temporarily in the basic test by adding an empty contact block:

------- Stdout: -------
=== RUN   TestAccApiManagementApi_basic
=== PAUSE TestAccApiManagementApi_basic
=== CONT  TestAccApiManagementApi_basic
------- Stderr: -------
panic: interface conversion: interface {} is nil, not map[string]interface {}
goroutine 472 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement.expandApiManagementApiContact(...)
  /opt/teamcity-agent/work/5e6516bb4d10eb66/internal/services/apimanagement/api_management_api_resource.go:777
github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement.resourceApiManagementApiCreateUpdate(0xc001bd7400, {0x62fd320?, 0xc001d6d000})
  /opt/teamcity-agent/work/5e6516bb4d10eb66/internal/services/apimanagement/api_management_api_resource.go:470 +0x2b45
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x7827000?, {0x7827000?, 0xc000136e40?}, 0xd?, {0x62fd320?, 0xc001d6d000?})
  /opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0026542a0, {0x7827000, 0xc000136e40}, 0xc0016ad380, 0xc001bd7280, {0x62fd320, 0xc001d6d000})
  /opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0017a34b8, {0x7827000?, 0xc000136c90?}, 0xc0005f3f90)
  /opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0053a6280, {0x7827000?, 0xc002fe1f20?}, 0xc000491c70)
  /opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x6ac9bc0?, 0xc0053a6280}, {0x7827000, 0xc002fe1f20}, 0xc000491c00, 0x0)
  /opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00304eb40, {0x78370c0, 0xc0019221a0}, 0xc002cb17a0, 0xc0028ac540, 0xbe72e60, 0x0)
  /opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/google.golang.org/grpc/server.go:1340 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc00304eb40, {0x78370c0, 0xc0019221a0}, 0xc002cb17a0, 0x0)
  /opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/google.golang.org/grpc/server.go:1713 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
  /opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/google.golang.org/grpc/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
  /opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/google.golang.org/grpc/server.go:963 +0x28a

Aris van Ommeren added 2 commits May 10, 2023 12:22
@aristosvo aristosvo mentioned this pull request May 10, 2023
1 task
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for this @aristosvo

@tombuildsstuff tombuildsstuff added this to the v3.56.0 milestone May 10, 2023
@tombuildsstuff tombuildsstuff merged commit 555093f into hashicorp:main May 10, 2023
tombuildsstuff added a commit that referenced this pull request May 10, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@github-actions
Copy link

This functionality has been released in v3.56.0 of the Terraform 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 Jun 1, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Jun 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MAnaging API in API Management
2 participants