-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Getting an intermittent failed to refresh Bearer token error when trying to delete my AKS cluster #2602
Comments
This comment has been minimized.
This comment has been minimized.
The same error happened besides AKS cluster creation/deletion. It seems that the error occurs in long-running plan/apply. The following is an example of it during Resource Group deletion at the end of long-running apply.
@katbyte Do you have any advice? |
Thanks for opening this issue :) This appears to be a bug in the authentication logic which we use to connect to Azure (specifically how it handles refreshing tokens) - as such this would require a bug-fix there (which is handled in this repository: http://github.com/hashicorp/go-azure-helpers). So that we're able to diagnose this further - would it be possible to know which method you're using to authenticate with Azure from Terraform (e.g. the Azure CLI / a Service Principal with a Client Secret etc)? Thanks! |
@tombuildsstuff Thanks! I use Azure CLI. |
@torumakabe thanks for confirming that. Since this appears to be an issue in the upstream library I've created an upstream issue for this: hashicorp/go-azure-helpers#22 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
It looks like Azure/go-autorest#476 was just recently merged in, so once it gets incorporated downstream this issue should be fixed. |
@amasover yeah, we've a PR ready to go into the base library to fix this, it's just waiting on a release of go-autorest which looks like it's happening soon-ish :) |
This has been released in version 1.37.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 1.37.0"
}
# ... other configuration ... |
We upgraded to 1.44.0 version of azurerm and now I'm seeing this problem first time. Anyone else experiencing this? this is what I have now: provider.azuread v0.7.0 |
Same for me. |
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! |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.11.10
AzureRM Provider v1.20.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
Unfortunately this happens intermittently, so I haven't been able to get debug output It started happening after I upgraded to AzureRM Provider v1.20, but I'm not sure if there is a connection.
Expected Behavior
Running
terraform destroy
should successfully delete the terraform provisioned AKS cluster on the first attempt.Actual Behavior
Running
terraform destroy
does not always successfully delete the terraform provisioned AKS cluster on the first attempt. It always succeeds on a second attempt.The error produced:
Steps to Reproduce
This unfortunately happens intermittently. But running a
terraform destroy
on an AKS cluster sometimes results in the error above.The text was updated successfully, but these errors were encountered: