dbt-labs / terraform-provider-dbtcloud

dbt Cloud Terraform Provider
https://registry.terraform.io/providers/dbt-labs/dbtcloud
MIT License
82 stars 19 forks source link

Resource "dbt_cloud_job" bug #80

Closed hadiel05 closed 1 year ago

hadiel05 commented 1 year ago

Hi looks like there is a bug when I am trying to modify a job. The error I receive is. If I do a destroy and create everything runs as expected is only on update that this is happening

dbt_cloud_job.job_develop: Modifying... [id=30]
╷
│ Error: Plugin did not respond
│ 
│   with dbt_cloud_job.job_develop,
│   on main.tf line 44, in resource "dbt_cloud_job" "job_develop":
│   44: resource "dbt_cloud_job" "job_develop" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-dbt-cloud_v0.1.0 plugin:

panic: interface conversion: interface {} is nil, not bool

goroutine 9 [running]:
github.com/gthesheep/terraform-provider-dbt-cloud/pkg/resources.resourceJobUpdate({0x103314f68, 0x14000414d20}, 0x1400030f600, {0x1032e4240, 0x140002335c0})
        github.com/gthesheep/terraform-provider-dbt-cloud/pkg/resources/job.go:327 +0x12d4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0x140003ae8c0, {0x103314fa0, 0x140000936e0}, 0x1400030f600, {0x1032e4240, 0x140002335c0})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.12.0/helper/schema/resource.go:376 +0x118
GtheSheep commented 1 year ago

Hey, thanks for this, would you mind posting your (redacted) job config plz?

hadiel05 commented 1 year ago

Hey, thanks for this, would you mind posting your (redacted) job config plz?

resource "dbt_cloud_job" "job_develop" {
  environment_id = dbt_cloud_environment.env_develop.environment_id
  execute_steps = [
    "dbt test"
  ]
  generate_docs        = false
  is_active            = true
  name                 = "Develop"
  num_threads          = 4
  project_id           = dbt_cloud_project.dbt_project.id
  run_generate_sources = false
  target_name          = "default"
  triggers = {
    "custom_branch_only" : true,
    "github_webhook" : false,
    "schedule" : false
  }
}
hadiel05 commented 1 year ago

@GtheSheep so it seems like I had to specify git_provider_webhook field in the triggers sections that fixed the issued for that error

  triggers = {
    "custom_branch_only" : true,
    "github_webhook" : false,
    "schedule" : false,
    "git_provider_webhook": false
  }