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_db_snapshot "most_recent" breaks while snapshot is being taken #3870

Closed
ghost opened this issue Mar 22, 2018 · 2 comments
Closed

aws_db_snapshot "most_recent" breaks while snapshot is being taken #3870

ghost opened this issue Mar 22, 2018 · 2 comments
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@ghost
Copy link

ghost commented Mar 22, 2018

This issue was originally opened by @vikrim1 as hashicorp/terraform#17670. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

0.11.5

Terraform Configuration Files

data "aws_db_snapshot" "latest_prod_snapshot" {
  db_instance_identifier = "${lookup(var.rds_identifier, "prod")}"
  most_recent = true
}
[crash.log](https://github.com/hashicorp/terraform/files/1836155/crash.log)

Debug Output

Crash Output

panic: runtime error: invalid memory address or nil pointer dereference
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x2064962]
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4:
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: goroutine 141 [running]:
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.rdsSnapshotSort.Less(0xc4206a2ea0, 0x22, 0x22, 0x21, 0x0, 0x1)
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/aws/data_source_aws_db_snapshot.go:185 +0x42
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.(*rdsSnapshotSort).Less(0xc42064f960, 0x21, 0x0, 0x10a1e01)
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: :1 +0x62
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: sort.medianOfThree(0x41363a0, 0xc42064f960, 0x0, 0x11, 0x21)
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: /usr/local/go/src/sort/sort.go:82 +0x7e
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: sort.doPivot(0x41363a0, 0xc42064f960, 0x0, 0x22, 0x4c346c8, 0x0)
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: /usr/local/go/src/sort/sort.go:107 +0x96
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: sort.quickSort(0x41363a0, 0xc42064f960, 0x0, 0x22, 0xc)
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: /usr/local/go/src/sort/sort.go:192 +0x8a
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: sort.Sort(0x41363a0, 0xc42064f960)
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: /usr/local/go/src/sort/sort.go:220 +0x79
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.mostRecentDbSnapshot(0xc4206a2ea0, 0x22, 0x22, 0x1)
2018-03-21T21:56:52.285-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/aws/data_source_aws_db_snapshot.go:190 +0x71

Expected Behavior

Most recent snapshot identified

Actual Behavior

Crash

Steps to Reproduce

  1. Set up a terraform config that includes
    data "aws_db_snapshot" "snap" {
    db_instance_identifier = "...."
    most_recent = true
    }
  2. Start creating a snapshot on the db in "db_instance_identifier"
  3. Run terraform plan while snapshot is being created

Additional Context

References

@bflad bflad added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/rds Issues and PRs that pertain to the rds service. labels Mar 22, 2018
@bflad bflad added this to the v1.7.1 milestone Mar 22, 2018
@bflad
Copy link
Contributor

bflad commented Mar 22, 2018

Hi @vikram1 👋 Sorry you ran into trouble here. It looks like this was fixed in #2960, which was released in v1.7.1 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@bflad bflad closed this as completed Mar 22, 2018
@ghost
Copy link
Author

ghost commented Apr 7, 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 Apr 7, 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/rds Issues and PRs that pertain to the rds service.
Projects
None yet
Development

No branches or pull requests

1 participant