Closed guyguy333 closed 2 years ago
@guyguy333 thank you for the report. Do you happen to have any trace or debug level logs? If so we can more quickly check what is going on and what is being sent to the API.
@themantissa Sure, here is the request:
PATCH /api/atlas/v1.0/groups/xxxxxxxx/clusters/xxxxxxxx/backup/schedule HTTP/1.1
Host: cloud.mongodb.com
User-Agent: terraform-provider-mongodbatlas/1.1.1 go-mongodbatlas/0.14.0 (darwin;amd64)
Content-Length: 227
Accept: application/json
Content-Type: application/json
Accept-Encoding: gzip
{
"referenceHourOfDay": 0,
"referenceMinuteOfHour": 0,
"restoreWindowDays": 0,
"policies": [
{
"id": "xxxxxxxx",
"policyItems": [
{
"frequencyInterval": 1,
"frequencyType": "hourly",
"retentionUnit": "days",
"retentionValue": 1
}
]
}
]
}
restoreWindowDays
is sent with value 0
but this value is not set in terraform resource and is optional according to API.
HTTP/2.0 400 Bad Request
Content-Length: 153
Content-Type: application/json
Date: Wed, 01 Dec 2021 18:18:28 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: envoy
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload;
X-Envoy-Upstream-Service-Time: 28
X-Frame-Options: DENY
X-Mongodb-Service-Version: gitHash=d9c89be46aa0993ba6c4aa98750aa952d725cd46; versionString=v20211117
X-Permitted-Cross-Domain-Policies: none
{
"detail": "The restore window days should be a positive number.",
"error": 400,
"errorCode": "INVALID_RESTORE_WINDOW",
"parameters": [],
"reason": "Bad Request"
}
Thank you @guyguy333 - that should be sufficient. Let me have the team take a look
Internal ticket INTMDB-283
@guyguy333 we are about to release the fix in version 1.2. The pre-release is completed if you'd like to test first. Thank you.
Thank you, we will try to update to 1.2 asap and let you know
Fixed in 1.2
Terraform CLI and Terraform MongoDB Atlas Provider Version
Terraform Configuration File
Steps to Reproduce
terraform init
terraform apply
Expected Behavior
Cloud backup schedule is setup
Actual Behavior
Debug Output
Crash Output
Additional Context
We use exactly the same code with our AWS clusters without any issues for many weeks. We're now having this issue deploying a cluster on Azure.
According to API (https://docs.atlas.mongodb.com/reference/api/cloud-backup/schedule/modify-one-schedule/), restoreWindowDays is optional and value is not set in our HCL.
References