oracle / terraform-provider-oci

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

Error Updating oci_core_instance #2219

Open carlosmartinezmoller opened 1 day ago

carlosmartinezmoller commented 1 day ago

Affected resources

affected_resources = oci_core_instance

From what I believe, although the tags update are under create_vnic_details of oci_core_instance

Versions

Panic output

Plan: 0 to add, 8 to change, 0 to destroy. module.fws["fw01"].module.fw_instance.oci_core_instance.main: Modifying... [id=masked] module.fws["fw02"].module.fw_instance.oci_core_instance.main: Modifying... [id=masked] ╷ │ Error: Plugin did not respond │ │ with module.fws["fw01"].module.fw_instance.oci_core_instance.main, │ on .terraform/modules/fws.fw_instance/core_instance_01/main.tf line 2, in resource "oci_core_instance" "main": │ 2: resource "oci_core_instance" "main" { │ │ The plugin encountered an error, and failed to respond to the │ plugin.(GRPCProvider).ApplyResourceChange call. The plugin logs may │ contain more details. ╵ ╷ │ Error: Plugin did not respond │ │ with module.fws["fw02"].module.fw_instance.oci_core_instance.main, │ on .terraform/modules/fws.fw_instance/core_instance_01/main.tf line 2, in resource "oci_core_instance" "main": │ 2: resource "oci_core_instance" "main" { │ │ The plugin encountered an error, and failed to respond to the │ plugin.(GRPCProvider).ApplyResourceChange call. The plugin logs may │ contain more details. ╵

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

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

goroutine 38 [running]: github.com/oracle/terraform-provider-oci/internal/service/core.(CoreInstanceResourceCrud).Update(0xc006a0b240) github.com/oracle/terraform-provider-oci/internal/service/core/core_instance_resource.go:1517 +0x2119 github.com/oracle/terraform-provider-oci/internal/tfresource.UpdateResource({0x87ac0f0, 0xc004191c80}, {0x872ca88, 0xc006a0b240}) github.com/oracle/terraform-provider-oci/internal/tfresource/crud_helpers.go:359 +0x134 github.com/oracle/terraform-provider-oci/internal/service/core.updateCoreInstance(0xc004191c80, {0x7dfd600, 0xc001ef5848}) github.com/oracle/terraform-provider-oci/internal/service/core/core_instance_resource.go:1045 +0x2ed github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).update(0x879da28?, {0x879da28?, 0xc00359e750?}, 0xd?, {0x7dfd600?, 0xc001ef5848?}) 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(0xc002340620, {0x879da28, 0xc00359e750}, 0xc00692bc70, 0xc004191b00, {0x7dfd600, 0xc001ef5848}) 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(0xc002b506a8, {0x879da28?, 0xc00359e690?}, 0xc006966370) 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(0xc0001977c0, {0x879da28?, 0xc0035951d0?}, 0xc00693aa80) 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({0x7a91d00, 0xc0001977c0}, {0x879da28, 0xc0035951d0}, 0xc004191000, 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(0xc000232e00, {0x879da28, 0xc003595140}, {0x87b2600, 0xc002c4a000}, 0xc002f4cc60, 0xc002b5f740, 0xcadaff8, 0x0) google.golang.org/grpc@v1.61.1/server.go:1385 +0xdd1 google.golang.org/grpc.(Server).handleStream(0xc000232e00, {0x87b2600, 0xc002c4a000}, 0xc002f4cc60) 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 25 google.golang.org/grpc@v1.61.1/server.go:1040 +0x125

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

Activity

module.fws["fw01"].module.fw_instance.oci_core_instance.main will be updated in-place ~ resource "oci_core_instance" "main" { id = "masked"

(22 unchanged attributes hidden)

 ~ create_vnic_details {
      ~ defined_tags             
          - "FinOps.creation_date"                 = "n_a" -> null
          - "FinOps.department"                    = "n_a" -> null
          - "FinOps.expiration_date"               = "n_a" -> null
          - "FinOps.requester"                     = "n_a" -> null
          - "FinOps.update_date"                   = "n_a" -> null
          - "ManageOperation.team"                 = "bbdd" -> null
          - "ManageOperation.working_hours"        = "8X5" -> null
          - "Oracle-Tags.CreatedBy"                = "masked@masked.com" -> null
          - "Oracle-Tags.CreatedOn"                = "2024-10-04T11:05:58.319Z" -> null
          - "SafetyGovernance.compliance"          = "iso27001" -> null
          - "SafetyGovernance.data_classification" = "internal" -> null
          - "SafetyGovernance.exposure"            = "internal" -> null
            # (7 unchanged elements hidden)
        }
        # (11 unchanged attributes hidden)
    }

    # (7 unchanged blocks hidden)
}
carlosmartinezmoller commented 1 day ago

We modified provider.tf to use version 6.11.0 and it worked fine: required_providers { oci = { source = "hashicorp/oci" version = "6.11.0" } }