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]: CRASH while provisioning Lightsail instance and static IP #35727

Closed
dannyblaker opened this issue Feb 9, 2024 · 5 comments · Fixed by #37587
Closed

[Bug]: CRASH while provisioning Lightsail instance and static IP #35727

dannyblaker opened this issue Feb 9, 2024 · 5 comments · Fixed by #37587
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/lightsail Issues and PRs that pertain to the lightsail service.
Milestone

Comments

@dannyblaker
Copy link

dannyblaker commented Feb 9, 2024

Terraform Core Version

1.7.2

AWS Provider Version

5.36.0

Affected Resource(s)

lightsail, static ip, attaching static ip

Expected Behavior

it should create the AWS lightsail instance, then create the static ip, then attach the static ip to the instance, as per documentation

Actual Behavior

it creates the lightsail instance, but fails when creating static ip.

Relevant Error/Panic Output Snippet

╷
│ Error: Plugin did not respond
│ 
│   with aws_lightsail_instance.marketing_services,
│   on main.tf line 26, in resource "aws_lightsail_instance" "marketing_services":
│   26: resource "aws_lightsail_instance" "marketing_services" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵

Stack trace from the terraform-provider-aws_v5.36.0_x5 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x123da1a]

goroutine 70 [running]:
github.com/hashicorp/terraform-provider-aws/internal/tags.(*TagData).ValueString(...)
        github.com/hashicorp/terraform-provider-aws/internal/tags/key_value_tags.go:671
github.com/hashicorp/terraform-provider-aws/internal/tags.KeyValueTags.ResolveDuplicates(0xc00022f280?, {0x11a034a0, 0xc002a697a0}, 0x0, 0x0?, {0x7f01562ef1d8, 0xc002a58e00})
        github.com/hashicorp/terraform-provider-aws/internal/tags/key_value_tags.go:780 +0x19a
github.com/hashicorp/terraform-provider-aws/internal/provider.tagsResourceInterceptor.run({0xc00183fb40?, 0x1057df40?, 0x1057df38?}, {0x11a034a0, 0xc002a697a0}, {0x11a23028, 0xc002a58e00}, {0x10216820?, 0xc00059e000?}, 0x2, ...)
        github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:354 +0x9c9
github.com/hashicorp/terraform-provider-aws/internal/provider.interceptedHandler[...].func1(0x0?, {0x10216820?, 0xc00059e000?})
        github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:121 +0x40c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x11a034a0?, {0x11a034a0?, 0xc002a4bfb0?}, 0xd?, {0x10216820?, 0xc00059e000?})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.32.0/helper/schema/resource.go:773 +0x87
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0019d4e00, {0x11a034a0, 0xc002a4bfb0}, 0xc002a291e0, 0xc002a58c80, {0x10216820, 0xc00059e000})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.32.0/helper/schema/resource.go:909 +0xa7e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc001ac74e8, {0x11a034a0?, 0xc002a4be90?}, 0xc002a01c20)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.32.0/helper/schema/grpc_provider.go:1077 +0xe8d
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0x11a033f8?, {0x11a034a0?, 0xc002a4bb60?}, 0xc002a01c20)
        github.com/hashicorp/terraform-plugin-mux@v0.14.0/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x1b5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0005fbae0, {0x11a034a0?, 0xc002a4b170?}, 0xc0008d5c00)
        github.com/hashicorp/terraform-plugin-go@v0.21.0/tfprotov5/tf5server/server.go:845 +0x3dc
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xffe1ee0?, 0xc0005fbae0}, {0x11a034a0, 0xc002a4b170}, 0xc002a58400, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.21.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00131a400, {0x11a034a0, 0xc002a4b0e0}, {0x11a259e0, 0xc001cde4e0}, 0xc002a49d40, 0xc001cdc720, 0x18cb8418, 0x0)
        google.golang.org/grpc@v1.61.0/server.go:1385 +0xe49
google.golang.org/grpc.(*Server).handleStream(0xc00131a400, {0x11a259e0, 0xc001cde4e0}, 0xc002a49d40)
        google.golang.org/grpc@v1.61.0/server.go:1796 +0x1031
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/grpc@v1.61.0/server.go:1029 +0x91
created by google.golang.org/grpc.(*Server).serveStreams.func2
        google.golang.org/grpc@v1.61.0/server.go:1040 +0x145

Error: The terraform-provider-aws_v5.36.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Terraform Configuration Files

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.36.0"
    }
  }
}

provider "aws" {
  region = "ap-southeast-2"
}


resource "aws_lightsail_static_ip_attachment" "attach_static_ip" {
  static_ip_name = aws_lightsail_static_ip.create_static_ip.id
  instance_name  = aws_lightsail_instance.marketing_services.id
  depends_on = [ aws_lightsail_static_ip.create_static_ip, aws_lightsail_instance.marketing_services]
}

resource "aws_lightsail_static_ip" "create_static_ip" {
  name = "marketing_services"
  depends_on = [ aws_lightsail_instance.marketing_services ]
}

resource "aws_lightsail_instance" "marketing_services" {
  name              = "marketing_services_instance"
  availability_zone = "ap-southeast-2a"
  blueprint_id      = "ubuntu_22_04"
  bundle_id         = "medium_3_2"
  ip_address_type   = "dualstack"
  tags = {
    marketing = ""
  }
}

Steps to Reproduce

create free AWS account.
in a new terminal, paste in short term AWS credentials, then run:

terraform init
terraform plan
terraform apply

Debug Output

No response

Panic Output


│ Error: Plugin did not respond

│ with aws_lightsail_instance.marketing_services,
│ on main.tf line 26, in resource "aws_lightsail_instance" "marketing_services":
│ 26: resource "aws_lightsail_instance" "marketing_services" {

│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.

Stack trace from the terraform-provider-aws_v5.36.0_x5 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x123da1a]

goroutine 70 [running]:
github.com/hashicorp/terraform-provider-aws/internal/tags.(*TagData).ValueString(...)
github.com/hashicorp/terraform-provider-aws/internal/tags/key_value_tags.go:671
github.com/hashicorp/terraform-provider-aws/internal/tags.KeyValueTags.ResolveDuplicates(0xc00022f280?, {0x11a034a0, 0xc002a697a0}, 0x0, 0x0?, {0x7f01562ef1d8, 0xc002a58e00})
github.com/hashicorp/terraform-provider-aws/internal/tags/key_value_tags.go:780 +0x19a
github.com/hashicorp/terraform-provider-aws/internal/provider.tagsResourceInterceptor.run({0xc00183fb40?, 0x1057df40?, 0x1057df38?}, {0x11a034a0, 0xc002a697a0}, {0x11a23028, 0xc002a58e00}, {0x10216820?, 0xc00059e000?}, 0x2, ...)
github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:354 +0x9c9
github.com/hashicorp/terraform-provider-aws/internal/provider.interceptedHandler[...].func1(0x0?, {0x10216820?, 0xc00059e000?})
github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:121 +0x40c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x11a034a0?, {0x11a034a0?, 0xc002a4bfb0?}, 0xd?, {0x10216820?, 0xc00059e000?})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.32.0/helper/schema/resource.go:773 +0x87
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0019d4e00, {0x11a034a0, 0xc002a4bfb0}, 0xc002a291e0, 0xc002a58c80, {0x10216820, 0xc00059e000})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.32.0/helper/schema/resource.go:909 +0xa7e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc001ac74e8, {0x11a034a0?, 0xc002a4be90?}, 0xc002a01c20)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.32.0/helper/schema/grpc_provider.go:1077 +0xe8d
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0x11a033f8?, {0x11a034a0?, 0xc002a4bb60?}, 0xc002a01c20)
github.com/hashicorp/terraform-plugin-mux@v0.14.0/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x1b5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0005fbae0, {0x11a034a0?, 0xc002a4b170?}, 0xc0008d5c00)
github.com/hashicorp/terraform-plugin-go@v0.21.0/tfprotov5/tf5server/server.go:845 +0x3dc
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xffe1ee0?, 0xc0005fbae0}, {0x11a034a0, 0xc002a4b170}, 0xc002a58400, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.21.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00131a400, {0x11a034a0, 0xc002a4b0e0}, {0x11a259e0, 0xc001cde4e0}, 0xc002a49d40, 0xc001cdc720, 0x18cb8418, 0x0)
google.golang.org/grpc@v1.61.0/server.go:1385 +0xe49
google.golang.org/grpc.(*Server).handleStream(0xc00131a400, {0x11a259e0, 0xc001cde4e0}, 0xc002a49d40)
google.golang.org/grpc@v1.61.0/server.go:1796 +0x1031
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/grpc@v1.61.0/server.go:1029 +0x91
created by google.golang.org/grpc.(*Server).serveStreams.func2
google.golang.org/grpc@v1.61.0/server.go:1040 +0x145

Error: The terraform-provider-aws_v5.36.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@dannyblaker dannyblaker added the bug Addresses a defect in current functionality. label Feb 9, 2024
Copy link

github-actions bot commented Feb 9, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added crash Results from or addresses a Terraform crash or kernel panic. service/lightsail Issues and PRs that pertain to the lightsail service. labels Feb 9, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 9, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Feb 12, 2024
@acwwat
Copy link
Contributor

acwwat commented Feb 23, 2024

Duplicate of #32430.

Issue seems to have been fixed #31583 and one point but there is likely a regression since.

Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.52.0 milestone May 24, 2024
Copy link

This functionality has been released in v5.52.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. Thank you!

Copy link

github-actions bot commented Jul 1, 2024

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 Jul 1, 2024
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/lightsail Issues and PRs that pertain to the lightsail service.
Projects
None yet
3 participants