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: runtime error on data block, azurerm_app_configuration_keys #19023

Closed
1 task done
samgovier opened this issue Oct 27, 2022 · 4 comments · Fixed by #19032
Closed
1 task done

panic: runtime error on data block, azurerm_app_configuration_keys #19023

samgovier opened this issue Oct 27, 2022 · 4 comments · Fixed by #19032

Comments

@samgovier
Copy link

samgovier commented Oct 27, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.2.8

AzureRM Provider Version

3.28.0

Affected Resource(s)/Data Source(s)

azurerm_app_configuration_keys

Terraform Configuration Files

terraform {
  required_version = "~> 1.0"
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "~> 3.0"
    }
  }
}

provider "azurerm" {
  features {}
}

data "azurerm_app_configuration" "example" {
  name                = "TEST-config"
  resource_group_name = "test-rg"
}

# output "id" {
#     value = data.azurerm_app_configuration.example.id
# }

data "azurerm_app_configuration_keys" "test" {
  configuration_store_id = data.azurerm_app_configuration.example.id
}

# output "test" {
#   value = data.azurerm_app_configuration_keys.test
# }

Debug Output/Panic Output

Stack trace from the terraform-provider-azurerm_v3.28.0_x5.exe plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x48d35ba]

goroutine 165 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/appconfiguration.KeysDataSource.Read.func1({0x6ffe090, 0xc0019bb980}, {0xc000299000, {0x6fff670, 0xc00020fe60}, 0xc000060f80, 0x0, {0x7001078, 0xb1cc180}})
        github.com/hashicorp/terraform-provider-azurerm/internal/services/appconfiguration/app_configuration_keys_data_source.go:160 +0x7fa
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*DataSourceWrapper).DataSource.func2({0x6ffe090, 0xc0019bb980}, 0x1176592e000?, {0x5e5fba0?, 0xc000299000?})
        github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_data_source.go:48 +0x158
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.diagnosticsWrapper.func1({0x6ffe090, 0xc0019bb980}, 0x195566e0108?, {0x5e5fba0, 0xc000299000})
        github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:185 +0xbe
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc000220c40, {0x6ffe0c8, 0xc002324570}, 0xd?, {0x5e5fba0, 0xc000299000})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/resource.go:724 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc000220c40, {0x6ffe0c8, 0xc002324570}, 0xc000060e80, {0x5e5fba0, 0xc000299000})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/resource.go:943 +0x145
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc000005a58, {0x6ffe0c8?, 0xc0023244b0?}, 0xc0021dc200)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/grpc_provider.go:1179 +0x38f
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadDataSource(0xc000bb3720, {0x6ffe0c8?, 0xc002551aa0?}, 0xc002206fa0)
        github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:658 +0x3ef
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler({0x6477fc0?, 0xc000bb3720}, {0x6ffe0c8, 0xc002551aa0}, 0xc0019bb500, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:421 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000232a80, {0x700ff70, 0xc0002f8000}, 0xc001b3fe60, 0xc001679ef0, 0xb1662d0, 0x0)
        google.golang.org/grpc@v1.47.0/server.go:1283 +0xcfd
google.golang.org/grpc.(*Server).handleStream(0xc000232a80, {0x700ff70, 0xc0002f8000}, 0xc001b3fe60, 0x0)
        google.golang.org/grpc@v1.47.0/server.go:1620 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.47.0/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.47.0/server.go:920 +0x28a

Error: The terraform-provider-azurerm_v3.28.0_x5.exe 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.

Expected Behaviour

I'm trying to pull the app config keys as a test with Azure App Configuration. It should have resolved with no action.

Actual Behaviour

The azurerm provider plugin crashed.

Steps to Reproduce

  1. Create a file with the above code in it, terraform init
    a. Assure that the required resources exist in Azure: a Resource Group, and an Azure App Configuration
  2. Run terraform plan. No apply needed
  3. See error

Important Factoids

No response

References

My be useful/interesting to look at the Registry Documentation.

I had to add App Configuration Data Owner to my AAD account to get around a 400 error. However, that is resolved. Should not be causing this error.

@teowa
Copy link
Contributor

teowa commented Oct 28, 2022

Hi @samgovier , thanks for opening this issue.
This is because the datasource code omit the chance label might be null, thus lead to an nil pointer error. I have submitted PR to fix this.

@samgovier
Copy link
Author

Thank you @teowa !

@github-actions
Copy link

github-actions bot commented Nov 4, 2022

This functionality has been released in v3.30.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!

@github-actions
Copy link

github-actions bot commented Dec 4, 2022

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 Dec 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants