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]: Error: Provider produced inconsistent result after apply - .region_usage_restrictions: was null, but now cty.StringVal("COMMERCIAL_FEDRAMP_REGIONS_ONLY") #2263

Open
2 tasks done
Patrick-Catenzaro opened this issue May 9, 2024 · 4 comments
Labels

Comments

@Patrick-Catenzaro
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Provider Version

1.16.0

Terraform Version

1.2.3

Terraform Edition

Terraform Open Source (OSS)

Current Behavior

Terraform applies are failing for projects in the MongoDB Atlas for Government instance after a recent change to the provider. Terraform starts the apply and then complains that "Error: Provider produced inconsistent result after apply". This is only effecting MongoDB Atlas for Government projects at this time. We even tried removing the project resource from the Terraform State file and then importing it back and the same behavior was seen.

resource/mongodbatlas_project: Reads region_usage_restrictions attribute value from get request (#2104)

Terraform configuration to reproduce the issue

provider "mongodbatlas" {
  public_key          = var.mongodb_atlas_api_pub_key
  private_key         = var.mongodb_atlas_api_pri_key
  is_mongodbgov_cloud = true
}

resource "mongodbatlas_project" "project" {
  count                        = var.enabled ? 1 : 0
  name                         = local.project_name
  org_id                       = var.mongodb_atlas_org_id
  is_data_explorer_enabled     = true
  with_default_alerts_settings = false

}

Steps To Reproduce

  1. Create a project with a version of the provider older than 1.16.0 ex: 1.15.3
  2. Upgrade the provider to 1.16.0
  3. Run a Terraform apply with the changed provider
  4. Issue will appear after the apply completes

Logs

Error: Provider produced inconsistent result after apply
When applying changes to module.mongodb_project.mongodbatlas_project.project[0], provider "module.mongodb_project.provider[\"registry.terraform.io/mongodb/mongodbatlas\"]" produced an unexpected new value: .region_usage_restrictions: was null, but now cty.StringVal("COMMERCIAL_FEDRAMP_REGIONS_ONLY"). 
This is a bug in the provider, which should be reported in the provider's own issue tracker.

Code of Conduct

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

github-actions bot commented May 9, 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-248517 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 May 15, 2024
@marcosuma
Copy link
Collaborator

Hi @Patrick-Catenzaro, thanks for opening this issue with us. From a quick look I had, it looks like this change might be causing the inconsistency you found out during the upgrade (cc @maastha).
While this is just an hypothesis, have you tried of setting the value of region_usage_restrictions to COMMERCIAL_FEDRAMP_REGIONS_ONLY in your script?

While that might not be ideal, it could help you unblock this problem. In any case, if this upgrade bug is confirmed, we should release a fix.

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 May 23, 2024
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

2 participants