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

Crashes on cloudflare_notification_policy #1189

Closed
2 tasks done
abruyelles opened this issue Sep 13, 2021 · 5 comments · Fixed by #1542
Closed
2 tasks done

Crashes on cloudflare_notification_policy #1189

abruyelles opened this issue Sep 13, 2021 · 5 comments · Fixed by #1542
Labels
triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@abruyelles
Copy link

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.0.6
on linux_amd64

  • provider registry.terraform.io/cloudflare/cloudflare v2.26.1

Affected resource(s)

cloudflare_notification_policy

Terraform configuration files

resource cloudflare_notification_policy notif {
	account_id = var.account_id
	name = "Pool enablement"
	description = "Pool enablement"
	enabled     =  true
	alert_type  = "g6_pool_toggle_alert"

	email_integration {
		id   =  "[email protected]"
	}
	filters = {
		enabled = ["true", "false"]
	}
}

Debug output

log.txt

Panic output

No response

Expected output

I expect the ressource to be created without crashing terraform

Actual output

Plugin crashes

Steps to reproduce

  1. Copy the configuration
  2. Run terraform apply

Additional factoids

No response

References

No response

@abruyelles abruyelles 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 Sep 13, 2021
@fabiosammy
Copy link

fabiosammy commented Jan 25, 2022

Still having this issue, more information about it (just for using the filters resource):

  filters = {
    "zones": [
      cloudflare_zone.admin.id,
      cloudflare_zone.public.id,
      cloudflare_zone.service.id
    ]
  }
---
  filters = {
    zones = [
      cloudflare_zone.admin.id,
      cloudflare_zone.public.id,
      cloudflare_zone.service.id
    ]
  }

Terraform version:

$ terraform --version
Terraform v1.0.11
on linux_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v3.7.0
+ provider registry.terraform.io/hashicorp/aws v3.72.0
+ provider registry.terraform.io/hashicorp/random v3.1.0

Your version of Terraform is out of date! The latest version
is 1.1.4. You can update by downloading from https://www.terraform.io/downloads.html


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

panic: Unknown validation type: 6

goroutine 73 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.validateMapValues({0xd1efdb, 0x7}, 0xc00064cfe0, 0xc000403b80, {0xc00064cf60, 0x1, 0x1})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1912 +0x969
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validateMap(0xc27820, {0xd1efdb, 0x7}, {0xc27820, 0xc000638c00}, 0x8bbfac, 0xc0006432e8, {0xc00064cf60, 0x1, 0x1})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1819 +0x271
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validateType(0xc00064cde0, {0xd1efdb, 0x7f2d6a}, {0xc27820, 0xc000638c00}, 0xc000403b80, 0xc158c0, {0xc00064cf60, 0x1, 0x1})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:2111 +0x185
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validate(0xc46d00, {0xd1efdb, 0x7}, 0xc000403b80, 0xc000643708, {0xc00064cf60, 0x1, 0x1})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1534 +0x71a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validateObject(0xc000638c60, {0x0, 0xc000634210}, 0xcf7120, 0xc00064c8d0, {0x13ca548, 0xc27820, 0xc000638b40})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1970 +0x585
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Validate(...)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:649
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Validate(0xc0003ef260, 0xc0003d0300)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:542 +0x4d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).ValidateResource(0xe4cd60, {0xc00052e140, 0x1e}, 0xc000638b40)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/provider.go:254 +0xf2
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ValidateResourceTypeConfig(0xc000320120, {0xc00063a1c0, 0xd1d11f}, 0xc0006341b0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:230 +0x126
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ValidateResourceTypeConfig(0xc000322880, {0xe4c660, 0xc000638000}, 0xc00063a000)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:503 +0x2e2
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ValidateResourceTypeConfig_Handler({0xcede60, 0xc000322880}, {0xe4c660, 0xc000638000}, 0xc000636000, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:272 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003388c0, {0xe5ae28, 0xc00049a000}, 0xc00053cc60, 0xc000451380, 0x138b2b0, 0x0)
	google.golang.org/[email protected]/server.go:1297 +0xccf
google.golang.org/grpc.(*Server).handleStream(0xc0003388c0, {0xe5ae28, 0xc00049a000}, 0xc00053cc60, 0x0)
	google.golang.org/[email protected]/server.go:1626 +0xa2a
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/[email protected]/server.go:941 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/[email protected]/server.go:939 +0x294

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

╷
│ Error: Plugin did not respond
│ 
│   with cloudflare_zone.service,
│   on zones.tf line 17, in resource "cloudflare_zone" "service":
│   17: resource "cloudflare_zone" "service" {
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ValidateResourceConfig call. The plugin logs may
│ contain more details.
╵
ERRO[0031] 1 error occurred:
	* exit status 1

@jacobbednarz
Copy link
Member

@abruyelles can you please provide the full output of TF_LOG=DEBUG (not truncated, just sensitive data redacted) to assist with where this crash is occurring?

@jacobbednarz jacobbednarz added triage/needs-information Indicates an issue needs more information in order to work on it. and removed 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 31, 2022
@abruyelles
Copy link
Author

@jacobbednarz Yes, here is the output from 3.8.0:
log.txt

@0gajun
Copy link

0gajun commented Mar 18, 2022

@jacobbednarz

Hi, I've tried to fix this issue and opened PR #1520 !

But, I couldn't find the document about filter attribute like #1406 , so the PR only supports zone and services filters.

I think that there are more filters and we need to add support for additional filters.
Could you provide information about the filters in that PR?

@nikuljain
Copy link

We see the same issue on v3.35 also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
5 participants