oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
759 stars 675 forks source link

Adding tags oci terraform plugin crash #2208

Open saltie opened 1 day ago

saltie commented 1 day ago

Terraform Version and Provider Version

terraform-v1.9.5 --version Terraform v1.9.5 on darwin_amd64

  • provider registry.terraform.io/hashicorp/template v2.2.0
  • provider registry.terraform.io/oracle/oci v6.12.0

Affected Resource(s)

oci_core_instance

Debug Output

│ Error: Request cancelled │ │ with module.compute["enge2e-mx972"].oci_core_instance.this[0], │ on .terraform/modules/compute/modules/compute-instance/instance.tf line 37, in resource "oci_core_instance" "this": │ 37: resource "oci_core_instance" "this" { │ │ The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled.

Stack trace from the terraform-provider-oci_v6.12.0 plugin:

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

goroutine 92 [running]: github.com/oracle/terraform-provider-oci/internal/service/core.(CoreInstanceResourceCrud).Update(0xc0044e6480) github.com/oracle/terraform-provider-oci/internal/service/core/core_instance_resource.go:1511 +0x2119 github.com/oracle/terraform-provider-oci/internal/tfresource.UpdateResource({0xd698cd0, 0xc003094b00}, {0xd6198a0, 0xc0044e6480}) github.com/oracle/terraform-provider-oci/internal/tfresource/crud_helpers.go:359 +0x134 github.com/oracle/terraform-provider-oci/internal/service/core.updateCoreInstance(0xc003094b00, {0xd590b40, 0xc002c103d8}) github.com/oracle/terraform-provider-oci/internal/service/core/core_instance_resource.go:1039 +0x2ed github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).update(0xd68a738?, {0xd68a738?, 0xc0049afda0?}, 0xd?, {0xd590b40?, 0xc002c103d8?}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:800 +0x15f github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).Apply(0xc0023d3420, {0xd68a738, 0xc0049afda0}, 0xc002c16dd0, 0xc003094880, {0xd590b40, 0xc002c103d8}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:919 +0x83a github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(GRPCProviderServer).ApplyResourceChange(0xc002b5e708, {0xd68a738?, 0xc0049afc80?}, 0xc00011c4b0) github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/grpc_provider.go:1078 +0xd5c github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(server).ApplyResourceChange(0xc0001a3400, {0xd68a738?, 0xc0049ae9c0?}, 0xc003040620) github.com/hashicorp/terraform-plugin-go@v0.22.0/tfprotov5/tf5server/server.go:846 +0x3d0 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xd2272a0, 0xc0001a3400}, {0xd68a738, 0xc0049ae9c0}, 0xc004361380, 0x0) github.com/hashicorp/terraform-plugin-go@v0.22.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x1a6 google.golang.org/grpc.(Server).processUnaryRPC(0xc000222e00, {0xd68a738, 0xc004a331d0}, {0xd69f0e0, 0xc002b94340}, 0xc0034c0900, 0xc002b6b8c0, 0x11937098, 0x0) google.golang.org/grpc@v1.61.1/server.go:1385 +0xdd1 google.golang.org/grpc.(Server).handleStream(0xc000222e00, {0xd69f0e0, 0xc002b94340}, 0xc0034c0900) google.golang.org/grpc@v1.61.1/server.go:1796 +0xfb8 google.golang.org/grpc.(Server).serveStreams.func2.1() google.golang.org/grpc@v1.61.1/server.go:1029 +0x8b created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 67 google.golang.org/grpc@v1.61.1/server.go:1040 +0x125

Error: The terraform-provider-oci_v6.12.0 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 Behavior

Expect to be able to update tags

Actual Behavior

Maybe 10 nodes complete before crash

Steps to Reproduce

Add tags to an instance and run terraform on multiple nodes

tf-oci-pub commented 1 day ago

Thank you for reporting the issue. We observed the affected resources are not provided in the description or it's incorrect. We request you to add it in issue description as mentioned in below format. Example: affected_resources = oci_core_instance , oci_core_instances

If it's not related to any particular resource then mention affected resource as terraform. Example: affected_resources = terraform

As this works through automation, request you to follow exact syntax.

saltie commented 1 day ago

Affected Resource(s)

affected_resources = oci_core_instance

saltie commented 1 day ago

Note that this was readily reproducible using version v6.12.0 of oci sdk. After every 10 node tag addition i would see a crash. Reverted back to oci v6.11.0 and it ran with no issues. This is clearly something that has regressed in v6.12.0.