pulumi-azure-native: Destroy Azure Cosmos DB throwing exception
Hello!
- Vote on this issue by adding a 👍 reaction
- To contribute a fix for this issue, leave a comment (and link to your pull request, if you’ve opened one already)
Issue details
When running pulumi destroy we get an exception that the Cosmos DB Account has already an ongoing operation, which seems to be the Delete operation from pulumi destroy.
When trying to run it again it will again throw another exception with the same error.
Note: Azure Cosmos DB Account takes a lot of time to be provisioned and to get deleted.
pulumi:pulumi:Stack :
error: update failed
azure-native:documentdb:DatabaseAccount:
error: Code="PreconditionFailed" Message="There is already an operation in progress which requires exclusive lock on this service xxx. Please retry the operation after sometime.\r\nActivityId: xxxx, Microsoft.Azure.Documents.Common/2.14.0"
package.json
"dependencies": {
"@pulumi/azure": "^4.0.0",
"@pulumi/azure-native": "^1.0.0",
"@pulumi/pulumi": "^3.3.1",
Steps to reproduce
- Write code to create a new DB Account
return new azureNative.documentdb.DatabaseAccount(... pulumi uppulumi destroy
Expected: I am not sure maybe the author can reply 😃 Actual: Exception is thrown from pulumi
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 4
- Comments: 19 (6 by maintainers)
CosmosDB is very slow to delete. I suspect the reason behind the exception is, that the delete operation times out, and pulumi (or the sdk) retries, and as the resource is already under deletion, it throws. We solved this by using a custom resource options with custom timeouts for the delete operation.
But maybe change the defaults for dbaccount is better.
Hi @jirikopecky, if it happens very reliably for you, it would be very helpful if you capture verbose logs. They will contain some data like your subscription id, though, so might want to replace it or filter the log down to the HTTP requests and responses to/from Azure.