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

aws_route53_zone : panic: runtime error: invalid memory address or nil pointer dereference #8370

Closed
meriouma opened this issue Apr 18, 2019 · 6 comments · Fixed by #12634
Closed
Assignees
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/route53 Issues and PRs that pertain to the route53 service.
Milestone

Comments

@meriouma
Copy link

meriouma commented Apr 18, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.13

Affected Resource(s)

  • aws_route53_zone

Terraform Configuration Files

variable "region" {
    default = "us-east-1"
}

variable "hostname" {
    default = "localhost"
}

provider "aws" {
    region = "${var.region}"
    access_key = "unused"
    secret_key = "unused"

    endpoints {
        apigateway = "http://${var.hostname}:4567"
        cloudformation = "http://${var.hostname}:4581"
        cloudwatch = "http://${var.hostname}:4582"
        dynamodb = "http://${var.hostname}:4569"
        es = "http://${var.hostname}:4578"
        firehose = "http://${var.hostname}:4573"
        iam = "http://${var.hostname}:4593"
        kinesis = "http://${var.hostname}:4568"
        lambda = "http://${var.hostname}:4574"
        route53 = "http://${var.hostname}:4580"
        redshift = "http://${var.hostname}:4577"
        s3 = "http://${var.hostname}:4572"
        secretsmanager = "http://${var.hostname}:4584"
        ses = "http://${var.hostname}:4579"
        sns = "http://${var.hostname}:4575"
        sqs = "http://${var.hostname}:4576"
        ssm = "http://${var.hostname}:4583"
        stepfunctions = "http://${var.hostname}:4585"
        sts = "http://${var.hostname}:4592"
    }

    s3_force_path_style = true
    skip_credentials_validation = true
    skip_metadata_api_check = true
    skip_requesting_account_id = true
}

resource "aws_route53_zone" "domain" {
    name = "somedomain.ca"
}

Debug Output

Panic Output

https://gist.github.com/meriouma/21604782c76d1dfcf824a0e5270c8802

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

Using localstack

@nywilken
Copy link
Contributor

@meriouma thanks for reporting this issue. I'm pulling out the log line that highlights where the resource is throwing the panic error.

2019-04-18T05:32:53.228Z [DEBUG] plugin.terraform-provider-aws_v2.6.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_route53_zone.go:144

@nywilken nywilken added service/route53 Issues and PRs that pertain to the route53 service. crash Results from or addresses a Terraform crash or kernel panic. labels Apr 18, 2019
@linux2647
Copy link

linux2647 commented Jul 2, 2019

This may be caused by the underlying localstack service not returning a ChangeInfo object as part of the CreateHostedZoneRespsonse object. moto's route53 module appears to be missing said object from its response.

Cf. the AWS Route53 API documentation

@bflad bflad added bug Addresses a defect in current functionality. and removed thinking labels Apr 2, 2020
bflad added a commit that referenced this issue Apr 2, 2020
…eation

Reference: #8370
Reference: #12361
Reference: hashicorp/terraform#10798

Prevent a crash with non-compliant Route 53 APIs during creation, e.g. LocalStack. This continues best effort support by adding object reference safety, which we should be doing anyways. This change skips synchronization checking rather than raising an error, which seems like the correct and operator friendly behavior in this situation.

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSRoute53Zone_disappears (48.02s)
--- PASS: TestAccAWSRoute53Zone_basic (51.48s)
--- PASS: TestAccAWSRoute53Zone_DelegationSetID (56.24s)
--- PASS: TestAccAWSRoute53Zone_multiple (57.08s)
--- PASS: TestAccAWSRoute53Zone_Comment (63.31s)
--- PASS: TestAccAWSRoute53Zone_Tags (79.33s)
--- PASS: TestAccAWSRoute53Zone_VPC_Single (99.31s)
--- PASS: TestAccAWSRoute53Zone_VPC_Multiple (179.74s)
--- PASS: TestAccAWSRoute53Zone_ForceDestroy_TrailingPeriod (189.14s)
--- PASS: TestAccAWSRoute53Zone_ForceDestroy (189.54s)
--- PASS: TestAccAWSRoute53Zone_VPC_Updates (265.16s)
```
@bflad
Copy link
Contributor

bflad commented Apr 2, 2020

Fix submitted: #12634

@bflad bflad self-assigned this Apr 2, 2020
@bflad bflad added this to the v2.60.0 milestone Apr 28, 2020
bflad added a commit that referenced this issue Apr 28, 2020
…eation (#12634)

Reference: #8370
Reference: #12361
Reference: hashicorp/terraform#10798

Prevent a crash with non-compliant Route 53 APIs during creation, e.g. LocalStack. This continues best effort support by adding object reference safety, which we should be doing anyways. This change skips synchronization checking rather than raising an error, which seems like the correct and operator friendly behavior in this situation.

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSRoute53Zone_disappears (48.02s)
--- PASS: TestAccAWSRoute53Zone_basic (51.48s)
--- PASS: TestAccAWSRoute53Zone_DelegationSetID (56.24s)
--- PASS: TestAccAWSRoute53Zone_multiple (57.08s)
--- PASS: TestAccAWSRoute53Zone_Comment (63.31s)
--- PASS: TestAccAWSRoute53Zone_Tags (79.33s)
--- PASS: TestAccAWSRoute53Zone_VPC_Single (99.31s)
--- PASS: TestAccAWSRoute53Zone_VPC_Multiple (179.74s)
--- PASS: TestAccAWSRoute53Zone_ForceDestroy_TrailingPeriod (189.14s)
--- PASS: TestAccAWSRoute53Zone_ForceDestroy (189.54s)
--- PASS: TestAccAWSRoute53Zone_VPC_Updates (265.16s)
```
@bflad
Copy link
Contributor

bflad commented Apr 28, 2020

The fix for this has been merged and will release with version 2.60.0 of the Terraform AWS Provider, later this week. 👍

@ghost
Copy link

ghost commented May 1, 2020

This has been released in version 2.60.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

adamdecaf pushed a commit to adamdecaf/terraform-provider-aws that referenced this issue May 28, 2020
…eation (hashicorp#12634)

Reference: hashicorp#8370
Reference: hashicorp#12361
Reference: hashicorp/terraform#10798

Prevent a crash with non-compliant Route 53 APIs during creation, e.g. LocalStack. This continues best effort support by adding object reference safety, which we should be doing anyways. This change skips synchronization checking rather than raising an error, which seems like the correct and operator friendly behavior in this situation.

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSRoute53Zone_disappears (48.02s)
--- PASS: TestAccAWSRoute53Zone_basic (51.48s)
--- PASS: TestAccAWSRoute53Zone_DelegationSetID (56.24s)
--- PASS: TestAccAWSRoute53Zone_multiple (57.08s)
--- PASS: TestAccAWSRoute53Zone_Comment (63.31s)
--- PASS: TestAccAWSRoute53Zone_Tags (79.33s)
--- PASS: TestAccAWSRoute53Zone_VPC_Single (99.31s)
--- PASS: TestAccAWSRoute53Zone_VPC_Multiple (179.74s)
--- PASS: TestAccAWSRoute53Zone_ForceDestroy_TrailingPeriod (189.14s)
--- PASS: TestAccAWSRoute53Zone_ForceDestroy (189.54s)
--- PASS: TestAccAWSRoute53Zone_VPC_Updates (265.16s)
```
@ghost
Copy link

ghost commented May 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/route53 Issues and PRs that pertain to the route53 service.
Projects
None yet
4 participants