Azure / Azure/azure-powershell
New-AzureRmRecoveryServicesVault - 'Please provide a different resource name or try again after 24 hours'
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
If I say Get-AzureRmRecoveryServicesVault it says there is NO vault. OK, so I then create it and it FAILS.
'Please provide a different resource name or try again after 24 hours'
No dammit. It either exists or it doesn't! Why the heck should I wait 24 hours to recreate a vault I deleted 15 minutes ago? If there is a reason, then the GET should not be returning empty. If there is a reason, the New should be giving me a sensible explanation. (you need -Debug to get the text!).
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.17763.1
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
get-module -name az
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 0.3.0 az
New-AzureRmRecoveryServicesVault -Name $BackUpVaultMelbourne `
-ResourceGroupName $RGASR `
-Location $Melbourne -Debug
DEBUG: 15:37:19 - NewAzureRmRecoveryServicesVault begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 15:37:21 - using account id 'LukeBrennan@outlook.com'...
DEBUG: [Common.Authentication]: Authenticating using Account: 'LukeBrennan@outlook.com', environment: 'AzureCloud', tenant: '1f89577f-4235
-4965-83e5-aad1a7e761fc'
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: 6ce2f4fe-d860-4f1a-888b-1abb7ef4dc2e - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.microsoftonline.com/1f89577f-4235-4965-83e5-aad1a7e761fc/
Resource: https://management.core.windows.net/
ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
CacheType: Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache (9 items)
Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: - TokenCache: Deserialized 9 items to token cache.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 10/14/2018 07:37:22: 6ce2f4fe-d860-4f1a-888b-1abb7ef4dc2e - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: 6ce2f4fe-d860-4f1a-888b-1abb7ef4dc2e - TokenCache: An item matching the requested resource was found in the ca
che
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 10/14/2018 07:37:22: 6ce2f4fe-d860-4f1a-888b-1abb7ef4dc2e - TokenCache: 40.0607112366667 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: 6ce2f4fe-d860-4f1a-888b-1abb7ef4dc2e - TokenCache: A matching item (access token or refresh token or both) was
found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: 6ce2f4fe-d860-4f1a-888b-1abb7ef4dc2e - AcquireTokenHandlerBase: === Token Acquisition finished successfully. A
n access token was retuned:
Access Token Hash: 2DCvs/tAOeHymcZpL/vxFOugVkG9bSkIyFpqioPNzJg=
Refresh Token Hash: +a+HaXBnzmPXSocI7fQBvKV9bzqJXnxH7xZTEXehVbM=
Expiration Time: 10/14/2018 08:17:26 +00:00
User Hash: YaMfsGPkmwxwhyKw73ipmyjRqqUKsNAj5t9JRnaYlxk=
DEBUG: [Common.Authentication]: Authenticating using Account: 'LukeBrennan@outlook.com', environment: 'AzureCloud', tenant: '1f89577f-4235
-4965-83e5-aad1a7e761fc'
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: 8bc48d5f-edc1-4014-a354-5875eacdd7a4 - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.microsoftonline.com/1f89577f-4235-4965-83e5-aad1a7e761fc/
Resource: https://management.core.windows.net/
ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
CacheType: Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache (9 items)
Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: - TokenCache: Deserialized 9 items to token cache.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 10/14/2018 07:37:22: 8bc48d5f-edc1-4014-a354-5875eacdd7a4 - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: 8bc48d5f-edc1-4014-a354-5875eacdd7a4 - TokenCache: An item matching the requested resource was found in the ca
che
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 10/14/2018 07:37:22: 8bc48d5f-edc1-4014-a354-5875eacdd7a4 - TokenCache: 40.0606444783333 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: 8bc48d5f-edc1-4014-a354-5875eacdd7a4 - TokenCache: A matching item (access token or refresh token or both) was
found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: 8bc48d5f-edc1-4014-a354-5875eacdd7a4 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. A
n access token was retuned:
Access Token Hash: 2DCvs/tAOeHymcZpL/vxFOugVkG9bSkIyFpqioPNzJg=
Refresh Token Hash: +a+HaXBnzmPXSocI7fQBvKV9bzqJXnxH7xZTEXehVbM=
Expiration Time: 10/14/2018 08:17:26 +00:00
User Hash: YaMfsGPkmwxwhyKw73ipmyjRqqUKsNAj5t9JRnaYlxk=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: f3114a10-4f24-4e18-a011-85c38e8a40d0 - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.microsoftonline.com/1f89577f-4235-4965-83e5-aad1a7e761fc/
Resource: https://management.core.windows.net/
ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
CacheType: Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache (9 items)
Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: - TokenCache: Deserialized 9 items to token cache.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 10/14/2018 07:37:22: f3114a10-4f24-4e18-a011-85c38e8a40d0 - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: f3114a10-4f24-4e18-a011-85c38e8a40d0 - TokenCache: An item matching the requested resource was found in the ca
che
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 10/14/2018 07:37:22: f3114a10-4f24-4e18-a011-85c38e8a40d0 - TokenCache: 40.060494535 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: f3114a10-4f24-4e18-a011-85c38e8a40d0 - TokenCache: A matching item (access token or refresh token or both) was
found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 10/14/2018 07:37:22: f3114a10-4f24-4e18-a011-85c38e8a40d0 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. A
n access token was retuned:
Access Token Hash: 2DCvs/tAOeHymcZpL/vxFOugVkG9bSkIyFpqioPNzJg=
Refresh Token Hash: +a+HaXBnzmPXSocI7fQBvKV9bzqJXnxH7xZTEXehVbM=
Expiration Time: 10/14/2018 08:17:26 +00:00
User Hash: YaMfsGPkmwxwhyKw73ipmyjRqqUKsNAj5t9JRnaYlxk=
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
PUT
Absolute Uri:
https://management.azure.com/subscriptions/b8e3a02e-456c-4060-a4fd-4fc9641f301d/resourceGroups/lukebrennan-ASRMel/providers/Microsoft.Reco
veryServices/vaults/lukebrennan-melASRvault?api-version=2016-06-01
Headers:
x-ms-client-request-id : cd30fa36-0dcd-4121-ae50-b405e9873fc0-2018-10-14 07:37:22Z-P
accept-language : en-US
Body:
{
"properties": {},
"sku": {
"name": "Standard"
},
"location": "australiasoutheast"
}
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
BadRequest
Headers:
Pragma : no-cache
X-Content-Type-Options : nosniff
x-ms-request-id : d13b1324-2ace-4263-9eb7-9d2ceec0b27e
x-ms-client-request-id : 10210b95-7bec-4e77-98da-0e1806d57b42
Strict-Transport-Security : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-writes: 1194
x-ms-correlation-request-id : d13b1324-2ace-4263-9eb7-9d2ceec0b27e
x-ms-routing-request-id : SOUTHEASTASIA:20181014T073725Z:d13b1324-2ace-4263-9eb7-9d2ceec0b27e
Cache-Control : no-cache
Date : Sun, 14 Oct 2018 07:37:24 GMT
Server : Microsoft-IIS/10.0
Body:
{
"error": {
"code": "BadRequest",
"message": "{\"ErrorCode\":\"CreateResourceFailedDueToInvalidCache\",\"Message\":{\"Language\":\"en-US\",\"Value\":\"Create Resource F
ailed as name is already in use\\r\\nPlease provide a different resource name or try again after 24 hours\"},\"Values\":[]}"
}
}
New-AzureRmRecoveryServicesVault : Operation failed.
ClientRequestId: cd30fa36-0dcd-4121-ae50-b405e9873fc0-2018-10-14 07:37:22Z-P
One or more errors occurred.
At line:1 char:1
+ New-AzureRmRecoveryServicesVault -Name $BackUpVaultMelbourne `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmRecoveryServicesVault], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.NewAzureRmRecoveryServicesVault
DEBUG: AzureQoSEvent: CommandName - New-AzureRmRecoveryServicesVault; IsSuccess - False; Duration - 00:00:07.2467053; Exception - System.E
xception: Operation failed.
ClientRequestId: cd30fa36-0dcd-4121-ae50-b405e9873fc0-2018-10-14 07:37:22Z-P
One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Microsoft.Rest.Azure.CloudException: {"Erro
rCode":"CreateResourceFailedDueToInvalidCache","Message":{"Language":"en-US","Value":"Create Resource Failed as name is already in use\r\n
Please provide a different resource name or try again after 24 hours"},"Values":[]}
at Microsoft.Azure.Management.RecoveryServices.VaultsOperations.d__8.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.Azure.Commands.RecoveryServices.PSRecoveryServicesClient.CreateVault(String resouceGroupName, String vaultName, Vault vaul
t)
at Microsoft.Azure.Commands.RecoveryServices.NewAzureRmRecoveryServicesVault.ExecuteCmdlet()
--- End of inner exception stack trace ---
at Microsoft.Azure.Commands.RecoveryServices.RecoveryServicesCmdletBase.HandleException(Exception ex)
at Microsoft.Azure.Commands.RecoveryServices.NewAzureRmRecoveryServicesVault.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord();
DEBUG: Finish sending metric.
DEBUG: 15:37:26 - NewAzureRmRecoveryServicesVault end processing.
DEBUG: 15:37:26 - NewAzureRmRecoveryServicesVault end processing.
Contributor guide
Research direction
Start with the New-AzureRmRecoveryServicesVault and Get-AzureRmRecoveryServicesVault commands described in the report, reproducing the behavior after deleting a vault. Inspect the -Debug PUT request and response to determine whether the failure is exposed by the cmdlet or the Azure service. Done should establish the cause and provide a clear, actionable outcome for the reported name-conflict error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100