Open nicolascomete opened 1 month ago
@hkantare provider is being used in DMZR project
We are following with SCC team . They are looking into (pavanmanda@in.ibm.com)
Hi @nicolascomete I tested on my test environment instance with ibm-cloud provider 1.65.1
pavanmanda@Pavans-MacBook-Pro-2 terraform-checks % terraform plan
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# ibm_scc_profile.scc_profile_instance will be created
+ resource "ibm_scc_profile" "scc_profile_instance" {
+ attachments_count = (known after apply)
+ control_parents_count = (known after apply)
+ controls_count = (known after apply)
+ created_by = (known after apply)
+ created_on = (known after apply)
+ hierarchy_enabled = (known after apply)
+ id = (known after apply)
+ instance_id = "32134f77-2541-4d17-8e7c-89129fa43afc"
+ latest = (known after apply)
+ profile_description = "Test TF v2"
+ profile_id = (known after apply)
+ profile_name = "test_tf"
+ profile_type = "custom"
+ profile_version = (known after apply)
+ updated_by = (known after apply)
+ updated_on = (known after apply)
+ version_group_label = (known after apply)
+ controls {
+ control_category = (known after apply)
+ control_description = (known after apply)
+ control_docs = (known after apply)
+ control_id = "69d09c01-c14d-4bbb-821e-52fed6cd4bf0"
+ control_library_id = "4b70781c-c9eb-42fb-a78e-920d4ae48305"
+ control_library_version = (known after apply)
+ control_name = (known after apply)
+ control_parent = (known after apply)
+ control_requirement = (known after apply)
+ control_specifications = (known after apply)
+ control_specifications_count = (known after apply)
}
+ controls {
+ control_category = (known after apply)
+ control_description = (known after apply)
+ control_docs = (known after apply)
+ control_id = "671718f9-16ca-49ff-84d0-0de9a09d46fc"
+ control_library_id = "4b70781c-c9eb-42fb-a78e-920d4ae48305"
+ control_library_version = (known after apply)
+ control_name = (known after apply)
+ control_parent = (known after apply)
+ control_requirement = (known after apply)
+ control_specifications = (known after apply)
+ control_specifications_count = (known after apply)
}
+ controls {
+ control_category = (known after apply)
+ control_description = (known after apply)
+ control_docs = (known after apply)
+ control_id = "5d004f98-2a4d-4899-a895-016c617eb08c"
+ control_library_id = "4b70781c-c9eb-42fb-a78e-920d4ae48305"
+ control_library_version = (known after apply)
+ control_name = (known after apply)
+ control_parent = (known after apply)
+ control_requirement = (known after apply)
+ control_specifications = (known after apply)
+ control_specifications_count = (known after apply)
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
pavanmanda@Pavans-MacBook-Pro-2 terraform-checks % terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# ibm_scc_profile.scc_profile_instance will be created
+ resource "ibm_scc_profile" "scc_profile_instance" {
+ attachments_count = (known after apply)
+ control_parents_count = (known after apply)
+ controls_count = (known after apply)
+ created_by = (known after apply)
+ created_on = (known after apply)
+ hierarchy_enabled = (known after apply)
+ id = (known after apply)
+ instance_id = "32134f77-2541-4d17-8e7c-89129fa43afc"
+ latest = (known after apply)
+ profile_description = "Test TF v2"
+ profile_id = (known after apply)
+ profile_name = "test_tf"
+ profile_type = "custom"
+ profile_version = (known after apply)
+ updated_by = (known after apply)
+ updated_on = (known after apply)
+ version_group_label = (known after apply)
+ controls {
+ control_category = (known after apply)
+ control_description = (known after apply)
+ control_docs = (known after apply)
+ control_id = "69d09c01-c14d-4bbb-821e-52fed6cd4bf0"
+ control_library_id = "4b70781c-c9eb-42fb-a78e-920d4ae48305"
+ control_library_version = (known after apply)
+ control_name = (known after apply)
+ control_parent = (known after apply)
+ control_requirement = (known after apply)
+ control_specifications = (known after apply)
+ control_specifications_count = (known after apply)
}
+ controls {
+ control_category = (known after apply)
+ control_description = (known after apply)
+ control_docs = (known after apply)
+ control_id = "671718f9-16ca-49ff-84d0-0de9a09d46fc"
+ control_library_id = "4b70781c-c9eb-42fb-a78e-920d4ae48305"
+ control_library_version = (known after apply)
+ control_name = (known after apply)
+ control_parent = (known after apply)
+ control_requirement = (known after apply)
+ control_specifications = (known after apply)
+ control_specifications_count = (known after apply)
}
+ controls {
+ control_category = (known after apply)
+ control_description = (known after apply)
+ control_docs = (known after apply)
+ control_id = "5d004f98-2a4d-4899-a895-016c617eb08c"
+ control_library_id = "4b70781c-c9eb-42fb-a78e-920d4ae48305"
+ control_library_version = (known after apply)
+ control_name = (known after apply)
+ control_parent = (known after apply)
+ control_requirement = (known after apply)
+ control_specifications = (known after apply)
+ control_specifications_count = (known after apply)
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
ibm_scc_profile.scc_profile_instance: Creating...
ibm_scc_profile.scc_profile_instance: Still creating... [10s elapsed]
ibm_scc_profile.scc_profile_instance: Creation complete after 15s [id=32134f77-2541-4d17-8e7c-89129fa43afc/0aab940f-e0b1-450f-8428-2e0c70eae34b]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
pavanmanda@Pavans-MacBook-Pro-2 terraform-checks % terraform providers
Providers required by configuration:
.
└── provider[registry.terraform.io/ibm-cloud/ibm] 1.65.1
Providers required by state:
provider[registry.terraform.io/ibm-cloud/ibm]
pavanmanda@Pavans-MacBook-Pro-2 terraform-checks %
There is no issue with the SCC resource in the creation flow, but I was able to replicate the issue in the update flow.
pavanmanda@Pavans-MacBook-Pro-2 terraform-checks % terraform plan
ibm_scc_profile.scc_profile_instance: Refreshing state... [id=32134f77-2541-4d17-8e7c-89129fa43afc/0aab940f-e0b1-450f-8428-2e0c70eae34b]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# ibm_scc_profile.scc_profile_instance will be updated in-place
~ resource "ibm_scc_profile" "scc_profile_instance" {
id = "32134f77-2541-4d17-8e7c-89129fa43afc/0aab940f-e0b1-450f-8428-2e0c70eae34b"
~ profile_description = "Test TF v2" -> "Test TF v2 update"
~ profile_name = "test_tf" -> "test_tf_update"
# (14 unchanged attributes hidden)
# (3 unchanged blocks hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
pavanmanda@Pavans-MacBook-Pro-2 terraform-checks % terraform apply
ibm_scc_profile.scc_profile_instance: Refreshing state... [id=32134f77-2541-4d17-8e7c-89129fa43afc/0aab940f-e0b1-450f-8428-2e0c70eae34b]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# ibm_scc_profile.scc_profile_instance will be updated in-place
~ resource "ibm_scc_profile" "scc_profile_instance" {
id = "32134f77-2541-4d17-8e7c-89129fa43afc/0aab940f-e0b1-450f-8428-2e0c70eae34b"
~ profile_description = "Test TF v2" -> "Test TF v2 update"
~ profile_name = "test_tf" -> "test_tf_update"
# (14 unchanged attributes hidden)
# (3 unchanged blocks hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
ibm_scc_profile.scc_profile_instance: Modifying... [id=32134f77-2541-4d17-8e7c-89129fa43afc/0aab940f-e0b1-450f-8428-2e0c70eae34b]
╷
│ Error: Plugin did not respond
│
│ with ibm_scc_profile.scc_profile_instance,
│ on main.tf line 1, in resource "ibm_scc_profile" "scc_profile_instance":
│ 1: resource "ibm_scc_profile" "scc_profile_instance" {
│
│ 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-ibm_v1.65.1 plugin:
panic: interface conversion: interface {} is nil, not string
goroutine 48 [running]:
github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc.resourceIbmSccProfileMapToReplaceProfileOptions(0x108a5f360?)
github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_profile.go:684 +0x898
github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc.resourceIbmSccProfileUpdate({0x109215078, 0x14001878300}, 0x14001833080, {0x1091bb560?, 0x14000bb4a80})
github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_profile.go:573 +0x5dc
github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider.wrapFunction.func1({0x109215078?, 0x14001878300?}, 0x0?, {0x1091bb560?, 0x14000bb4a80?})
github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider/provider.go:1533 +0x34
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0x140017955e0, {0x1092150b0, 0x140005f9170}, 0xd?, {0x1091bb560, 0x14000bb4a80})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:812 +0xe8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x140017955e0, {0x1092150b0, 0x140005f9170}, 0x140005fcc30, 0x14001832f00, {0x1091bb560, 0x14000bb4a80})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:919 +0x6a0
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x14000809fc8, {0x1092150b0?, 0x140005f9050?}, 0x140003f6eb0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/grpc_provider.go:1060 +0xb70
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x14000b28640, {0x1092150b0?, 0x140005f8630?}, 0x140001c80e0)
github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/tf5server/server.go:859 +0x3b8
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x109034800?, 0x14000b28640}, {0x1092150b0, 0x140005f8630}, 0x140001c8070, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:467 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0x140001de000, {0x10921fe20, 0x14000818680}, 0x14001848000, 0x1400175f6b0, 0x10b20bd98, 0x0)
google.golang.org/grpc@v1.57.1/server.go:1358 +0xc88
google.golang.org/grpc.(*Server).handleStream(0x140001de000, {0x10921fe20, 0x14000818680}, 0x14001848000, 0x0)
google.golang.org/grpc@v1.57.1/server.go:1735 +0x82c
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/grpc@v1.57.1/server.go:970 +0xb4
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.57.1/server.go:981 +0x174
Error: The terraform-provider-ibm_v1.65.1 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.
pavanmanda@Pavans-MacBook-Pro-2 terraform-checks %
we will prioritize and plan this issue by bringing it to the team's attention and informing you of the timelines for resolution, based on our current priority items.
Summary When updating a custom profile resource (
ibm_scc_profile.scc_profile_instance
), changing theprofile_description
leads to a provider panic.Detailed description Profile has been created using a Terraform template. Updating the
profile_description
value from within the template leads to a provider crash. The profile is not updated.Terraform provider version used v1.65.1
Examples of failing template
Leads to: