Open wuxu92 opened 1 month ago
@puneetsarna Could you take a look at this Nginx conflict issue?
@wuxu92 if the API is returning this then we'll need a lock within the Resource to account for this, fwiw?
@tombuildsstuff You are right! I shared this issue with @puneetsarna before. they are going to look into it to address it either with a lock in azurerm or fix it in the server side eliminating the need for a lock in the provider.
@valyria257
@wuxu92 is this a regularly occurring failure? I've tried reproducing it locally, but I'm unable to.
I found the above example deployment, acctest-240703234536886299
, in our logs. It looks like we received an Azure Marketplace webhook in the same second as a PUT request to create the NGINX configuration. Order of events:
This seems like a one off, but I'm curious @wuxu92 how often are you seeing this?
@valyria257 This happens occasionally, I guess it is less than 1/10 in the nginx basic acc test. I'm wondering if the marketplace webhook is configured by the tenant or by the Nginx service? as I cannot see any related configuration from my side.
@wuxu92 Our Microsoft partner team handles the webhooks, so you're right that it's unrelated to the user's configuration. If you have any other example failures, or run into future ones, can you copy the details here? I want to make sure these failures have the same root cause.
@valyria257 This has occurred 2 or 3 times in the past month, with details identical to this issue.
Thanks @wuxu92, could you copy the test output for those failures? It contains the nginx deployment information that I can use to search through our internal logs.
@valyria257 got a new AnotherOperationInProgress failure last week:
Error: creating Nginx Deployment (Subscription: "*******"
Resource Group Name: "acctestRG-auto-240808001130629913"
Nginx Deployment Name: "acctest-240808001130629913"): polling after DeploymentsCreateOrUpdate: polling failed: the Azure API returned the following error:
Status: "Failed"
Code: "AnotherOperationInProgress"
Message: "Another operation on this or dependent resource is in progress."
Activity Id: ""
---
API Response:
----[start]----
{"id":"/providers/Nginx.NginxPlus/locations/EASTUS2/operationStatuses/2f311127-0fec-40c3-9705-411b91e6da19*EF803AD73E0248A034EEEA00C1EC9628B05A2A45680445108CA13852213B4FB8","name":"2f311127-0fec-40c3-9705-411b91e6da19*EF803AD73E0248A034EEEA00C1EC9628B05A2A45680445108CA13852213B4FB8","resourceId":"/subscriptions/*******/resourceGroups/acctestRG-auto-240808001130629913/providers/Nginx.NginxPlus/nginxDeployments/acctest-240808001130629913","status":"Failed","startTime":"2024-08-08T00:12:28.1508864Z","endTime":"2024-08-08T00:13:55.2210789Z","error":{"code":"AnotherOperationInProgress","message":"Another operation on this or dependent resource is in progress."}}
-----[end]-----
with azurerm_nginx_deployment.test,
on terraform_plugin_test.tf line 110, in resource "azurerm_nginx_deployment" "test":
110: resource "azurerm_nginx_deployment" "test" {
creating Nginx Deployment (Subscription:
"*******"
Resource Group Name: "acctestRG-auto-240808001130629913"
Nginx Deployment Name: "acctest-240808001130629913"): polling after
DeploymentsCreateOrUpdate: polling failed: the Azure API returned the
following error:
Status: "Failed"
Code: "AnotherOperationInProgress"
Message: "Another operation on this or dependent resource is in progress."
Activity Id: ""
---
API Response:
----[start]----
{"id":"/providers/Nginx.NginxPlus/locations/EASTUS2/operationStatuses/2f311127-0fec-40c3-9705-411b91e6da19*EF803AD73E0248A034EEEA00C1EC9628B05A2A45680445108CA13852213B4FB8","name":"2f311127-0fec-40c3-9705-411b91e6da19*EF803AD73E0248A034EEEA00C1EC9628B05A2A45680445108CA13852213B4FB8","resourceId":"/subscriptions/*******/resourceGroups/acctestRG-auto-240808001130629913/providers/Nginx.NginxPlus/nginxDeployments/acctest-240808001130629913","status":"Failed","startTime":"2024-08-08T00:12:28.1508864Z","endTime":"2024-08-08T00:13:55.2210789Z","error":{"code":"AnotherOperationInProgress","message":"Another
operation on this or dependent resource is in progress."}}
-----[end]-----
Thanks @wuxu92! I'm currently looking into this now.
Is there an existing issue for this?
Community Note
Terraform Version
v1.8.3
AzureRM Provider Version
3.107.0
Affected Resource(s)/Data Source(s)
azurerm_nginx_configuration, azurerm_nginx_certificate
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
A lock should be added to sequence the operations on the same Nginx deployment.
Actual Behaviour
Steps to Reproduce
No response
Important Factoids
No response
References
No response