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

[Bug]: Destroy of mongodbatlas_cloud_backup_snapshot_export_bucket fails with EXPORT_BUCKET_DELETE_FAILED_BUCKET_IN_USE #2325

Closed
2 tasks done
kschlesselmann opened this issue Jun 4, 2024 · 8 comments
Labels

Comments

@kschlesselmann
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Provider Version

v1.16.2

Terraform Version

v1.8.4

Terraform Edition

Terraform Open Source (OSS)

Current Behavior

If I setup snapshot exports to S3 via terraform subsequent terraform apply calls fail if I remove the resources again.

Terraform configuration to reproduce the issue

...

resource "mongodbatlas_cloud_backup_snapshot_export_bucket" "export_bucket" {
  depends_on = [mongodbatlas_cloud_provider_access_authorization.export_role]

  bucket_name    = local.account_backup_bucket_name
  cloud_provider = "AWS"
  iam_role_id    = mongodbatlas_cloud_provider_access_setup.export_role.role_id
  project_id     = data.mongodbatlas_project.shared.project_id
}

resource "mongodbatlas_cloud_backup_schedule" "export" {
  cluster_name = mongodbatlas_cluster.shared.name
  project_id   = data.mongodbatlas_project.shared.id
  auto_export_enabled = true

  export {
    export_bucket_id = mongodbatlas_cloud_backup_snapshot_export_bucket.export_bucket.export_bucket_id
    frequency_type = "daily"
  }

  use_org_and_group_names_in_export_prefix = true

  policy_item_daily {
    frequency_interval = 1
    retention_unit     = "days"
    retention_value    = 7
  }
}

Steps To Reproduce

Deploy a mongodbatlas_cloud_backup_schedule with an export configuration to a mongodbatlas_cloud_backup_snapshot_export_bucket and try to apply the configuration again without those resources.

Logs

Plan: 0 to add, 0 to change, 2 to destroy.
mongodbatlas_cloud_backup_snapshot_export_bucket.export_bucket: Destroying... [id=aWQ=:NjY1ZjBiMzdkZDNlYzgyOTg5YzdkNzRj-cHJvamVjdF9pZA==:NWViOTQzN2ZlYzRhZWEzNjBlMmNkM2U1]
mongodbatlas_cloud_backup_schedule.export: Destroying... [id=Y2x1c3Rlcl9uYW1l:c2hhcmVk-cHJvamVjdF9pZA==:NWViOTQzN2ZlYzRhZWEzNjBlMmNkM2U1]
mongodbatlas_cloud_backup_schedule.export: Destruction complete after 1s
╷
│ Error: error deleting snapshot export bucket (765f0b37dd3ec82989c7d74c): https://cloud.mongodb.com/api/atlas/v2/groups/5eb9437fec4aea360e2cd3e8/backup/exportBuckets/765f0b37dd3ec82989c7d74c DELETE: HTTP 400 Bad Request (Error code: "EXPORT_BUCKET_DELETE_FAILED_BUCKET_IN_USE") Detail: Failed to delete export Bucket with ID 765f0b37dd3ec82989c7d74c. Reason: Export bucket with ID 765f0b37dd3ec82989c7d74c is being used in an automatic export policy for cluster shared.. Reason: Bad Request. Params: [765f0b37dd3ec82989c7d74c Export bucket with ID 765f0b37dd3ec82989c7d74c is being used in an automatic export policy for cluster shared.]

Code of Conduct

  • I agree to follow this project's Code of Conduct
Copy link
Contributor

github-actions bot commented Jun 4, 2024

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-252283 was created for internal tracking.

Copy link
Contributor

This issue has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!

@github-actions github-actions bot added the stale label Jun 10, 2024
@kschlesselmann
Copy link
Author

bump

@Zuhairahmed
Copy link
Collaborator

Internal Jira ticket for tracking purposes: https://jira.mongodb.org/browse/HELP-60534

@github-actions github-actions bot removed the stale label Jun 11, 2024
@kschlesselmann
Copy link
Author

grafik

Is this intended?

@gssbzn
Copy link
Collaborator

gssbzn commented Jun 11, 2024

Is this intended?

yes

Copy link
Contributor

This issue has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!

@github-actions github-actions bot added the stale label Jun 17, 2024
@AgustinBettati
Copy link
Member

Closing issue as we will keep track directly from support case and associated ticket (https://jira.mongodb.org/browse/HELP-60534). As of latest update we are waiting for a fix from the API side when deleting the cloud backup schedule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants