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

terraform-provider-cloudflare_v4.38.0 plugin crashed! #3525

Closed
3 tasks done
ashim-shrestha2020 opened this issue Jul 30, 2024 · 6 comments
Closed
3 tasks done

terraform-provider-cloudflare_v4.38.0 plugin crashed! #3525

ashim-shrestha2020 opened this issue Jul 30, 2024 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@ashim-shrestha2020
Copy link

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

cloudflare/cloudflare v4.38.0
terraform_version: v1.8.6

Affected resource(s)

update any resource

Terraform configuration files

resource "cloudflare_ruleset" "transform_bxcredit_request_headers" {
  zone_id = cloudflare_zone.this.id
  name        = "Country Code HTTP request header modification"
  description = "Country Code"
  kind        = "zone"
  phase       = "http_request_late_transform"
  rules {
    action = "rewrite"
    action_parameters {
      headers {
        name      = "BX-Country-Code"
        operation = "set"
        expression = "ip.src.country"
      }
    }
    expression = "true"
    description = " Request Header Country Code Rule"
    enabled = true
  }

  rules {
    action = "rewrite"
    action_parameters {
      headers {
        name      = "x-Internal"
        operation = "set"
        value = "false"
      }
    }
    expression = "(not ip.src in $blackstone_iplist) or (not ip.src in $zscaler_iplist)"
    description = "External user header"
    enabled = true
  } 

  rules {
    action = "rewrite"
    action_parameters {
      headers {
        name      = "x-Internal"
        operation = "set"
        value = "true"
      }
    }
    expression = "(ip.src in $blackstone_iplist) or (ip.src in $zscaler_iplist)"
    description = "Internal user on the header"
    enabled = true
  }

  rules {
    action = "rewrite"
    action_parameters {
      headers {
        name      = "x-bot-score"
        operation = "set"
        expression = "to_string(cf.bot_management.score)"
      }
    }
    expression = "true"
    description = "Bot Scores bxcreditpriveeurope"
    enabled = true
  }
}

Link to debug output

can't submit this

Panic output

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

panic: interface conversion: interface {} is nil, not []interface {}

goroutine 10 [running]:
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider.resourceCloudflareZoneSettingsOverrideStateUpgradeV1.func1(...)
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider/resource_cloudflare_zone_settings_override_migrate.go:46
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider.resourceCloudflareZoneSettingsOverrideStateUpgradeV1({0x0?, 0x0?}, 0xc000ac7290, {0x0?, 0x0?})
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider/resource_cloudflare_zone_settings_override_migrate.go:51 +0x185
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).upgradeJSONState(0xc000010270, {0x207d018, 0xc000a9b170}, 0xd?, 0x1df0e6c?, 0x14?)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:491 +0x75
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).UpgradeResourceState(0xc000010270, {0x207d018?, 0xc000a9b080?}, 0xc000982760)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:367 +0x3fa
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.UpgradeResourceState({{0x208c6d8?, 0xc000010270?}}, {0x207d018?, 0xc000a9b080?}, 0xc0009826a0?)
github.com/hashicorp/[email protected]/tf5to6server/tf5to6server.go:175 +0x143
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).UpgradeResourceState(0x207d050?, {0x207d018?, 0xc00093bb30?}, 0xc0009826a0)
github.com/hashicorp/[email protected]/tf6muxserver/mux_server_UpgradeResourceState.go:36 +0x19f
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).UpgradeResourceState(0xc0007f95e0, {0x207d018?, 0xc00093ae40?}, 0xc00098e5f0)
github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:751 +0x278
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_UpgradeResourceState_Handler({0x1cffd80?, 0xc0007f95e0}, {0x207d018, 0xc00093ae40}, 0xc0009a4300, 0x0)
github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:446 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000e3000, {0x207d018, 0xc00093adb0}, {0x20855a0, 0xc0009ba180}, 0xc00009c240, 0xc000a39770, 0x2eb18b8, 0x0)
google.golang.org/[email protected]/server.go:1369 +0xe23
google.golang.org/grpc.(*Server).handleStream(0xc0000e3000, {0x20855a0, 0xc0009ba180}, 0xc00009c240)
google.golang.org/[email protected]/server.go:1780 +0x1016
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/[email protected]/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 8
google.golang.org/[email protected]/server.go:1030 +0x135

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

Failed generating plan JSON
Exit code: 1

Failed to marshal plan to json: error marshaling prior state: schema version 0 for cloudflare_zone_settings_override.bxcredit_priveeurope_override in state does not match version 1 from the provider
Operation failed: 2 errors occurred:

  • failed running terraform plan (exit 1)
  • failed generating plan JSON: failed running command (exit 1)

Expected output

successful plan

Actual output

plan fails

Steps to reproduce

update a resource
tf plan

Additional factoids

No response

References

No response

@ashim-shrestha2020 ashim-shrestha2020 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 30, 2024
Copy link
Contributor

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
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 30, 2024
@ashim-shrestha2020
Copy link
Author

Debug log
terraform_log_1.txt

@jacobbednarz
Copy link
Member

i'm afraid this issue doesn't make any sense in it's current form. the repro is referencing cloudflare_ruleset in an plan operation, while the crash refers to cloudflare_zone_setttings_override resource and the debug log demonstrates an import operation.

can you please simplify and correct this issue for it to be triaged?

Copy link
Contributor

github-actions bot commented Sep 1, 2024

Marking this issue as stale due to 30 days of inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 7 days it will automatically be closed. Maintainers can also remove the lifecycle/stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

Copy link
Contributor

github-actions bot commented Sep 9, 2024

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2024
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. lifecycle/stale triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

2 participants