Skip to content

Plugin not responding to plugin6.(*GRPCProvider).ApplyResourceChange call #524

@ryantimjohn

Description

@ryantimjohn

Describe the bug

Plugin not responding to plugin6.(*GRPCProvider).ApplyResourceChange call.

Error message

 Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more
│ details.
╵
╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more
│ details.
╵
╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more
│ details.
╵
╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more
│ details.
╵

Stack trace from the terraform-provider-dbtcloud_v1.2.1 plugin:

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

goroutine 113 [running]:
github.com/dbt-labs/terraform-provider-dbtcloud/pkg/framework/objects/job.(*jobResource).Create(0x140002a6108, {0x1015795a8, 0x1400037e7e0}, {{{{0x10157f4f8, 0x140004e2ff0}, {0x10144bf40, 0x14000721bf0}}, {0x101584120, 0x140002b84b0}}, {{{0x10157f4f8, ...}, ...}, ...}, ...}, ...)
        github.com/dbt-labs/terraform-provider-dbtcloud/pkg/framework/objects/job/resource.go:244 +0x9ac
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).CreateResource(0x140000d1380, {0x1015795a8, 0x1400037e7e0}, 0x140006255e8, 0x140006255c0)
        github.com/hashicorp/terraform-plugin-framework@v1.8.0/internal/fwserver/server_createresource.go:101 +0x3fc
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ApplyResourceChange(0x140000d1380, {0x1015795a8, 0x1400037e7e0}, 0x14000514960, 0x140006256e0)
        github.com/hashicorp/terraform-plugin-framework@v1.8.0/internal/fwserver/server_applyresourcechange.go:57 +0x380
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ApplyResourceChange(0x140000d1380, {0x1015795a8?, 0x1400037e5a0?}, 0x140005148c0)
        github.com/hashicorp/terraform-plugin-framework@v1.8.0/internal/proto6server/server_applyresourcechange.go:55 +0x2dc
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0x1400020d900, {0x1015795a8?, 0x1400062e7b0?}, 0x140001141c0)
        github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/tf6server/server.go:865 +0x294
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x101531e60, 0x1400020d900}, {0x1015795a8, 0x1400062e7b0}, 0x14000149480, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:518 +0x1c0
google.golang.org/grpc.(*Server).processUnaryRPC(0x14000145000, {0x1015795a8, 0x1400062e720}, {0x101582160, 0x1400025a180}, 0x1400088a000, 0x1400037e780, 0x101c8b918, 0x0)
        google.golang.org/grpc@v1.63.2/server.go:1369 +0xb44
google.golang.org/grpc.(*Server).handleStream(0x14000145000, {0x101582160, 0x1400025a180}, 0x1400088a000)
        google.golang.org/grpc@v1.63.2/server.go:1780 +0xb08
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/grpc@v1.63.2/server.go:1019 +0x84
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 29
        google.golang.org/grpc@v1.63.2/server.go:1030 +0x138

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

Resource configuration

The relevant resource configuration (sanitised so it doesn't contain sensitive data)

provider "dbtcloud" {
  account_id = var.dbt_account_id
  token = var.dbt_token
  host_url = var.dbt_host_url
}
locals {
  dbt_project_name = "ARC ${local.clientname}"
}

resource "google_service_account_key" "dbt" {
  service_account_id = google_service_account.dbt.name
  public_key_type = "TYPE_RAW_PUBLIC_KEY"
}

locals {
  dbt_private_key = jsondecode(base64decode(google_service_account_key.dbt.private_key))
}

resource "dbtcloud_project" "arc_project" {
  name = local.dbt_project_name
}


resource "dbtcloud_global_connection" "arc_bq" {
  name = "BigQuery ${local.clientname}"
  bigquery = {
    auth_provider_x509_cert_url = local.dbt_private_key.auth_provider_x509_cert_url
    auth_uri = local.dbt_private_key.auth_uri
    client_email = local.dbt_private_key.client_email
    client_id =  local.dbt_private_key.client_id
    client_x509_cert_url = local.dbt_private_key.client_x509_cert_url
    gcp_project_id = var.project
    private_key = local.dbt_private_key.private_key
    private_key_id = local.dbt_private_key.private_key_id
    token_uri = local.dbt_private_key.token_uri
  }
}

resource "dbtcloud_repository" "arc_repo" {
  project_id         = dbtcloud_project.arc_project.id
  remote_url         = github_repository.arc_dbt_repo.ssh_clone_url
  github_installation_id = #####
  git_clone_strategy = "github_app"
}

resource "dbtcloud_project_repository" "arc_repo" {
  project_id    = dbtcloud_project.arc_project.id
  repository_id = dbtcloud_repository.arc_repo.repository_id
}

resource "dbtcloud_environment" "dev" {
  project_id = dbtcloud_project.arc_project.id
  name       = "Development"
  type       = "development"
  dbt_version = "latest"
  connection_id = dbtcloud_global_connection.arc_bq.id
}

resource "dbtcloud_environment" "staging" {
  project_id = dbtcloud_project.arc_project.id
  name       = "Staging"
  type       = "deployment"
  deployment_type = "staging"
  dbt_version = "latest"
  connection_id = dbtcloud_global_connection.arc_bq.id
}

resource "dbtcloud_environment" "prod" {
  project_id = dbtcloud_project.arc_project.id
  name       = "Production"
  type       = "deployment"
  deployment_type = "production"
  dbt_version = "latest"
  enable_model_query_history = true
  connection_id = dbtcloud_global_connection.arc_bq.id
}

resource "dbtcloud_environment_variable" "prod_dbt_target_schema" {
  environment_values = {
    "Production" : "prod"
  }
  name       = "DBT_TARGET_SCHEMA"
  project_id = dbtcloud_project.arc_project.id
}

resource "dbtcloud_environment_variable" "dbt_env_secret_ghpat" {
  environment_values = {
    project : var.dbt_env_secret_ghpat
  }
  name       = "DBT_ENV_SECRET_GHPAT"
  project_id = dbtcloud_project.arc_project.id
}

resource "dbtcloud_job" "pr_job" {
  project_id    = dbtcloud_project.arc_project.id
  environment_id = dbtcloud_environment.staging.environment_id
  name          = "Run on PR"
  execute_steps = [
    "dbt build --select +state:modified+"
  ]
  triggers = {
    github_webhook = true
  }
  triggers_on_draft_pr = true
}

resource "dbtcloud_job" "merge_job" {
  project_id    = dbtcloud_project.arc_project.id
  environment_id = dbtcloud_environment.prod.environment_id
  name          = "Run on Merge"
  execute_steps = [
    "dbt build --select state:modified+"
  ]
  triggers = {
    on_merge = true
  }
}

resource "dbtcloud_job" "daily_prod_job" {
  project_id    = dbtcloud_project.arc_project.id
  environment_id = dbtcloud_environment.prod.environment_id
  name          = "Daily Prod Run"
  is_active = false
  execute_steps = [
    "dbt build"
  ]
  triggers = {
    schedule = true
  }
  schedule_days  = [0, 1, 2, 3, 4, 5, 6]
  schedule_type  = "days_of_week"
  schedule_hours = [0]
}

Expected behavior

A clear and concise description of what you expected to happen.

Resources to be created without error

Config (please complete the following information):

( the version can be retrieved running the command terraform providers )

Terraform v1.13.1
on darwin_arm64

  • provider registry.terraform.io/dbt-labs/dbtcloud v1.2.1
  • provider registry.terraform.io/hashicorp/google v7.2.0
  • provider registry.terraform.io/integrations/github v6.6.0

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions