Terraform-provider-azurerm: Build in tollerance for retryable errors with Azure Provisioner

Created on 13 Jun 2017  ·  5Comments  ·  Source: terraform-providers/terraform-provider-azurerm

_This issue was originally opened by @rorychatt as hashicorp/terraform#13934. It was migrated here as part of the provider split. The original body of the issue is below._


Hi there,

Terraform is quick. So quick infact that sometimes the Azure CLI isn't ready to accept the next create/destroy command in the graph sequence.

As a result, we can see errors like:

Error Creating/Updating LoadBalancer network.LoadBalancersClient#CreateOrUpdate: Failure responding to request: StatusCode=429 -- Original Error: autorest/azure: Service returned an error. Status=429 Code="RetryableError" Message="A retryable error occured." Details=[{"code":"ReferencedResourceNotProvisioned","message":"XXX-as used by resource bluelb-private is not in Succeeded state. Resource is in Updating state and the last operation that updated/is updating the resource is InternalOperation."}]

If you run Terraform again, the resource is correctly updated and the build concludes.

It would be awesome if we could build a retry tolerance into the Azure Resources (or resources in general) for errors that are flagged as "RetryableError" to reduce manual intravention. I can hackily get around this by adding sleeps into my code, but native implementation would be amazing.

Terraform Version

9.3

Similar errors are seen in this issue. hashicorp/terraform#7986 . In this case, I'm not convinced it's a graph/ordering error as the referenced lb has been completed and deployed before the error occurs. It feels like there is a lag in the Azure CLI before referencing created resources (Especially as it only happens sporadically).

bug upstream

All 5 comments

Hey @rorychatt

Thanks for opening this issue :)

Support for automatically retrying Retryable errors was added to the Azure SDK for Go in https://github.com/Azure/go-autorest/pull/155 which shipped in v0.1.6 of the AzureRM Terraform Provider.

Would you be able to upgrade to the latest version of the AzureRM Terraform Provider and let us know if you're still seeing this issue?

Thanks!

ping @rorychatt :)

Oops. Sorry @tombuildsstuff . Missed the original message :)

I've not been able to re-create the problem, but as the original problem was sporadic in nature, give me a week to confirm no resurgence.

👋 @rorychatt given we've not heard back from you here I'm assuming this is fixed and as such I'm going to close this issue - however please feel free to re-open it if this is still an issue :)

Thanks!

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings