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_storage_account #10369

Closed
whytoe opened this issue Jan 28, 2021 · 2 comments · Fixed by #10370
Closed

Azurerm_storage_account #10369

whytoe opened this issue Jan 28, 2021 · 2 comments · Fixed by #10370

Comments

@whytoe
Copy link
Contributor

whytoe commented Jan 28, 2021

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 (and AzureRM Provider) Version

Terraform v0.14.5

  • provider registry.terraform.io/hashicorp/azuread v1.3.0
  • provider registry.terraform.io/hashicorp/azurerm v2.45.1

Affected Resource(s)

  • data_azurerm_storage_account

Terraform Configuration Files

data "azurerm_storage_account" "foo" {
  count = var.env == "prod" || var.env == "uat" ? 1 : 0
  name = var.storage_account_name[var.env]
  resource_group_name = data.azurerm_resource_group.foo[0].name
}

Debug Output

Panic Output

[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4108000]
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5:
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: goroutine 63 [running]:
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage.dataSourceStorageAccountRead(0xc0006f4b60, 0x4b6a9a0, 0xc0015da300, 0x0, 0x0)
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/storage_account_data_source.go:278 +0x4c0
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).ReadDataApply(0xc000e547e0, 0xc0011a3120, 0x4b6a9a0, 0xc0015da300, 0xc000bfd018, 0x1, 0x0)
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:403 +0x88
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).ReadDataApply(0xc00020ed80, 0xc0012e3ad0, 0xc0011a3120, 0xc0011a3120, 0x0, 0x0)
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go:451 +0x8f
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadDataSource(0xc00013f910, 0x5901b40, 0xc0013004b0, 0xc001192400, 0xc00013f910, 0xc0013004b0, 0xc0012d5b78)
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin/grpc_provider.go:1036 +0x42d
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadDataSource_Handler(0x4fd3240, 0xc00013f910, 0x5901b40, 0xc0013004b0, 0xc0011aae40, 0x0, 0x5901b40, 0xc0013004b0, 0xc0016b2d80, 0x40a)
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go:3341 +0x214
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: google.golang.org/grpc.(*Server).processUnaryRPC(0xc000216780, 0x5948a60, 0xc000217500, 0xc001316100, 0xc001300b40, 0x879d2b0, 0x0, 0x0, 0x0)
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1024 +0x522
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: google.golang.org/grpc.(*Server).handleStream(0xc000216780, 0x5948a60, 0xc000217500, 0xc001316100, 0x0)
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1313 +0xd34
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000c621c0, 0xc000216780, 0x5948a60, 0xc000217500, 0xc001316100)
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:722 +0xa5
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5: created by google.golang.org/grpc.(*Server).serveStreams.func1
[DEBUG] plugin.terraform-provider-azurerm_v2.45.1_x5:   /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:720 +0xa5
[TRACE] vertex "data.azurerm_storage_account.notify[0]": visit complete
[TRACE] vertex "data.azurerm_storage_account.notify": dynamic subgraph encountered errors
[TRACE] vertex "data.azurerm_storage_account.notify": visit complete
[TRACE] vertex "data.azurerm_storage_account.notify (expand)": dynamic subgraph encountered errors
[TRACE] vertex "data.azurerm_storage_account.notify (expand)": visit complete
[DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/azurerm/2.45.1/linux_amd64/terraform-provider-azurerm_v2.45.1_x5 pid=8203 error="exit status 2"

Expected Behaviour

Data resource is queried correctly

Actual Behaviour

Panic/Crash

Steps to Reproduce

  1. terraform apply
  2. dont include a variable, mine was a mapped variable set to ""

Important Factoids

storage_account_name       = {
  "dev" = "devaccount"
  "uat" = "uataccount"
  "prod" = ""
}

Storage Account name was not provided in the map variable and it threw a panic error.
When i entered in the prod value, the storage account data provider worked correctly

@ghost ghost added bug crash labels Jan 29, 2021
@katbyte katbyte added this to the v2.46.0 milestone Jan 29, 2021
katbyte pushed a commit that referenced this issue Jan 29, 2021
It crashes if the name passed to it is an empty string.

Fixes #10369
@ghost
Copy link

ghost commented Feb 5, 2021

This has been released in version 2.46.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.46.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Feb 28, 2021

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 28, 2021
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.

3 participants