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

refresh fails if AWS Route53 zone already deleted #4185

Closed
ashb opened this issue Dec 7, 2015 · 1 comment · Fixed by #4198
Closed

refresh fails if AWS Route53 zone already deleted #4185

ashb opened this issue Dec 7, 2015 · 1 comment · Fixed by #4198

Comments

@ashb
Copy link
Contributor

ashb commented Dec 7, 2015

This is probably similar to #4047 but for Route53 records and zones.

How I hit this problem in practice was not by deleting anything manually but by just using terraform destroy:

  • terraform plan -destroy -out destroy.plan

  • terraform apply destroy.plan -- this failed half way through with aws_subnet.databases-subnet: Error deleting subnet: timeout while waiting for state to become 'destroyed'

  • I tried to run terraform plan -destroy again and get this error mesage:

    Error refreshing state: 4 error(s) occurred:
    
    * aws_route53_record.registry_dns: NoSuchHostedZone: The specified hosted zone does not exist.
            status code: 404, request id: dd456a5b-9cd1-11e5-b2c8-178933496bcb
    * aws_route53_record.marathon_dns.0: NoSuchHostedZone: The specified hosted zone does not exist.
            status code: 404, request id: dd86b9a9-9cd1-11e5-8801-79758f4904fa
    * aws_route53_record.marathon_dns.2: NoSuchHostedZone: The specified hosted zone does not exist.
            status code: 404, request id: ddaa6df8-9cd1-11e5-853f-0b7d26528b7c
    * aws_route53_record.marathon_dns.1: NoSuchHostedZone: The specified hosted zone does not exist.
            status code: 404, request id: dda05c7a-9cd1-11e5-bb36-ef7ee1b36da7
    

To reproduce:

  • Create this resource
provider "aws" {
    region     = "eu-west-1"
}
resource "aws_route53_zone" "test" {
    name   = "terraformrepropo.local"
    comment = "Terraform bug reproduce case"
}

resource "aws_route53_record" "public_ssh" {
    zone_id = "${aws_route53_zone.test.id}"
    name    = "test"
    type    = "A"
    ttl     = "300"
    records = ["127.0.0.1"]
}
  • Go into the AWS console and delete the test record set, and then also delete the terraformrepropo.local zone.
  • Run terraform refresh or terraform plan -destroy
  • You should see output like this:
aws_route53_zone.test: Refreshing state... (ID: Z1EM87IEBLNEE5)
aws_route53_record.public_ssh: Refreshing state... (ID: Z1EM87IEBLNEE5_test_A)
Error refreshing state: 1 error(s) occurred:

* aws_route53_record.public_ssh: NoSuchHostedZone: The specified hosted zone does not exist.
        status code: 404, request id: 8acb4ddf-9cd3-11e5-bb30-2ba8f9088e65
@ghost
Copy link

ghost commented Apr 29, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants