profile
viewpoint

Ask questions[Recovery Services] Vague error messages when updating a policy

Bug Report

<!-- Thank you for opening a bug report. For faster processing, please include: -->

  • 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 <!-- and please describe: -->

  • 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.

<!-- Thanks! -->

Azure/azure-sdk-for-go

Answer questions katbyte

@pvrk & @TAdityaAnirudh, we are still seeing the exact same error as of today:

------- Stdout: -------
=== RUN   TestAccAzureRMRecoveryServicesProtectionPolicyVm_updateWeeklyToPartial
=== PAUSE TestAccAzureRMRecoveryServicesProtectionPolicyVm_updateWeeklyToPartial
=== CONT  TestAccAzureRMRecoveryServicesProtectionPolicyVm_updateWeeklyToPartial
--- FAIL: TestAccAzureRMRecoveryServicesProtectionPolicyVm_updateWeeklyToPartial (121.07s)
    testing.go:569: Step 1 error: errors during apply:
        
        Error: Error creating/updating Recovery Service Protection Policy "acctest-190918065225095847" (Resource Group "acctestRG-190918065225095847"): 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 "
        
          on /opt/teamcity-agent/temp/buildTmp/tf-test656137701/main.tf line 16:
          (source code not available)
        
        
FAIL
useful!

Related questions

SDK equivalent for CLI "az aks install-connector" hot 1
storage.ManagementPoliciesClient.CreateOrUpdate Failed with RequestIsNotValidJson hot 1
Authentication example needed hot 1
`go get` latest fails due to UUID usage hot 1
Cannot unmarshal ServicePrincipalListResult in call to graphrbac client.List hot 1
go get module no matching versions for query "latest hot 1
Key Management API for Function App hot 1
Application insights frustration hot 1
AAD Domain Service create/update fails with Request_InvalidDataContractVersion hot 1
Github User Rank List