oracle / terraform-provider-oci

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

Enable/Disable operations insights on ADB failed on standby with error even though the status was updated correctly #1832

Open luckeyca opened 1 year ago

luckeyca commented 1 year ago

Community Note

Terraform Version and Provider Version

Terraform v1.4.4 on linux_amd64

provider registry.terraform.io/hashicorp/random v3.4.3 provider registry.terraform.io/oracle/oci v4.113.0

Affected Resource(s)

oci_database_autonomous_database

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. 
# Please remove any sensitive information from configuration files before sharing them. 

resource "oci_database_autonomous_database" "primary" {
...

source = "CROSS_REGION_DATAGUARD"
operations_insights_status = "ENABLED"
...

Expected Behavior

operations insights should be enabled or disabled as per setting without any error

Actual Behavior

operations insights enabled/disabled fine on primary, but on standby, it failed with error "Error: During update, Terraform expected the resource to reach state(s): AVAILABLE, but the service reported unexpected state: STANDBY.". However, when checking the oci console, the operations insights status has been updated correctly.

Steps to Reproduce

  1. use the code snippet above to create a remote standby
  2. run terraform plan which will pass. this is another big problem with this resource which has no validation and checks.
  3. terraform apply. This will succeed due to another bug with operations insights is not enabled correctly. details here: https://github.com/oracle/terraform-provider-oci/issues/1819
  4. run terraform plan again. you will see now it will update the operations insights to enable even though it supposed to do it the first time
  5. run terraform apply. now you will see the error for standby db.
  6. check oci console, the operations insights was actually enabled now.

Important Factoids

References

luckeyca commented 1 year ago

This problem happens when toggling either data management or operations insights on standby instance

ravinitp commented 1 year ago

Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.

luckeyca commented 1 year ago

this problem also happens when updating freeform tags. so it may happen to many other update actions

navg-orcl commented 1 year ago

please share the opc request ids or database ocids.

luckeyca commented 7 months ago

as of provider version 5.27.0, the problem still exists. standby adb ocid: ocid1.autonomousdatabase.oc1.ca-montreal-1.an4xkljr5xeuumqarwhds5htmuthqcqam4iy2mamdn2ghstmozwhiibcqcaq