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_management_policy (2.66 crash) #12476

Closed
h4t1n opened this issue Jul 5, 2021 · 7 comments · Fixed by #12487
Closed

azurerm_storage_management_policy (2.66 crash) #12476

h4t1n opened this issue Jul 5, 2021 · 7 comments · Fixed by #12487
Assignees
Labels
crash service/storage upstream/terraform This issue is blocked on an upstream issue within Terraform (Terraform Core/CLI, The Plugin SDK etc)
Milestone

Comments

@h4t1n
Copy link

h4t1n commented Jul 5, 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 1.0.1
azurerm 2.66.0

Affected Resource(s)

resource azurerm_storage_management_policy

Terraform Configuration Files

resource "azurerm_storage_account" "storage_account" {
    name			= var.environement.variables.envSpecific.storageAccountName
    resource_group_name		= var.environement.variables.envSpecific.rgName
    location			= var.environement.variables.envSpecific.location
    account_tier		= "Standard"
    account_replication_type	= "LRS"
    account_kind                = "StorageV2"
    is_hns_enabled              = "true"
    large_file_share_enabled	= "false"
    min_tls_version		= "TLS1_2"
    access_tier			= "Hot"
    allow_blob_public_access	= "true"
    enable_https_traffic_only	= "true"
    network_rules {
        default_action		= "Deny"
    }
}

resource "azurerm_storage_management_policy" "storage_management_policy" {
    storage_account_id		= azurerm_storage_account.storage_account.id
    rule {
        name			= "BackupPolicy"
        enabled			= true
        filters {
            blob_types		= ["blockBlob"]
        }
        actions {
            base_blob {
                tier_to_cool_after_days_since_modification_greater_than = 1
            }
        }
    }
}

Panic Output

11:18:11  module.hiddenname.module.storageaccount.azurerm_storage_management_policy.storage_management_policy: Creating...
11:18:12  ╷
11:18:12  │ Error: Plugin did not respond
11:18:12  │ 
11:18:12  │   with module.hiddenname.module.storageaccount.azurerm_storage_management_policy.storage_management_policy,
11:18:12  │   on modules/StorageAccount/storageaccount.tf line 24, in resource "azurerm_storage_management_policy" "storage_management_policy":
11:18:12  │   24: resource "azurerm_storage_management_policy" "storage_management_policy" {
11:18:12  │ 
11:18:12  │ The plugin encountered an error, and failed to respond to the
11:18:12  │ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
11:18:12  │ contain more details.
11:18:12  ╵
11:18:13  
11:18:13  Stack trace from the terraform-provider-azurerm_v2.66.0_x5 plugin:
11:18:13  
11:18:13  panic: reflect: call of reflect.Value.IsNil on array Value
11:18:13  
11:18:13  goroutine 246 [running]:
11:18:13  reflect.Value.IsNil(...)
11:18:13  	/opt/goenv/versions/1.16.3/src/reflect/value.go:1086
11:18:13  github.com/mitchellh/mapstructure.(*Decoder).decodeSlice(0xc00028c390, 0x0, 0x0, 0x6111fc0, 0xc0019f82d0, 0x606d0c0, 0xc0021c4420, 0x197, 0x8, 0x8)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/mitchellh/mapstructure/mapstructure.go:1086 +0x10ad
11:18:13  github.com/mitchellh/mapstructure.(*Decoder).decode(0xc00028c390, 0x0, 0x0, 0x6111fc0, 0xc0019f82d0, 0x606d0c0, 0xc0021c4420, 0x197, 0xc0021c4420, 0x197)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/mitchellh/mapstructure/mapstructure.go:460 +0x836
11:18:13  github.com/mitchellh/mapstructure.(*Decoder).Decode(0xc00028c390, 0x6111fc0, 0xc0019f82d0, 0x0, 0xc0021c4420)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/mitchellh/mapstructure/mapstructure.go:389 +0xf0
11:18:13  github.com/mitchellh/mapstructure.Decode(0x6111fc0, 0xc0019f82d0, 0x5fde3e0, 0xc0021c4420, 0x1, 0xc0019b61b0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/mitchellh/mapstructure/mapstructure.go:297 +0xa5
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setList(0xc00147d650, 0xc001f286c0, 0x3, 0x3, 0x6111fc0, 0xc0019f82d0, 0xc001097400, 0xc0015145c8, 0xc001f28690)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:127 +0xd2
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).set(0xc00147d650, 0xc001f286c0, 0x3, 0x3, 0x6111fc0, 0xc0019f82d0, 0x0, 0x0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:103 +0xde
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setObject(0xc00147d650, 0xc001ca6100, 0x2, 0x2, 0x623b880, 0xc001f285d0, 0xc002574b40, 0x10, 0x60df260)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:225 +0x21a
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).set(0xc00147d650, 0xc001ca6100, 0x2, 0x2, 0x623b880, 0xc001f285d0, 0x4, 0x16f8615)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:109 +0x1de
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setList.func1(...)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:123
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setList(0xc00147d650, 0xc0019f8310, 0x1, 0x1, 0x606d0c0, 0xc0021c4390, 0xc00109c640, 0x6a02c75, 0xc002574500)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:143 +0x29e
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).set(0xc00147d650, 0xc0019f8310, 0x1, 0x1, 0x606d0c0, 0xc0021c4390, 0x1, 0x1)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:103 +0xde
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).WriteField(0xc00147d650, 0xc0019f8310, 0x1, 0x1, 0x606d0c0, 0xc0021c4390, 0x0, 0x0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:89 +0x3f9
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc000e66c80, 0x6a02c75, 0x4, 0x606d0c0, 0xc0021c4390, 0x0, 0x0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go:227 +0x1df
11:18:13  github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage.resourceStorageManagementPolicyRead(0xc000e66c80, 0x620a540, 0xc000ce7880, 0x0, 0x0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/storage_management_policy_resource.go:295 +0x525
11:18:13  github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage.resourceStorageManagementPolicyCreateOrUpdate(0xc000e66c80, 0x620a540, 0xc000ce7880, 0x0, 0x0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/storage_management_policy_resource.go:266 +0x8d0
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0010987e0, 0x715ab68, 0xc000fa9400, 0xc000e66c80, 0x620a540, 0xc000ce7880, 0x0, 0x0, 0x0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:318 +0x1ee
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0010987e0, 0x715ab68, 0xc000fa9400, 0xc0016cc700, 0xc0011a4780, 0x620a540, 0xc000ce7880, 0x0, 0x0, 0x0, ...)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:456 +0x67b
11:18:13  github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000115068, 0x715ab68, 0xc000fa9400, 0xc0018acc80, 0xc000fa9400, 0x66d3400, 0xc0016c2700)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:955 +0x8ef
11:18:13  github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0xc0018fbf00, 0x715ac10, 0xc000fa9400, 0xc0016cc5b0, 0xc0018fbf00, 0xc0016c2720, 0xc000af3ba0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go:332 +0xb5
11:18:13  github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x66d3400, 0xc0018fbf00, 0x715ac10, 0xc0016c2720, 0xc00147f5c0, 0x0, 0x715ac10, 0xc0016c2720, 0xc001a7ef00, 0x4b0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x214
11:18:13  google.golang.org/grpc.(*Server).processUnaryRPC(0xc000228c40, 0x71a4538, 0xc0005c2600, 0xc00174a480, 0xc001166d20, 0xa67dd00, 0x0, 0x0, 0x0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1292 +0x52b
11:18:13  google.golang.org/grpc.(*Server).handleStream(0xc000228c40, 0x71a4538, 0xc0005c2600, 0xc00174a480, 0x0)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1617 +0xd0c
11:18:13  google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000628ad0, 0xc000228c40, 0x71a4538, 0xc0005c2600, 0xc00174a480)
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:940 +0xab
11:18:13  created by google.golang.org/grpc.(*Server).serveStreams.func1
11:18:13  	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:938 +0x1fd
11:18:13  
11:18:13  Error: The terraform-provider-azurerm_v2.66.0_x5 plugin crashed!
11:18:13  
11:18:13  This is always indicative of a bug within the plugin. It would be immensely
11:18:13  helpful if you could report the crash with the plugin's maintainers so that it
11:18:13  can be fixed. The output above should help diagnose the issue.

Steps to Reproduce

When creating a new resource: terraform apply
Crashes as well when refreshing the state of an existing resource.

PS: Sorry for the bad formatting and everything, never used github before.

@LouisJULIEN
Copy link

I've encountered the exact same issue on Terraform v0.15.0 with the azurerm plugins with both ~2.44.0 and =2.66.0 versions. I run MacOS version 11.4 (BigSur).

@mkoertgen
Copy link

Same for me. After upgrading from 2.63 -> 2.66. Here is the output

 Error: Plugin did not respond
│ 
│   with module.ops.azurerm_storage_management_policy.housekeeping,
│   on modules/ops/main.tf line 84, in resource "azurerm_storage_management_policy" "housekeeping":
│   84: resource "azurerm_storage_management_policy" "housekeeping" {
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more
│ details.
╵

Stack trace from the terraform-provider-azurerm_v2.66.0_x5 plugin:

panic: reflect: call of reflect.Value.IsNil on array Value

goroutine 470 [running]:
reflect.Value.IsNil(...)
	/opt/goenv/versions/1.16.3/src/reflect/value.go:1086
github.com/mitchellh/mapstructure.(*Decoder).decodeSlice(0xc001b82e30, 0x0, 0x0, 0x5513a40, 0xc0014dcbc0, 0x546ed40, 0xc00153fd88, 0x197, 0x8, 0x8)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/mitchellh/mapstructure/mapstructure.go:1086 +0x10ad
...
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:123
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setList(0xc00153fc68, 0xc0014dcc10, 0x1, 0x1, 0x546ed40, 0xc00153fcf8, 0xc001030640, 0x5e04135, 0xc002bcec80)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:143 +0x29e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).set(0xc00153fc68, 0xc0014dcc10, 0x1, 0x1, 0x546ed40, 0xc00153fcf8, 0x1, 0x1)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:103 +0xde
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).WriteField(0xc00153fc68, 0xc0014dcc10, 0x1, 0x1, 0x546ed40, 0xc00153fcf8, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:89 +0x3f9
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc000f10880, 0x5e04135, 0x4, 0x546ed40, 0xc00153fcf8, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go:227 +0x1df
github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage.resourceStorageManagementPolicyRead(0xc000f10880, 0x560bc60, 0xc000d77880, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/storage_management_policy_resource.go:295 +0x525
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc001026e00, 0x655b5c8, 0xc001a456c0, 0xc000f10880, 0x560bc60, 0xc000d77880, 0x0, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:335 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc001026e00, 0x655b5c8, 0xc001a456c0, 0xc001bb9110, 0x560bc60, 0xc000d77880, 0xc001b831f0, 0x0, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:624 +0x1cb
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc0010ba0a8, 0x655b5c8, 0xc001a456c0, 0xc001a45700, 0xc001a456c0, 0x40ba05, 0x591b140)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:575 +0x43b
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadResource(0xc001bfc1c0, 0x655b670, 0xc001a456c0, 0xc000f1fda0, 0xc001bfc1c0, 0xc001bdfda0, 0xc0013aaba0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go:298 +0x105
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler(0x5ad47c0, 0xc001bfc1c0, 0x655b670, 0xc001bdfda0, 0xc000f1fd40, 0x0, 0x655b670, 0xc001bdfda0, 0xc0012cd400, 0x3f9)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:344 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0005821c0, 0x65a4dd8, 0xc001bfed80, 0xc001bf2c60, 0xc000a20810, 0x9a7ab30, 0x0, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1292 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc0005821c0, 0x65a4dd8, 0xc001bfed80, 0xc001bf2c60, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1617 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000bfeec0, 0xc0005821c0, 0x65a4dd8, 0xc001bfed80, 0xc001bf2c60)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:940 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:938 +0x1fd

Error: The terraform-provider-azurerm_v2.66.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.

##[error]Bash exited with code '1'.

@hmb133
Copy link

hmb133 commented Jul 6, 2021

Same for me, terraform v1.0.1 provider 2.66.0

Error received when updating existing state, deployment of management policy previously worked with no issue

Error also refers to arm template deployments, however I think this is simply because the plugin crashes during management policy which is before arm deploy completes, so it brings the arm deploy down with it

EDIT: reverting back to provider version 2.63.0 'fixes' the issue


2021-07-06T03:28:29.1131644Z Plugin did not respond
2021-07-06T03:28:29.1132162Z 
2021-07-06T03:28:29.1132624Z with module.logicapp.azurerm_resource_group_template_deployment.la_template["arm1"],
2021-07-06T03:28:29.1133282Z on ../../child_modules/logicapp/main.tf line 32, in resource "azurerm_resource_group_template_deployment" "la_template":
2021-07-06T03:28:29.1133938Z 32: resource "azurerm_resource_group_template_deployment" "la_template"
2021-07-06T03:28:29.1134330Z 
2021-07-06T03:28:29.1134747Z The plugin encountered an error, and failed to respond to the
2021-07-06T03:28:29.1135542Z plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
2021-07-06T03:28:29.1135974Z contain more details.
2021-07-06T03:28:29.1136279Z 
2021-07-06T03:28:29.1143831Z 
2021-07-06T03:28:29.1144366Z Error: Plugin did not respond
2021-07-06T03:28:29.1144793Z 
2021-07-06T03:28:29.1145276Z with module.logicapp.azurerm_resource_group_template_deployment.la_template["arm2"],
2021-07-06T03:28:29.1145932Z on ../../child_modules/logicapp/main.tf line 32, in resource "azurerm_resource_group_template_deployment" "la_template":
2021-07-06T03:28:29.1146588Z 32: resource "azurerm_resource_group_template_deployment" "la_template"
2021-07-06T03:28:29.1146981Z 
2021-07-06T03:28:29.1147541Z The plugin encountered an error, and failed to respond to the
2021-07-06T03:28:29.1148050Z plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
2021-07-06T03:28:29.1148433Z contain more details.
2021-07-06T03:28:29.1148743Z 
2021-07-06T03:28:29.1155239Z 
2021-07-06T03:28:29.1155746Z Error: Plugin did not respond�[0m
2021-07-06T03:28:29.1156328Z 
2021-07-06T03:28:29.1156729Z with module.storage.azurerm_storage_management_policy.smp["smp1"],
2021-07-06T03:28:29.1157321Z on ../../child_modules/storage/main.tf line 18, in resource "azurerm_storage_management_policy" "smp":
2021-07-06T03:28:29.1157864Z 18: resource "azurerm_storage_management_policy" "smp"
2021-07-06T03:28:29.1158235Z 
2021-07-06T03:28:29.1158611Z The plugin encountered an error, and failed to respond to the
2021-07-06T03:28:29.1159085Z plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
2021-07-06T03:28:29.1159502Z contain more details.
2021-07-06T03:28:29.1159793Z 
2021-07-06T03:28:29.1804573Z 
2021-07-06T03:28:29.1806356Z Stack trace from the terraform-provider-azurerm_v2.66.0_x5 plugin:
2021-07-06T03:28:29.1806580Z 
2021-07-06T03:28:29.1806915Z panic: reflect: call of reflect.Value.IsNil on array Value
2021-07-06T03:28:29.1807480Z 
2021-07-06T03:28:29.1808044Z goroutine 345 [running]:
2021-07-06T03:28:29.1808444Z reflect.Value.IsNil(...)
2021-07-06T03:28:29.1808887Z 	/opt/goenv/versions/1.16.3/src/reflect/value.go:1086
2021-07-06T03:28:29.1810202Z github.com/mitchellh/mapstructure.(*Decoder).decodeSlice(0xc001caa570, 0x0, 0x0, 0x5513a40, 0xc00184fd30, 0x546ed40, 0xc001251e18, 0x197, 0x8, 0x8)
2021-07-06T03:28:29.1811332Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/mitchellh/mapstructure/mapstructure.go:1086 +0x10ad
2021-07-06T03:28:29.1811961Z github.com/mitchellh/mapstructure.(*Decoder).decode(0xc001caa570, 0x0, 0x0, 0x5513a40, 0xc00184fd30, 0x546ed40, 0xc001251e18, 0x197, 0xc001251e18, 0x197)
2021-07-06T03:28:29.1812931Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/mitchellh/mapstructure/mapstructure.go:460 +0x836
2021-07-06T03:28:29.1813485Z github.com/mitchellh/mapstructure.(*Decoder).Decode(0xc001caa570, 0x5513a40, 0xc00184fd30, 0x0, 0xc001251e18)
2021-07-06T03:28:29.1814310Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/mitchellh/mapstructure/mapstructure.go:389 +0xf0
2021-07-06T03:28:29.1814860Z github.com/mitchellh/mapstructure.Decode(0x5513a40, 0xc00184fd30, 0x53e0020, 0xc001251e18, 0x1, 0xc001eaa400)
2021-07-06T03:28:29.1815670Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/mitchellh/mapstructure/mapstructure.go:297 +0xa5
2021-07-06T03:28:29.1816855Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setList(0xc0015f9338, 0xc001e93770, 0x3, 0x3, 0x5513a40, 0xc00184fd30, 0xc000fcc280, 0xc002a5eec8, 0xc001e93740)
2021-07-06T03:28:29.1817852Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:127 +0xd2
2021-07-06T03:28:29.1818756Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).set(0xc0015f9338, 0xc001e93770, 0x3, 0x3, 0x5513a40, 0xc00184fd30, 0x0, 0x0)
2021-07-06T03:28:29.1819693Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:103 +0xde
2021-07-06T03:28:29.1820639Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setObject(0xc0015f9338, 0xc002795200, 0x2, 0x2, 0x563cd60, 0xc001e935c0, 0xc001e8b400, 0x10, 0x54e0e20)
2021-07-06T03:28:29.1821616Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:225 +0x21a
2021-07-06T03:28:29.1822515Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).set(0xc0015f9338, 0xc002795200, 0x2, 0x2, 0x563cd60, 0xc001e935c0, 0x4, 0xaf9495)
2021-07-06T03:28:29.1823591Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:109 +0x1de
2021-07-06T03:28:29.1824341Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setList.func1(...)
2021-07-06T03:28:29.1825186Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:123
2021-07-06T03:28:29.1826150Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setList(0xc0015f9338, 0xc00184fdf0, 0x1, 0x1, 0x546ed40, 0xc001251d88, 0xc000fcd400, 0x5e04135, 0xc001e8adc0)
2021-07-06T03:28:29.1827131Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:143 +0x29e
2021-07-06T03:28:29.1828025Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).set(0xc0015f9338, 0xc00184fdf0, 0x1, 0x1, 0x546ed40, 0xc001251d88, 0x1, 0x1)
2021-07-06T03:28:29.1828957Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:103 +0xde
2021-07-06T03:28:29.1829857Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).WriteField(0xc0015f9338, 0xc00184fdf0, 0x1, 0x1, 0x546ed40, 0xc001251d88, 0x0, 0x0)
2021-07-06T03:28:29.1830805Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go:89 +0x3f9
2021-07-06T03:28:29.1831668Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc001e5b480, 0x5e04135, 0x4, 0x546ed40, 0xc001251d88, 0x0, 0x0)
2021-07-06T03:28:29.1832729Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go:227 +0x1df
2021-07-06T03:28:29.1833867Z github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage.resourceStorageManagementPolicyRead(0xc001e5b480, 0x560bc60, 0xc000dae700, 0x0, 0x0)
2021-07-06T03:28:29.1835424Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/storage_management_policy_resource.go:295 +0x525
2021-07-06T03:28:29.1837850Z github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage.resourceStorageManagementPolicyCreateOrUpdate(0xc001e5b480, 0x560bc60, 0xc000dae700, 0x0, 0x0)
2021-07-06T03:28:29.1838825Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/storage_management_policy_resource.go:266 +0x8d0
2021-07-06T03:28:29.1839759Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc000fc2e00, 0x655b5c8, 0xc001a73e00, 0xc001e5b480, 0x560bc60, 0xc000dae700, 0x0, 0x0, 0x0)
2021-07-06T03:28:29.1840702Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:318 +0x1ee
2021-07-06T03:28:29.1841870Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000fc2e00, 0x655b5c8, 0xc001a73e00, 0xc001dcea10, 0xc00195c220, 0x560bc60, 0xc000dae700, 0x0, 0x0, 0x0, ...)
2021-07-06T03:28:29.1843277Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:456 +0x67b
2021-07-06T03:28:29.1844921Z github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00104c0d8, 0x655b5c8, 0xc001a73e00, 0xc00139f630, 0xc001a73e00, 0x5ad47c0, 0xc001ae4300)
2021-07-06T03:28:29.1846061Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:955 +0x8ef
2021-07-06T03:28:29.1847164Z github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0xc00195c480, 0x655b670, 0xc001a73e00, 0xc001dce8c0, 0xc00195c480, 0xc001ae4300, 0xc000d22ba0)
2021-07-06T03:28:29.1848261Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go:332 +0xb5
2021-07-06T03:28:29.1849790Z github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x5ad47c0, 0xc00195c480, 0x655b670, 0xc001ae4300, 0xc002ae9740, 0x0, 0x655b670, 0xc001ae4300, 0xc0017f6000, 0x78c)
2021-07-06T03:28:29.1851187Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x214
2021-07-06T03:28:29.1851975Z google.golang.org/grpc.(*Server).processUnaryRPC(0xc00022e8c0, 0x65a4dd8, 0xc00087c180, 0xc00158f9e0, 0xc0013a4ae0, 0x9a7ab60, 0x0, 0x0, 0x0)
2021-07-06T03:28:29.1853122Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1292 +0x52b
2021-07-06T03:28:29.1853923Z google.golang.org/grpc.(*Server).handleStream(0xc00022e8c0, 0x65a4dd8, 0xc00087c180, 0xc00158f9e0, 0x0)
2021-07-06T03:28:29.1854790Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1617 +0xd0c
2021-07-06T03:28:29.1855426Z google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc00094b3b0, 0xc00022e8c0, 0x65a4dd8, 0xc00087c180, 0xc00158f9e0)
2021-07-06T03:28:29.1856334Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:940 +0xab
2021-07-06T03:28:29.1856865Z created by google.golang.org/grpc.(*Server).serveStreams.func1
2021-07-06T03:28:29.1857676Z 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:938 +0x1fd
2021-07-06T03:28:29.1858017Z 
2021-07-06T03:28:29.1858500Z Error: The terraform-provider-azurerm_v2.66.0_x5 plugin crashed!

@LouisJULIEN
Copy link

2.63.0 does work, thanks @hmb133 !
The plugin not working might be due to the PITR being enabled on the storage account but I didn't double check.

@aristosvo
Copy link
Collaborator

Related to #12473. The problem is probably in the new terraform-plugin-sdk version used in 2.66.0. I reported it to the maintainers, hope to hear more today.

@jackofallops jackofallops self-assigned this Jul 6, 2021
@jackofallops jackofallops added crash service/storage upstream/terraform This issue is blocked on an upstream issue within Terraform (Terraform Core/CLI, The Plugin SDK etc) labels Jul 6, 2021
@katbyte katbyte added this to the v2.67.0 milestone Jul 6, 2021
@github-actions
Copy link

github-actions bot commented Jul 9, 2021

This functionality has been released in v2.67.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 Aug 9, 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 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 Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crash service/storage upstream/terraform This issue is blocked on an upstream issue within Terraform (Terraform Core/CLI, The Plugin SDK etc)
Projects
None yet
7 participants