Skip to content
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

handle bad location for resource groups #821

Merged
merged 2 commits into from
Mar 26, 2020
Merged

handle bad location for resource groups #821

merged 2 commits into from
Mar 26, 2020

Conversation

frodopwns
Copy link
Contributor

Closes #733

What this PR does / why we need it:
Catches responses to CreateResourceGroup calls that have a code of 400. This will handle a broad range of errors but most specifically for this PR it catches the issue where a location has been requested that does not exist.

Special notes for your reviewer:

  • create an RG with a location like mcdonalds make sure it fails provisioning
  • create an rg you expect to succeed and make sure it does

@frodopwns frodopwns requested a review from melonrush13 March 26, 2020 16:21
@melonrush13
Copy link
Contributor

melonrush13 commented Mar 26, 2020

Sadly, "The Shire" isn't an official location of Azure datacenters (yet).

Was able to create a rg with valid location successfully 👍
Was able to create a rg with invalid location and given failure message in status.message, and error in logs 👍

Except, under status when i do -o yaml, it still says provisioning = true, that should be false, right @frodopwns ?

Here is my output
status: message: 'resources.GroupsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="LocationNotAvailableForResourceGroup" Message="The provided location ''theshire'' is not available for resource group. List of available regions is ''centralus,eastasia,southeastasia,eastus,eastus2,westus,westus2,northcentralus,southcentralus,westcentralus,northeurope,westeurope,japaneast,japanwest,brazilsouth,australiasoutheast,australiaeast,westindia,southindia,centralindia,canadacentral,canadaeast,uksouth,ukwest,koreacentral,koreasouth,francecentral,southafricanorth,uaenorth,australiacentral,switzerlandnorth,germanywestcentral,norwayeast''."' provisioning: true requested: "2020-03-26T17:52:37Z"

Copy link
Contributor

@melonrush13 melonrush13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked for me! 👍

(must have not pulled the latest last time. Here is my output below from yaml)
status: failedProvisioning: true message: 'resources.GroupsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="LocationNotAvailableForResourceGroup" Message="The provided location ''theshire'' is not available for resource group. List of available regions is ''centralus,eastasia,southeastasia,eastus,eastus2,westus,westus2,northcentralus,southcentralus,westcentralus,northeurope,westeurope,japaneast,japanwest,brazilsouth,australiasoutheast,australiaeast,westindia,southindia,centralindia,canadacentral,canadaeast,uksouth,ukwest,koreacentral,koreasouth,francecentral,southafricanorth,uaenorth,australiacentral,switzerlandnorth,germanywestcentral,norwayeast''."' requested: "2020-03-26T17:52:37Z"

@frodopwns frodopwns merged commit dee22f6 into Azure:master Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task: update Resourcegroup controller to catch and handle "LocationNotAvailableForResourceGroup"
2 participants