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

dbt_cloud_project_repository ERROR #135

Closed tonytusharjr closed 10 months ago

tonytusharjr commented 1 year ago

I’ve successfully provisioned a dbt Clour project in some TF code I have running in GCP Cloud Build. It’s failing on the step to connect the GitHub repo with the new dbt Cloud project. Here’s the Cloud Build log:

Terraform will perform the following actions:
Step #3 - "terraform apply": 
  # dbt_cloud_project.dbt_cloud_project will be created
  + resource "dbt_cloud_project" "dbt_cloud_project" {
      + dbt_project_subdirectory = "some_sub_directory/"
      + id                       = (known after apply)
      + name                     = "dbt_project_name"
    }
Step #3 - "terraform apply": 
  # dbt_cloud_project_repository.github_repo_assoc_w_dbt_cloud_project will be created
  + resource "dbt_cloud_project_repository" "github_repo_assoc_w_dbt_cloud_project" {
      + id            = (known after apply)
      + project_id    = (known after apply)
      + repository_id = <some-repo-id-#>
    }
Step #3 - "terraform apply": 
Plan: 2 to add, 0 to change, 0 to destroy.
dbt_cloud_project.dbt_cloud_project: Creating...
dbt_cloud_project.dbt_cloud_project: Creation complete after 1s [id=<some_id>]
dbt_cloud_project_repository.github_repo_assoc_w_dbt_cloud_project: Creating...
Error: POST url: https://cloud.getdbt.com/api/v3/accounts/<account-id>/projects/<project-id>/, status: 404, body: {"status":{"code":404,"is_success":false,"user_message":"The requested resource was not found. Please check that you have the proper permissions. If you are seeing this in error, please contact support!","developer_message":""},"data":null}

  with dbt_cloud_project_repository.github_repo_assoc_w_dbt_cloud_project,
  on main.tf line 758, in resource "dbt_cloud_project_repository" "github_repo_assoc_w_dbt_cloud_project":
 758: resource "dbt_cloud_project_repository" "github_repo_assoc_w_dbt_cloud_project" {

And here’s the code block in the main.tf file:

 resource "dbt_cloud_project_repository" "github_repo_assoc_w_dbt_cloud_project" {
  project_id    = dbt_cloud_project.dbt_cloud_project.id
  repository_id = github_repository.github_repo.repo_id
}

Note: this error happens after the TF dbt Cloud project resource successfully runs, so I do not believe I'm missing any auth/config issue.

b-per commented 1 year ago

I can try to reproduce it potentially but could you share the full (anonymised) main.tf config?

Also, could you mention which version of the provider you are using?

tonytusharjr commented 1 year ago

I'm no longer on this project so won't be able to provide further details.

On Tue, May 16, 2023, 4:08 AM Benoit Perigaud @.***> wrote:

I can try to reproduce it potentially but could you share the full (anonymised) main.tf config?

Also, could you mention which version of the provider you are using?

— Reply to this email directly, view it on GitHub https://github.com/GtheSheep/terraform-provider-dbt-cloud/issues/135#issuecomment-1549286874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIHGBNYYWZ4IHLUFZAGC7ZTXGM7ZTANCNFSM6AAAAAAXPN6JYQ . You are receiving this because you authored the thread.Message ID: @.***>

github-actions[bot] commented 11 months ago

This issue has been marked as Stale because it has been open for 90 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.