Skip to content

Instantly share code, notes, and snippets.

@jtitra
Created October 16, 2024 17:02
Show Gist options
  • Save jtitra/32ac3df0968172b51c5b8f1758f8ce0f to your computer and use it in GitHub Desktop.
Save jtitra/32ac3df0968172b51c5b8f1758f8ce0f to your computer and use it in GitHub Desktop.
Harness DBDevOps Instance - TF_LOG=DEBUG tofu import harness_platform_db_instance.pet_clinic_tf sandbox/Titra/QA
######################################################################################################################################################
❯ TF_LOG=DEBUG tofu import harness_platform_db_instance.pet_clinic_tf sandbox/Titra/QA
2024-10-16T12:59:17.944-0400 [INFO] OpenTofu version: 1.8.3
2024-10-16T12:59:17.944-0400 [DEBUG] using github.com/hashicorp/go-tfe v1.36.0
2024-10-16T12:59:17.944-0400 [DEBUG] using github.com/opentofu/hcl/v2 v2.0.0-20240416130056-03228b26f391
2024-10-16T12:59:17.944-0400 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2024-10-16T12:59:17.944-0400 [DEBUG] using github.com/zclconf/go-cty v1.14.4
2024-10-16T12:59:17.944-0400 [INFO] Go runtime version: go1.23.2
2024-10-16T12:59:17.944-0400 [INFO] CLI args: []string{"tofu", "import", "harness_platform_db_instance.pet_clinic_tf", "sandbox/Titra/QA"}
2024-10-16T12:59:17.944-0400 [DEBUG] Attempting to open CLI config file: /Users/jtitra/.terraformrc
2024-10-16T12:59:17.944-0400 [INFO] Loading CLI configuration from /Users/jtitra/.terraformrc
2024-10-16T12:59:17.944-0400 [DEBUG] checking for credentials in "/Users/jtitra/.terraform.d/plugins"
2024-10-16T12:59:17.944-0400 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2024-10-16T12:59:17.944-0400 [DEBUG] will search for provider plugins in /Users/jtitra/.terraform.d/plugins
2024-10-16T12:59:17.944-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/.DS_Store" contains invalid type ".DS_Store"; ignoring
2024-10-16T12:59:17.944-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/harnessregistry.terraform.io" contains invalid type "harnessregistry.terraform.io"; ignoring
2024-10-16T12:59:17.944-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/harnessregistry.terraform.io/.DS_Store" contains invalid type "harnessregistry.terraform.io"; ignoring
2024-10-16T12:59:17.945-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/harnessregistry.terraform.io/harness" contains invalid type "harnessregistry.terraform.io"; ignoring
2024-10-16T12:59:17.945-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/harnessregistry.terraform.io/harness/.DS_Store" contains invalid type "harnessregistry.terraform.io"; ignoring
2024-10-16T12:59:17.945-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/harnessregistry.terraform.io/harness/harness" contains invalid type "harnessregistry.terraform.io"; ignoring
2024-10-16T12:59:17.945-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/harnessregistry.terraform.io/harness/harness/.DS_Store" contains invalid type "harnessregistry.terraform.io"; ignoring
2024-10-16T12:59:17.945-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/harnessregistry.terraform.io/harness/harness/0.40.2" contains invalid type "harnessregistry.terraform.io"; ignoring
2024-10-16T12:59:17.945-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/harnessregistry.terraform.io/harness/harness/0.40.2/.DS_Store" contains invalid type "harnessregistry.terraform.io"; ignoring
2024-10-16T12:59:17.945-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/harnessregistry.terraform.io/harness/harness/0.40.2/darwin_amd64" contains invalid type "harnessregistry.terraform.io"; ignoring
2024-10-16T12:59:17.945-0400 [WARN] local provider path "/Users/jtitra/.terraform.d/plugins/registry.terraform.io/harness/harnessregistry.terraform.io/harness/harness/0.40.2/darwin_amd64/terraform-provider-harness" contains invalid type "harnessregistry.terraform.io"; ignoring
2024-10-16T12:59:17.945-0400 [DEBUG] ignoring non-existing provider search directory /Users/jtitra/Library/Application Support/io.terraform/plugins
2024-10-16T12:59:17.945-0400 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2024-10-16T12:59:17.945-0400 [DEBUG] Found the config directory: /Users/jtitra/.terraform.d
2024-10-16T12:59:17.945-0400 [INFO] CLI command args: []string{"import", "harness_platform_db_instance.pet_clinic_tf", "sandbox/Titra/QA"}
2024-10-16T12:59:17.966-0400 [DEBUG] checking for provisioner in "."
2024-10-16T12:59:17.967-0400 [DEBUG] checking for provisioner in "/opt/homebrew/bin"
2024-10-16T12:59:17.967-0400 [DEBUG] checking for provisioner in "/Users/jtitra/.terraform.d/plugins"
2024-10-16T12:59:17.969-0400 [DEBUG] POST https://app.harness.io/gateway/iacm/api/orgs/sandbox/projects/Titra/workspaces/POP_Testing/terraform-backend/lock?accountIdentifier=EeRjnXTnS4GrLG5VNNJZUw
2024-10-16T12:59:18.321-0400 [DEBUG] GET https://app.harness.io/gateway/iacm/api/orgs/sandbox/projects/Titra/workspaces/POP_Testing/terraform-backend?accountIdentifier=EeRjnXTnS4GrLG5VNNJZUw
2024-10-16T12:59:18.868-0400 [DEBUG] Building and walking import graph
2024-10-16T12:59:18.869-0400 [DEBUG] ProviderTransformer: "harness_platform_db_instance.pet_clinic_tf (expand)" (*tofu.nodeExpandPlannableResource) needs provider["registry.opentofu.org/harness/harness"]
2024-10-16T12:59:18.869-0400 [DEBUG] created provider logger: level=debug
2024-10-16T12:59:18.869-0400 [INFO] provider: configuring client automatic mTLS
2024-10-16T12:59:18.893-0400 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.opentofu.org/harness/harness/0.34.1/darwin_arm64/terraform-provider-harness_v0.34.1 args=[".terraform/providers/registry.opentofu.org/harness/harness/0.34.1/darwin_arm64/terraform-provider-harness_v0.34.1"]
2024-10-16T12:59:18.897-0400 [DEBUG] provider: plugin started: path=.terraform/providers/registry.opentofu.org/harness/harness/0.34.1/darwin_arm64/terraform-provider-harness_v0.34.1 pid=62253
2024-10-16T12:59:18.897-0400 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.opentofu.org/harness/harness/0.34.1/darwin_arm64/terraform-provider-harness_v0.34.1
2024-10-16T12:59:18.911-0400 [INFO] provider.terraform-provider-harness_v0.34.1: configuring server automatic mTLS: timestamp=2024-10-16T12:59:18.911-0400
2024-10-16T12:59:18.923-0400 [DEBUG] provider: using plugin: version=5
2024-10-16T12:59:18.923-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: plugin address: address=/var/folders/8m/7y53zm851k3560p6_hwd4w8m0000gp/T/plugin3819001453 network=unix timestamp=2024-10-16T12:59:18.923-0400
2024-10-16T12:59:18.941-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-16T12:59:18.941-0400 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.opentofu.org/harness/harness/0.34.1/darwin_arm64/terraform-provider-harness_v0.34.1 pid=62253
2024-10-16T12:59:18.941-0400 [DEBUG] provider: plugin exited
2024-10-16T12:59:18.941-0400 [DEBUG] ReferenceTransformer: "var.account_id" references: []
2024-10-16T12:59:18.941-0400 [DEBUG] ReferenceTransformer: "var.api_key" references: []
2024-10-16T12:59:18.941-0400 [DEBUG] ReferenceTransformer: "provider[\"registry.opentofu.org/harness/harness\"]" references: [var.account_id var.api_key]
2024-10-16T12:59:18.941-0400 [DEBUG] ReferenceTransformer: "harness_platform_db_instance.pet_clinic_tf (expand)" references: []
2024-10-16T12:59:18.941-0400 [DEBUG] Starting graph walk: walkImport
2024-10-16T12:59:18.942-0400 [DEBUG] created provider logger: level=debug
2024-10-16T12:59:18.942-0400 [INFO] provider: configuring client automatic mTLS
2024-10-16T12:59:18.944-0400 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.opentofu.org/harness/harness/0.34.1/darwin_arm64/terraform-provider-harness_v0.34.1 args=[".terraform/providers/registry.opentofu.org/harness/harness/0.34.1/darwin_arm64/terraform-provider-harness_v0.34.1"]
2024-10-16T12:59:18.945-0400 [DEBUG] provider: plugin started: path=.terraform/providers/registry.opentofu.org/harness/harness/0.34.1/darwin_arm64/terraform-provider-harness_v0.34.1 pid=62256
2024-10-16T12:59:18.945-0400 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.opentofu.org/harness/harness/0.34.1/darwin_arm64/terraform-provider-harness_v0.34.1
2024-10-16T12:59:18.953-0400 [INFO] provider.terraform-provider-harness_v0.34.1: configuring server automatic mTLS: timestamp=2024-10-16T12:59:18.953-0400
2024-10-16T12:59:18.961-0400 [DEBUG] provider: using plugin: version=5
2024-10-16T12:59:18.961-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: plugin address: address=/var/folders/8m/7y53zm851k3560p6_hwd4w8m0000gp/T/plugin2424476893 network=unix timestamp=2024-10-16T12:59:18.961-0400
2024-10-16T12:59:18.979-0400 [INFO] provider.terraform-provider-harness_v0.34.1: 2024/10/16 12:59:18 [WARN] error creating CD client: invalid config: ApiKey must be set: timestamp=2024-10-16T12:59:18.979-0400
2024-10-16T12:59:18.979-0400 [DEBUG] ReferenceTransformer: "harness_platform_db_instance.pet_clinic_tf (import id \"sandbox/Titra/QA\")" references: []
harness_platform_db_instance.pet_clinic_tf: Importing from ID "sandbox/Titra/QA"...
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: panic: runtime error: index out of range [3] with length 3
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: goroutine 46 [running]:
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: github.com/harness/terraform-provider-harness/helpers.glob..func2(0x1400047a480, {0x140004a2ea0?, 0x103794fc8?})
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: github.com/harness/terraform-provider-harness/helpers/schema.go:239 +0x224
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).ImportState(0x140000a60c0, {0x103f193c0, 0x140004a2ea0}, 0x140007a5510, {0x14000034e70, 0x10})
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/provider.go:390 +0x14c
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ImportResourceState(0x140004a8d98, {0x103f193c0?, 0x140004a2d80?}, 0x1400053ac40)
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/grpc_provider.go:1091 +0xa4
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ImportResourceState(0x140004801e0, {0x103f193c0?, 0x140004a2480?}, 0x14000558eb0)
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/tf5server/server.go:851 +0x19c
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ImportResourceState_Handler({0x103eb7140?, 0x140004801e0}, {0x103f193c0, 0x140004a2480}, 0x1400047a100, 0x0)
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:440 +0x170
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: google.golang.org/grpc.(*Server).processUnaryRPC(0x140001a2e00, {0x103f193c0, 0x140004a23f0}, {0x103f1d4e0, 0x140004db040}, 0x140004a0d80, 0x140001979e0, 0x104722278, 0x0)
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: google.golang.org/grpc@v1.61.0/server.go:1385 +0xc40
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: google.golang.org/grpc.(*Server).handleStream(0x140001a2e00, {0x103f1d4e0, 0x140004db040}, 0x140004a0d80)
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: google.golang.org/grpc@v1.61.0/server.go:1796 +0xa7c
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: google.golang.org/grpc.(*Server).serveStreams.func2.1()
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: google.golang.org/grpc@v1.61.0/server.go:1029 +0x8c
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: created by google.golang.org/grpc.(*Server).serveStreams.func2
2024-10-16T12:59:18.982-0400 [DEBUG] provider.terraform-provider-harness_v0.34.1: google.golang.org/grpc@v1.61.0/server.go:1040 +0x160
2024-10-16T12:59:18.983-0400 [ERROR] plugin.(*GRPCProvider).ImportResourceState: error="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-16T12:59:18.983-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-16T12:59:18.983-0400 [ERROR] vertex "harness_platform_db_instance.pet_clinic_tf (import id \"sandbox/Titra/QA\")" error: Plugin did not respond
2024-10-16T12:59:18.983-0400 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.opentofu.org/harness/harness/0.34.1/darwin_arm64/terraform-provider-harness_v0.34.1 pid=62256 error="exit status 2"
2024-10-16T12:59:18.983-0400 [ERROR] vertex "harness_platform_db_instance.pet_clinic_tf (expand)" error: Plugin did not respond
│ Error: Plugin did not respond
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ImportResourceState call. The plugin logs may contain more details.
2024-10-16T12:59:18.983-0400 [DEBUG] DELETE https://app.harness.io/gateway/iacm/api/orgs/sandbox/projects/Titra/workspaces/POP_Testing/terraform-backend/lock?accountIdentifier=EeRjnXTnS4GrLG5VNNJZUw
Stack trace from the terraform-provider-harness_v0.34.1 plugin:
panic: runtime error: index out of range [3] with length 3
goroutine 46 [running]:
github.com/harness/terraform-provider-harness/helpers.glob..func2(0x1400047a480, {0x140004a2ea0?, 0x103794fc8?})
github.com/harness/terraform-provider-harness/helpers/schema.go:239 +0x224
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).ImportState(0x140000a60c0, {0x103f193c0, 0x140004a2ea0}, 0x140007a5510, {0x14000034e70, 0x10})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/provider.go:390 +0x14c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ImportResourceState(0x140004a8d98, {0x103f193c0?, 0x140004a2d80?}, 0x1400053ac40)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/grpc_provider.go:1091 +0xa4
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ImportResourceState(0x140004801e0, {0x103f193c0?, 0x140004a2480?}, 0x14000558eb0)
github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/tf5server/server.go:851 +0x19c
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ImportResourceState_Handler({0x103eb7140?, 0x140004801e0}, {0x103f193c0, 0x140004a2480}, 0x1400047a100, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:440 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0x140001a2e00, {0x103f193c0, 0x140004a23f0}, {0x103f1d4e0, 0x140004db040}, 0x140004a0d80, 0x140001979e0, 0x104722278, 0x0)
google.golang.org/grpc@v1.61.0/server.go:1385 +0xc40
google.golang.org/grpc.(*Server).handleStream(0x140001a2e00, {0x103f1d4e0, 0x140004db040}, 0x140004a0d80)
google.golang.org/grpc@v1.61.0/server.go:1796 +0xa7c
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/grpc@v1.61.0/server.go:1029 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2
google.golang.org/grpc@v1.61.0/server.go:1040 +0x160
Error: The terraform-provider-harness_v0.34.1 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.
2024-10-16T12:59:19.121-0400 [DEBUG] provider: plugin exited
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment