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

Provider produced inconsistent result after apply #148

Closed
aneroid13 opened this issue Jun 11, 2021 · 4 comments
Closed

Provider produced inconsistent result after apply #148

aneroid13 opened this issue Jun 11, 2021 · 4 comments
Milestone

Comments

@aneroid13
Copy link

Hello,
there is problem on dns_ptr_record creation.

Terraform Version

Terraform v0.14.5

Affected Resource(s)

Please list the resources as a list, for example:

  • dns_ptr_record

Terraform Configuration Files

main_init.tf

### - DNS records config - ###
provider "dns" {
  update {
    server  = local.zoneconf.AD_server
    gssapi {
        realm    = upper(local.zoneconf.AD_domain)
        username = data.vault_generic_secret.TF_ad_nix.data["login"]
        password  = data.vault_generic_secret.TF_ad_nix.data["password"]
        
    }
  }
}

module "dns-test" {
    source = "./test1"
    name = "zzz-tst1"
    default_ip_address = "10.10.10.10"
}

./test-srv/module_dns.tf

locals {
    domain = "testdomain.com"
}
variable "default_ip_address" {}
variable "name" {}

resource "dns_a_record_set" "dns_a" {
      zone = "${local.domain}."
      name = var.name
      addresses = [ var.default_ip_address ]
      ttl = 900

      lifecycle {
         ignore_changes = [ ttl ]
         }
  }

resource "dns_ptr_record" "dns_ptr" {
      zone = "10.in-addr.arpa."
      name = join(".", reverse(split(".", trimprefix(var.default_ip_address, "10."))))
      ptr = "${var.name}.${local.domain}."
      ttl = 900
      
     lifecycle {
         ignore_changes = [ ttl ]
         } 
}

Expected Behavior

What should have happened?

dns_a_record_set should be created.

Actual Behavior

What actually happened?

Error: Provider produced inconsistent result after apply

When applying changes to module.dns-test.dns_ptr_record.dns_ptr, provider
"registry.terraform.io/hashicorp/dns" produced an unexpected new value: Root resource was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own issue tracker.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Issue not permanent.
dns_a_record_set create after some terraform apply runs.

@aneroid13
Copy link
Author

@bmhughes
Copy link

bmhughes commented Jul 5, 2021

Same issues here with Terraform v1.0.1, I can hit it with all RR types.

edit

I've done some more debugging and found this (in my case) is due to the DNS server not returning the expected DNS result after the creation of the resource. So a dynamic update occurs without error but the DNS server won't serve the record due to some other misconfiguration (BIND with an overlapping authoritative domain in my case).

@bflad
Copy link
Contributor

bflad commented Apr 14, 2023

This particular Terraform Provider produced inconsistent result after apply error with the details of Root resource was present, but now absent. should be covered by the changes in #260. Those changes will be released in version 3.3.0 sometime in the near future.

@bflad bflad closed this as completed Apr 14, 2023
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants