azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'westeurope' and API version '2022-03-02-preview' for type 'managedClusters'

Open hasanm64 opened this issue 1 year ago • 18 comments

Describe the bug

Hi All,

I am facing issue with managedclusters resource. I am not mentioning any API version. Still it gives me error related to API version. I am running terraform validate command with below versions. terraform: 1.0.0 Azurerm: 3.20

NOTE:

  1. This was working fine till February 22nd when I last ran it.
  2. I am already using latest version of azurecli..2.57.0.
  3. I donot see this error when using azurerm version of 2.81 and tf version 0.15.5

Related command

terraform validate

Errors

│ Error: retrieving Cluster: (Managed Cluster Name "aks-cluster1" / Resource Group "my-rg"): containerservice.ManagedClustersClient#Get: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'westeurope' and API version '2022-03-02-preview' for type 'managedClusters'. The supported api-versions are '2017-08-31, 2018-03-31, 2019-02-01, 2019-04-01, 2019-06-01, 2019-08-01, 2019-10-01, 2019-11-01, 2020-01-01, 2020-02-01, 2020-03-01, 2020-04-01, 2020-06-01, 2020-07-01, 2020-09-01, 2020-11-01, 2020-12-01, 2021-02-01, 2021-03-01, 2021-05-01, 2021-07-01, 2021-08-01, 2021-09-01, 2021-10-01, 2022-01-01, 2022-02-01, 2022-03-01, 2022-04-01, 2022-06-01, 2022-07-01, 2022-07-02-preview, 2022-08-01, 2022-08-02-preview, 2022-08-03-preview, 2022-09-01, 2022-09-02-preview, 2022-10-02-preview, 2022-11-01, 2022-11-02-preview, 2023-01-01, 2023-01-02-preview, 2023-02-01, 2023-02-02-preview, 2023-03-01, 2023-03-02-preview, 2023-04-01, 2023-04-02-preview, 2023-05-01, 2023-05-02-preview, 2023-06-01, 2023-06-02-preview, 2023-07-01, 2023-07-02-preview, 2023-08-01, 2023-08-02-preview, 2023-09-01, 2023-09-02-preview, 2023-10-01, 2023-10-02-preview, 2023-11-01, 2023-11-02-preview, 2024-01-01, 2024-01-02-preview'. The supported locations are 'australiacentral, australiacentral2, australiaeast, australiasoutheast, brazilsouth, brazilsoutheast, canadacentral, canadaeast, centralindia, centralus, eastasia, eastus, eastus2, francecentral, francesouth, germanynorth, germanywestcentral, israelcentral, italynorth, japaneast, japanwest, jioindiacentral, jioindiawest, koreacentral, koreasouth, northcentralus, northeurope, norwayeast, norwaywest, polandcentral, qatarcentral, southafricanorth, southafricawest, southcentralus, southindia, southeastasia, swedencentral, switzerlandnorth, switzerlandwest, uaecentral, uaenorth, uksouth, ukwest, westcentralus, westeurope, westus, westus2, westus3'."

Issue script & Debug output

NA

Expected behavior

It should retrieve the resource details

Environment Summary

Azurecli: 2.57 terraform: 1.0.0 Azurerm: 3.20

Additional context

No response

hasanm64 avatar Mar 04 '24 05:03 hasanm64

Hi @hasanm64,

This is a known issue.

Please follow https://github.com/Azure/azure-cli/issues/23985#issue-1383263012 to get temporary workaround.

If you feel that further discussion is needed, please add a comment with the text /clibot unresolve to reopen the issue.

Hi @hasanm64 Find similar issue https://github.com/Azure/azure-cli/issues/28368.

Issue title az resource show can intermittently fail if the service is currently rolling out a manifest update that adds a new API version
Create time 2024-02-14
Comment number 4

Please confirm if this resolves your issue.

Thank you for opening this issue, we will look into it.

yonzhan avatar Mar 04 '24 05:03 yonzhan

/clibot unresolve opening this as there is no resolution yet and this is blocking many of our activities.

hasanm64 avatar Mar 04 '24 05:03 hasanm64

Please open this issue in terraform repo

yonzhan avatar Mar 04 '24 05:03 yonzhan

/clibot unresolve hi @yonzhan , This was working few days ago with same terraform(1.0.0) and azurerm (3.20) version. It started to fail since 2 days complaining about the API version in cli.

hasanm64 avatar Mar 04 '24 06:03 hasanm64

Please let me know which CLI command you use?

yonzhan avatar Mar 04 '24 06:03 yonzhan

I am not passing any particular command. Terraform fetches the resources in backend when we use terraform validate command on our azure subscription.

hasanm64 avatar Mar 04 '24 06:03 hasanm64

and just now I tried with azurerm version 3.90 instead of 3.20 and it works fine. Not sure at which exact version it is breaking.

hasanm64 avatar Mar 04 '24 06:03 hasanm64

Please provide more details related to CLI commands.

jsntcy avatar Mar 05 '24 10:03 jsntcy

I'm also facing this issue when running terraform plan. Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'westus' and API version '2022-01-02-preview' for type 'managedClusters'.

IhorKamniev avatar Mar 05 '24 16:03 IhorKamniev

I am also facing the same issue when i use terraform plan or terraform apply

ramxis avatar Mar 07 '24 11:03 ramxis

I am facing this with ARM templates as well, the workaround mentioned in https://github.com/Azure/azure-cli/issues/23985#issue-1383263012 can't be applied with this workflow.

dparv avatar Mar 08 '24 10:03 dparv

I am also facing the same issue when running terraform plan

Code="NoRegisteredProviderFound" 
Message="No registered resource provider found for location 'australiaeast' 
and API version '2022-03-02-preview' for type 'managedClusters'. 

seanslma avatar Mar 11 '24 06:03 seanslma

I'm also facing this issue when running terraform plan. Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'westus' and API version '2022-01-02-preview' for type 'managedClusters'.

facing the same issue today, do we have any solution for this?

sr185401 avatar Mar 11 '24 09:03 sr185401

the issue went away for me when i set the azurerm to v 3.94.0.

# Configure the Azure provider
terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "3.94.0"
    }
  }
  required_version = ">= 1.1.0"
}

ramxis avatar Mar 11 '24 10:03 ramxis

the issue went away for me when i set the azurerm to v 3.94.0.

# Configure the Azure provider
terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "3.94.0"
    }
  }
  required_version = ">= 1.1.0"
}

Thanks this fixed it for me. I was on 3.0.4 previously.

michaelschuett-tomtom avatar Mar 26 '24 16:03 michaelschuett-tomtom

Thank you, @michaelschuett-tomtom! This fixed it for me - I was using v3.0.4 and encountering the 400 error, but updating to 3.94.0, running terraform init -upgrade, then running apply again provisioned my AKS cluster as expected.

ChuckkNorris avatar Aug 29 '24 21:08 ChuckkNorris