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

cloudflare_teams_location fails to import default location #4846

Closed
3 tasks done
brennoo opened this issue Jan 8, 2025 · 3 comments · Fixed by #4859
Closed
3 tasks done

cloudflare_teams_location fails to import default location #4846

brennoo opened this issue Jan 8, 2025 · 3 comments · Fixed by #4859
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.
Milestone

Comments

@brennoo
Copy link

brennoo commented Jan 8, 2025

Confirmation

  • This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
  • I have searched the issue tracker and my issue isn't already found.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.7.4
on darwin_arm64

  • provider registry.terraform.io/cloudflare/cloudflare v4.50.0
  • provider registry.terraform.io/hashicorp/aws v5.82.2

Affected resource(s)

cloudflare_teams_location

Terraform configuration files

resource "cloudflare_teams_location" "default" {
  account_id     = var.account_id
  name           = "default"
  client_default = true
  ecs_support    = true
}

Link to debug output

no

Panic output

Stack trace from the terraform-provider-cloudflare_v4.50.0 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10528e9a0]

goroutine 145 [running]:
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider.flattenTeamsEndpoints(0x0)
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider/resource_cloudflare_teams_location.go:390 +0x30
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider.resourceCloudflareTeamsLocationRead({0x106153a48, 0x140008484e0}, 0x1400050cc80, {0x106131140?, 0x1400056c000})
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider/resource_cloudflare_teams_location.go:101 +0xe34
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider.resourceCloudflareTeamsLocationImport({0x106153a48, 0x140008484e0}, 0x1400050cc80, {0x106131140, 0x1400056c000})
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider/resource_cloudflare_teams_location.go:203 +0x2dc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).ImportState(0x140005c8000, {0x106153a48, 0x140008484e0}, 0x140002d5478, {0x14000716280, 0x41})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/provider.go:475 +0x128
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ImportResourceState(0x14000598030, {0x106153a48?, 0x140008483f0?}, 0x14000848450)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1267 +0x4f0
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ImportResourceState({{0x106165720?, 0x14000598030?}}, {0x106153a48?, 0x140008483f0?}, 0x140008480c0?)
github.com/hashicorp/[email protected]/tf5to6server/tf5to6server.go:133 +0x124
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ImportResourceState(0x140005ca000, {0x106153a48?, 0x14000848120?}, 0x140008480c0)
github.com/hashicorp/[email protected]/tf6muxserver/mux_server_ImportResourceState.go:36 +0x184
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ImportResourceState(0x1400047a140, {0x106153a48?, 0x140007e7710?}, 0x140003c18b0)
github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:896 +0x1dc
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ImportResourceState_Handler({0x1060d45e0, 0x1400047a140}, {0x106153a48, 0x140007e7710}, 0x1400050c900, 0x0)
github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:629 +0x1c0
google.golang.org/grpc.(*Server).processUnaryRPC(0x1400019ec00, {0x106153a48, 0x140007e7680}, {0x10615d2c0, 0x140005aa1a0}, 0x140009f79e0, 0x1400011eab0, 0x106f8c050, 0x0)
google.golang.org/[email protected]/server.go:1394 +0xb64
google.golang.org/grpc.(*Server).handleStream(0x1400019ec00, {0x10615d2c0, 0x140005aa1a0}, 0x140009f79e0)
google.golang.org/[email protected]/server.go:1805 +0xb20
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/[email protected]/server.go:1029 +0x84
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 30
google.golang.org/[email protected]/server.go:1040 +0x13c

Expected output

I expected the resource being imported

Actual output

panic

Steps to reproduce

terraform import cloudflare_teams_location.default /

Additional factoids

I haven't tested for other locations

References

No response

@brennoo brennoo added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 8, 2025
Copy link

github-actions bot commented Jan 8, 2025

Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of TF_LOG=DEBUG output to be provided. The only parts that should be redacted are your user credentials in the X-Auth-Key, X-Auth-Email and Authorization HTTP headers. Details such as zone or account identifiers are not considered sensitive but can be redacted if you are very cautious. This log file provides additional context from Terraform, the provider and the Cloudflare API that helps in debugging issues. Without it, maintainers are very limited in what they can do and may hamper diagnosis efforts.

This issue has been marked with triage/needs-information and is unlikely to receive maintainer attention until the log file is provided making this a complete bug report.

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 8, 2025
Copy link

github-actions bot commented Jan 8, 2025

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 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.

Copy link

This functionality has been released in v4.51.0 of the Terraform Cloudflare 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!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant