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

Crash while generating error message while updating zone lockdown #1776

Closed
2 tasks done
schans opened this issue Jul 15, 2022 · 2 comments · Fixed by #1777
Closed
2 tasks done

Crash while generating error message while updating zone lockdown #1776

schans opened this issue Jul 15, 2022 · 2 comments · Fixed by #1777
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.

Comments

@schans
Copy link
Contributor

schans commented Jul 15, 2022

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform: v1.2.2
Cloudflare provider: v3.19.0

Affected resource(s)

resource_cloudflare_zone_lockdown

Terraform configuration files

Nothing special..

Debug output

Can't easily get this from our build server. I think the error is obvious enough that this is not needed. If so, please let me know.

Panic output

Stack trace from the terraform-provider-cloudflare_v3.19.0 plugin:

panic: interface conversion: interface {} is nil, not string

goroutine 73 [running]:
github.com/cloudflare/terraform-provider-cloudflare/internal/provider.resourceCloudflareZoneLockdownUpdate({0xf95540, 0xc0003204e0}, 0xc000820c80, {0xe2b4e0?, 0xc0003ac600})
github.com/cloudflare/terraform-provider-cloudflare/internal/provider/resource_cloudflare_zone_lockdown.go:150 +0x765
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc000522380, {0xf95578, 0xc000305020}, 0xd?, {0xe2b4e0, 0xc0003ac600})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/resource.go:741 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000522380, {0xf95578, 0xc000305020}, 0xc00045a8f0, 0xc0001ce880, {0xe2b4e0, 0xc0003ac600})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/resource.go:847 +0x82c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000395230, {0xf95578?, 0xc000304f00?}, 0xc0009ee4b0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/grpc_provider.go:1021 +0xe3c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0003ed040, {0xf95578?, 0xc0003043c0?}, 0xc0008c80e0)
github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:813 +0x4fc
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xdfc060?, 0xc0003ed040}, {0xf95578, 0xc0003043c0}, 0xc0003204e0, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003aa8c0, {0xf98100, 0xc000102340}, 0xc000a68000, 0xc00050bb30, 0x14b5ac0, 0x0)
google.golang.org/grpc@v1.47.0/server.go:1283 +0xcfd
google.golang.org/grpc.(*Server).handleStream(0xc0003aa8c0, {0xf98100, 0xc000102340}, 0xc000a68000, 0x0)
google.golang.org/grpc@v1.47.0/server.go:1620 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/grpc@v1.47.0/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.47.0/server.go:920 +0x28a

Error: The terraform-provider-cloudflare_v3.19.0 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.

Expected output

The error message

Actual output

Panic

Steps to reproduce

Run terraform plan and apply..

Additional factoids

It is the error message generation that causes the error:
https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/internal/provider/resource_cloudflare_zone_lockdown.go#L150

References

No response

@schans schans 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 Jul 15, 2022
@github-actions
Copy link
Contributor

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 Jul 15, 2022
@schans
Copy link
Contributor Author

schans commented Jul 15, 2022

In our case an invalid IP range triggered an error response from cloudflare:

configurations {
          target = "ip_range"
          value  = "22001:11e8:123:1::/64"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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