-
Notifications
You must be signed in to change notification settings - Fork 673
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
[CBR] Provider produced inconsistent result after apply #5002
[CBR] Provider produced inconsistent result after apply #5002
Comments
The same error is reported
This is an intermittent problem, a re-run in the same environment was successful. So it presents as a timing issue on the backend or a network issue to the backend that the provider might resolve with retry logic. Ref: terraform-ibm-cos 518 |
From TF_stdout.txt, I see the error was caused by creating a new zone with a zone name which already exists:
|
@zhenwan my take is that causality is the other way around. At 06:12:08 during an apply the error reported here is observed. The causality is not that the absent error reported in this issue was caused by the zone existing; The zone existing error was caused by the absent error. IMHO we see the duplicate because |
We have seen this in the past with other services. The terraform provider executes a POST api to create something, and then it does a GET to check if it is there. If the GET is done against a database which may not yet have the entry for the new resources (e.g. slow replication), the GET can return nothing, and terraform can retry the POST to create. |
Again just got hit with the same issue-
|
2024-02-05T12:47:59.312+0530 [INFO] provider.terraform-provider-ibm_v1.56.1: 2024/02/05 12:47:59 [Debug] Request: appears to show a retry loop following a rate limit (429) with 7 retries in 0.05 of a second, ignoring the retry-in field in the response? Showing At 12:48:00 shows the zone created (zone id: 8cbe290919a4bd58ea821e7f420f03bd) At 12:48:01 shows the zone does not exist |
@Ak-sky please escalate internally if getting no attention here |
@Ak-sky I tried TF Event Notification module example several times, I could not re-produce the issue that you saw. I have noticed that you are using Can you upgrade your version to the latest one, I just want to know if you still see the problem? Please upload the log files to this issue if the problem still exists. |
TestRunFSCloudExample 2024-02-06T20:10:26Z logger.go:66: - Installing ibm-cloud/ibm v1.62.0...
...
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: ╷
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: │ Error: Provider produced inconsistent result after apply
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: │
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: │ When applying changes to
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: │ module.cos_fscloud.module.buckets.module.buckets["cos-fscloud-wcvtor-bucket"].module.bucket_cbr_rule[0].ibm_cbr_rule.cbr_rule,
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: │ provider "provider[\"registry.terraform.io/ibm-cloud/ibm\"]" produced an
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: │ unexpected new value: Root resource was present, but now absent.
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: │
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: │ This is a bug in the provider, which should be reported in the provider's
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: │ own issue tracker.
TestRunFSCloudExample 2024-02-06T20:11:34Z logger.go:66: ╵ This is encountered multiple times a day at different provider versions from much older providers to the latest. @zhenwan there is IMHO a long standing race condition in the provider, as @ocofaigh notes without appropriate retry logic in the IBM provider. A resource is created and the state file is not updated which causes a cascading issue within a terraform environment. I don't have log files this run, it was just a regular run I was performing. |
Ran into this issue again- |
@Ak-sky Thank you for the logs. After checking logDNA, it looks the issue was caused by GET request sending to a different region immediately after the POST request. This is a known issue caused by Eventual consistency patten. We will see how we can mitigate this issue. |
@Ak-sky I want to let you know if you want to test the fix to this issue, you need to use v1.65.0-beta0 version. The version v1.64.2 does NOT include the fix |
@Ak-sky, please use the https://github.com/IBM-Cloud/terraform-provider-ibm/releases/tag/v1.65.0-beta0 to test if the fix is correct because all beta releases can still be used to target the production environment. The CBR team needs to determine is the fix is working; that's why it is labeled beta release. |
…ensure fix for known provider [issue](IBM-Cloud/terraform-provider-ibm#5002) is included (#467)
Ran into this issue again, running with TF version - TF Trace Log - cbr-fscloud_Trace_TFA_04.07.2024-20.30.10.log |
Community Note
Terraform CLI and Terraform IBM Provider Version
Terraform Version v1.5.7
Terraform IBM Provider Version v1.60.1
Affected Resource(s)
Terraform Configuration Files
We have noticed an issue during one of the test for TF Event Notification module example which is
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Adding Logs
TF_debug.log
TF_stdout.txt
Panic Output
Expected Behavior
All the zones should get created/destroyed during the TF operation.
Actual Behavior
Provider produced inconsistent result after apply.
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: