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

v5.0.0-alpha1 - Failed to import cloudflare_account #4470

Closed
3 tasks done
warwickbrownteya opened this issue Oct 29, 2024 · 2 comments
Closed
3 tasks done

v5.0.0-alpha1 - Failed to import cloudflare_account #4470

warwickbrownteya opened this issue Oct 29, 2024 · 2 comments
Labels
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. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.

Comments

@warwickbrownteya
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

2024-10-29T16:18:32.241Z [INFO] Terraform version: 1.9.8
2024-10-29T16:18:32.241Z [DEBUG] using github.com/hashicorp/go-tfe v1.58.0
2024-10-29T16:18:32.241Z [DEBUG] using github.com/hashicorp/hcl/v2 v2.20.0
2024-10-29T16:18:32.241Z [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2024-10-29T16:18:32.241Z [DEBUG] using github.com/zclconf/go-cty v1.14.4
2024-10-29T16:18:32.241Z [INFO] Go runtime version: go1.22.7
2024-10-29T16:18:32.241Z [INFO] CLI args: []string{"terraform", "-v"}
2024-10-29T16:18:32.241Z [DEBUG] Attempting to open CLI config file: /Users/redacted/.terraformrc
2024-10-29T16:18:32.241Z [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2024-10-29T16:18:32.241Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2024-10-29T16:18:32.241Z [DEBUG] ignoring non-existing provider search directory /Users/redacted/.terraform.d/plugins
2024-10-29T16:18:32.241Z [DEBUG] ignoring non-existing provider search directory /Users/redacted/Library/Application Support/io.terraform/plugins
2024-10-29T16:18:32.241Z [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2024-10-29T16:18:32.241Z [INFO] CLI command args: []string{"version", "-v"}
Terraform v1.9.8
on darwin_arm64

  • provider registry.terraform.io/cloudflare/cloudflare v5.0.0-alpha1

Affected resource(s)

cloudflare_account

Terraform configuration files

terraform {
  required_providers {
    cloudflare = {
      source = "cloudflare/cloudflare"
      version = "5.0.0-alpha1"
    }
  }
}

variable "api_token" {
  type = string
  description = "Cloudflare API Token"
  sensitive = true
}

variable "cloudflare_account_name" {
  type        = string
  description = "The name of the Cloudflare account"
}

variable "cloudflare_account_type" {
  type        = string
  description = "The Cloudflare account type"
}

provider "cloudflare" {
  api_token = var.api_token
}

resource "cloudflare_account" "this" {
  name              = var.cloudflare_account_name
  type              = var.cloudflare_account_type
}

Link to debug output

https://gist.github.com/warwickbrownteya/2ec6b3e83fd1a21ac30c3e8029689325

Panic output

2024-10-29T16:13:10.842Z [INFO] Terraform version: 1.9.8
2024-10-29T16:13:10.842Z [DEBUG] using github.com/hashicorp/go-tfe v1.58.0
2024-10-29T16:13:10.842Z [DEBUG] using github.com/hashicorp/hcl/v2 v2.20.0
2024-10-29T16:13:10.842Z [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2024-10-29T16:13:10.842Z [DEBUG] using github.com/zclconf/go-cty v1.14.4
2024-10-29T16:13:10.842Z [INFO] Go runtime version: go1.22.7
2024-10-29T16:13:10.842Z [INFO] CLI args: []string{"terraform", "import", "-var-file", "terraform.tfvars", "cloudflare_account.this", "redacted"}
2024-10-29T16:13:10.842Z [DEBUG] Attempting to open CLI config file: /Users/redacted/.terraformrc
2024-10-29T16:13:10.842Z [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2024-10-29T16:13:10.842Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2024-10-29T16:13:10.842Z [DEBUG] ignoring non-existing provider search directory /Users/redacted/.terraform.d/plugins
2024-10-29T16:13:10.842Z [DEBUG] ignoring non-existing provider search directory /Users/redacted/Library/Application Support/io.terraform/plugins
2024-10-29T16:13:10.842Z [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2024-10-29T16:13:10.842Z [INFO] CLI command args: []string{"import", "-var-file", "terraform.tfvars", "cloudflare_account.this", "redacted"}
2024-10-29T16:13:10.896Z [DEBUG] checking for provisioner in "."
2024-10-29T16:13:10.898Z [DEBUG] checking for provisioner in "/opt/homebrew/bin"
2024-10-29T16:13:10.900Z [DEBUG] Building and walking import graph
2024-10-29T16:13:10.900Z [DEBUG] Not attaching any node states: overall state is nil
2024-10-29T16:13:10.900Z [DEBUG] No state, no orphan outputs
2024-10-29T16:13:10.900Z [DEBUG] ProviderTransformer: "cloudflare_account.this (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2024-10-29T16:13:10.900Z [DEBUG] created provider logger: level=debug
2024-10-29T16:13:10.900Z [INFO] provider: configuring client automatic mTLS
2024-10-29T16:13:10.906Z [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-alpha1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-alpha1 args=[".terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-alpha1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-alpha1"]
2024-10-29T16:13:10.911Z [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-alpha1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-alpha1 pid=73905
2024-10-29T16:13:10.911Z [DEBUG] provider: waiting for RPC address: plugin=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-alpha1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-alpha1
2024-10-29T16:13:10.931Z [INFO] provider.terraform-provider-cloudflare_v5.0.0-alpha1: configuring server automatic mTLS: timestamp=2024-10-29T16:13:10.931Z
2024-10-29T16:13:10.937Z [DEBUG] provider: using plugin: version=6
2024-10-29T16:13:10.937Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: plugin address: address=/var/folders/h0/jcw6g9913y57mnyldtnn76n80000gp/T/plugin2396722292 network=unix timestamp=2024-10-29T16:13:10.937Z
2024-10-29T16:13:10.971Z [DEBUG] No provider meta schema returned
2024-10-29T16:13:10.980Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-29T16:13:10.982Z [INFO] provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-alpha1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-alpha1 id=73905
2024-10-29T16:13:10.982Z [DEBUG] provider: plugin exited
2024-10-29T16:13:10.982Z [DEBUG] ReferenceTransformer: "cloudflare_account.this (expand)" references: [var.cloudflare_account_name var.cloudflare_account_type]
2024-10-29T16:13:10.982Z [DEBUG] ReferenceTransformer: "var.api_token" references: []
2024-10-29T16:13:10.982Z [DEBUG] ReferenceTransformer: "var.cloudflare_account_name" references: []
2024-10-29T16:13:10.982Z [DEBUG] ReferenceTransformer: "var.cloudflare_account_type" references: []
2024-10-29T16:13:10.982Z [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/cloudflare/cloudflare"]" references: [var.api_token]
2024-10-29T16:13:10.982Z [DEBUG] Starting graph walk: walkImport
2024-10-29T16:13:10.982Z [DEBUG] created provider logger: level=debug
2024-10-29T16:13:10.982Z [INFO] provider: configuring client automatic mTLS
2024-10-29T16:13:10.985Z [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-alpha1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-alpha1 args=[".terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-alpha1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-alpha1"]
2024-10-29T16:13:10.989Z [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-alpha1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-alpha1 pid=73906
2024-10-29T16:13:10.989Z [DEBUG] provider: waiting for RPC address: plugin=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-alpha1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-alpha1
2024-10-29T16:13:11.009Z [INFO] provider.terraform-provider-cloudflare_v5.0.0-alpha1: configuring server automatic mTLS: timestamp=2024-10-29T16:13:11.009Z
2024-10-29T16:13:11.015Z [DEBUG] provider: using plugin: version=6
2024-10-29T16:13:11.015Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: plugin address: address=/var/folders/h0/jcw6g9913y57mnyldtnn76n80000gp/T/plugin3499353251 network=unix timestamp=2024-10-29T16:13:11.015Z
2024-10-29T16:13:11.022Z [DEBUG] ReferenceTransformer: "cloudflare_account.this (import id "redacted")" references: []
cloudflare_account.this: Importing from ID "redacted"...
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: panic: runtime error: invalid memory address or nil pointer dereference
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x103270320]
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: goroutine 54 [running]:
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: github.com/cloudflare/terraform-provider-cloudflare/internal/services/account.(*AccountResource).ImportState(0x1400010cac0, {0x105642b38, 0x14000be8570}, {{0x140000763e0?, 0x104697d6f?}, {0x2d?}}, 0x14000b000c0)
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: github.com/cloudflare/terraform-provider-cloudflare/internal/services/account/resource.go:216 +0x190
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ImportResourceState(0x1400016cd20, {0x105642b38, 0x14000be8570}, 0x14000c42070, 0x14000083670)
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_importresourcestate.go:136 +0x678
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ImportResourceState(0x1400016cd20, {0x105642b38?, 0x14000be8480?}, 0x14000be8420)
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/proto6server/server_importresourcestate.go:47 +0x248
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ImportResourceState(0x1400017aa00, {0x105642b38?, 0x14000b83a40?}, 0x14000b9e6e0)
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/tf6server/server.go:896 +0x1e8
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ImportResourceState_Handler({0x10552b120, 0x1400017aa00}, {0x105642b38, 0x14000b83a40}, 0x14000b98900, 0x0)
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:536 +0x1c0
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: google.golang.org/grpc.(*Server).processUnaryRPC(0x1400001d000, {0x105642b38, 0x14000b839b0}, {0x1056a7a20, 0x14000c90000}, 0x14000bdc7e0, 0x14000759bc0, 0x107ac83b0, 0x0)
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: google.golang.org/grpc@v1.63.2/server.go:1369 +0xb58
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: google.golang.org/grpc.(*Server).handleStream(0x1400001d000, {0x1056a7a20, 0x14000c90000}, 0x14000bdc7e0)
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: google.golang.org/grpc@v1.63.2/server.go:1780 +0xb20
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: google.golang.org/grpc.(*Server).serveStreams.func2.1()
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: google.golang.org/grpc@v1.63.2/server.go:1019 +0x8c
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 68
2024-10-29T16:13:11.026Z [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-alpha1: google.golang.org/grpc@v1.63.2/server.go:1030 +0x13c
2024-10-29T16:13:11.027Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-29T16:13:11.027Z [ERROR] plugin6.(*GRPCProvider).ImportResourceState: error="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-29T16:13:11.027Z [ERROR] provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-alpha1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-alpha1 id=73906 error="exit status 2"
2024-10-29T16:13:11.027Z [ERROR] vertex "cloudflare_account.this (import id "redacted")" error: Plugin did not respond
2024-10-29T16:13:11.027Z [ERROR] vertex "cloudflare_account.this (expand)" error: Plugin did not respond

│ Error: Plugin did not respond

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

Stack trace from the terraform-provider-cloudflare_v5.0.0-alpha1 plugin:

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

goroutine 54 [running]:
github.com/cloudflare/terraform-provider-cloudflare/internal/services/account.(*AccountResource).ImportState(0x1400010cac0, {0x105642b38, 0x14000be8570}, {{0x140000763e0?, 0x104697d6f?}, {0x2d?}}, 0x14000b000c0)
github.com/cloudflare/terraform-provider-cloudflare/internal/services/account/resource.go:216 +0x190
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ImportResourceState(0x1400016cd20, {0x105642b38, 0x14000be8570}, 0x14000c42070, 0x14000083670)
github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_importresourcestate.go:136 +0x678
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ImportResourceState(0x1400016cd20, {0x105642b38?, 0x14000be8480?}, 0x14000be8420)
github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/proto6server/server_importresourcestate.go:47 +0x248
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ImportResourceState(0x1400017aa00, {0x105642b38?, 0x14000b83a40?}, 0x14000b9e6e0)
github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/tf6server/server.go:896 +0x1e8
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ImportResourceState_Handler({0x10552b120, 0x1400017aa00}, {0x105642b38, 0x14000b83a40}, 0x14000b98900, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:536 +0x1c0
google.golang.org/grpc.(*Server).processUnaryRPC(0x1400001d000, {0x105642b38, 0x14000b839b0}, {0x1056a7a20, 0x14000c90000}, 0x14000bdc7e0, 0x14000759bc0, 0x107ac83b0, 0x0)
google.golang.org/grpc@v1.63.2/server.go:1369 +0xb58
google.golang.org/grpc.(*Server).handleStream(0x1400001d000, {0x1056a7a20, 0x14000c90000}, 0x14000bdc7e0)
google.golang.org/grpc@v1.63.2/server.go:1780 +0xb20
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/grpc@v1.63.2/server.go:1019 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 68
google.golang.org/grpc@v1.63.2/server.go:1030 +0x13c

Error: The terraform-provider-cloudflare_v5.0.0-alpha1 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

successful import of account

Actual output

crash

Steps to reproduce

use provided tf with 5.0.0-alpha1

Additional factoids

I am just building out our Terraform for Cloudflare - knowing v5 is here even if in alpha - i am not wishing to waste time with v4 only to migrate later (I had that pain from v3 to v4)

References

No response

@warwickbrownteya warwickbrownteya 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 Oct 29, 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.

@github-actions github-actions bot added the triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. label Oct 29, 2024
@jacobbednarz jacobbednarz closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2024
@jacobbednarz
Copy link
Member

we're aware of the issue and it will be fixed in an upcoming release.

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. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Projects
None yet
Development

No branches or pull requests

2 participants