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

CANNOT_DISABLE_PIT_WITH_BACKUP_COMPLIANCE_POLICY #1855

Closed
mvaduguru87 opened this issue Jan 18, 2024 · 5 comments
Closed

CANNOT_DISABLE_PIT_WITH_BACKUP_COMPLIANCE_POLICY #1855

mvaduguru87 opened this issue Jan 18, 2024 · 5 comments

Comments

@mvaduguru87
Copy link

mvaduguru87 commented Jan 18, 2024

Terraform CLI and Terraform MongoDB Atlas Provider Version

 Terraform Version 1.6.4
Terraform MongoDB Atlas Provider Version 1.14.0

###Terraform Edition

Terraform OSS

Terraform Configuration File

#resource "mongodbatlas_backup_compliance_policy" "this" {
  count                      = var.enabled ? 1 : 0
  project_id                 = var.project_id
  authorized_email           = ###
  copy_protection_enabled    = false
  pit_enabled                = true
  encryption_at_rest_enabled = false
  authorized_user_first_name = "###"
  authorized_user_last_name = "###"
restore_window_days = var.restore_window_days
...
}

Steps to Reproduce

Plan/Apply 

Actual Behavior

When the flag enabled is set to true , the plan is getting generated but when applying the plugin is crashing.
plugincrash.log

When the flag enabled is set to false , the plan is getting generated but when applying getting the error
Error: error creating MongoDB Cluster: POST https://cloud.mongodb.com/api/atlas/v1.0/groups/65a8075d15a5527895928ac4/clusters: 400 (request "CANNOT_DISABLE_PIT_WITH_BACKUP_COMPLIANCE_POLICY") Continuous Cloud Backup is required by Backup Compliance Policy.
Screenshot 2024-01-18 at 5 43 42 PM

-->

Debug Output

Crash Output

Additional Context

References

(https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/backup_compliance_policy)

Copy link
Contributor

Thanks for opening this issue! Please make sure you've followed our guidelines when opening the issue. In short, to help us reproduce the issue we need:

  • Terraform configuration file used to reproduce the issue
  • Terraform log files from the run where the issue occurred
  • Terraform Atlas provider version used to reproduce the issue
  • Terraform version used to reproduce the issue
  • Confirmation if Terraform OSS, Terraform Cloud, or Terraform Enterprise deployment

The ticket CLOUDP-224356 was created for internal tracking.

@maastha
Copy link
Collaborator

maastha commented Jan 19, 2024

Hi @mvaduguru87
Thank you for creating this issue, I could not reproduce this and was able to successfully update pit_enabled to true.

Could you please help us with below details to look further into this issue?

  • Terraform configuration file used to reproduce the issue (including cluster configuration and complete config for mongodbatlas_backup_compliance_policy)
  • Terraform log files from the run where the issue occurred (the provided log file only shows panic: interface conversion: interface {} is nil, not string, not the errors you got from the API, you could try export TF_LOG=”TRACE” as mentioned in our guidelines)

I would also request you to provide further details to help with one-click reproducible issues principle as mentioned in our guidelines.

@maastha maastha added the stale label Jan 19, 2024
@mvaduguru87
Copy link
Author

mvaduguru87 commented Jan 19, 2024

Certainly!. We are using modules to create the clusters. Hence I am providing you with the output of the plan that still provides you cluster configuration. Please find attached file terraformplan_1_14_0.txt for the details.
terraformplan_1_14_0.txt

I am also attaching the trace logs. terraform_1.14_1_trace.log
terraform_1_14_1_trace.log

I also want to mention that since all our clusters that have already been created are using V1.13.1 mongo db provider version, I tried to use the same to run the clusters. I received the same error. I am attaching the configurations in file and tracelogs.
terraformplan_1_13_1.txt
terraform_1_13_1__v1_trace.log

The error in all these cases is same - Error: error creating MongoDB Cluster: POST https://cloud.mongodb.com/api/atlas/v1.0/groups/65a8075d15a5527895928ac4/clusters: 400 (request "CANNOT_DISABLE_PIT_WITH_BACKUP_COMPLIANCE_POLICY") Continuous Cloud Backup is required by Backup Compliance Policy.

Please let me know if you need any more details. Unfortunately I couldn't provide you a one -click reproducible files. I hope what is provided will help to identity the issue.

Also please note that I removed all the sensitive information from the trace files.

@github-actions github-actions bot removed the stale label Jan 20, 2024
@maastha
Copy link
Collaborator

maastha commented Jan 22, 2024

Hi @mvaduguru87

I was able to reproduce panic: interface conversion: interface {} is nil, not string error in v1.14.0. This is already fixed in #1803 (see comment) and would be available in our next release planned in the next few weeks.

As for CANNOT_DISABLE_PIT_WITH_BACKUP_COMPLIANCE_POLICY error when creating the cluster, I'd request you to open a HELP support ticket https://support.mongodb.com/ to get support from the appropriate team as this seems like an issue with the way backup compliance policy and the cluster are configured.

Note that I am not sure of the exact order in which updates were performed, but with the fix mentioned above I was able to successfully create a cluster with same configuration as yours (with mongodbatlas_backup_compliance_policy.pit_enabled = true) but received below error if I tried to update it to false

Error: error updating a Backup Compliance Policy: xxxxx: PUT https://cloud-dev.mongodb.com/api/atlas/v1.0/groups/xxxxxx/backupCompliancePolicy: 400 (request "BACKUP_COMPLIANCE_POLICY_SETTINGS_INVALID") Invalid Backup Compliance Policy settings: a support ticket is required to turn off point-in-time option or decrease the restore window.

@maastha maastha closed this as completed Jan 22, 2024
@mvaduguru87
Copy link
Author

Thank you for your response. When are you planning to release the next fix?

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

No branches or pull requests

2 participants