azure-sdk-for-go: [Recovery Services] Vague error messages when updating a policy

Bug Report

  • import path of package in question, e.g. .../services/compute/mgmt/2018-06-01/compute "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-06-01/backup"

  • SDK version e.g. master, latest, 18.1.0

{
			"checksumSHA1": "XiQW2U5GBOhOfPTwFlFeM2thDCs=",
			"path": "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-06-01/backup",
			"revision": "2935c0241c74bd8549b843978dd6fc1be6f48b4a",
			"revisionTime": "2018-08-31T14:25:13Z",
			"version": "=v20.1.0",
			"versionExact": "v20.1.0"
		},
  • output of go version go version go1.10.3 darwin/amd64
  • What happened? I am trying to update a recovery service policy retention days via this new terraform resource. Creating the policy works just fine for all configurations, however updating from daily -> weekly, or changing the retention days for monthly or yearly gives a vague error:
* azurerm_recovery_services_protection_policy_vm.test: Error creating/updating Recovery Service Protection Policy "acctest-7026298197833106544" (Resource Group "acctestRG-7026298197833106544"): backup.ProtectionPoliciesClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BMSUserErrorInvalidPolicyInput" Message="Input for create or update policy is not in proper format\r\nPlease check format of parameters like schedule time, schedule days, retention time and retention days "

The error message does not help, and I cannot see why this would create just fine, yet fail to update. Other values will update just fine.

  • What did you expect or want to happen? the policy be updated or a more detailed error message describing what is actually wrong.

  • How can we reproduce it? run the updateDailyToWeekly test in that PR.

  • Anything we should know about your environment.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 42 (10 by maintainers)

Most upvoted comments

Hey, so this is still a thing! I’m using arm templates and am getting this error message, I know that someone said they’ve improved the error message, i can only assume they mean this

Please check format of parameters like schedule time, schedule days, retention time and retention days

This is not an improvement, I’m sure this is a common pain point because times need to be in the crazy time format, but my times all check out. I have a feeling it’s something wrong with layout of the resource itself, and the biggest issue there is that the documentation is lacking and i’m being incredibly nice here.

VERBOSE: Performing the operation "Creating Deployment" on target "ptech-testing".
VERBOSE: 3:32:30 PM - Template is valid.
VERBOSE: 3:32:31 PM - Create template deployment 'azurevmworkload-test'
VERBOSE: 3:32:31 PM - Checking deployment status in 5 seconds
VERBOSE: 3:32:36 PM - Checking deployment status in 5 seconds
New-AzureRmResourceGroupDeployment : 3:32:41 PM - Resource Microsoft.RecoveryServices/vaults/backupPolicies 'RSV-01/AzureVmWorkloadProtectionPolicy' failed with message '{
  "error": {
    "code": "BMSUserErrorInvalidPolicyInput",
    "message": "Input for create or update policy is not in proper format. Please check format of parameters like schedule time, schedule days, retention time and retention days "
  }
}'

@marstr, would you be able to follow up on this?