Open gilacost opened 8 months ago
@gilacost you can follow our instructions here in the CONTRIBUTING.md file to debug the provider using VS Code, which will let you inspect and step through the requests.
It may be easier, however, to set the TF_LOG
environment variable to DEBUG
, which will print out each request and response made in the course of invoking the provider.
Hey i am having the same issue:
# Create a custom action repository
resource "github_repository" "action_build_repo" {
name = "test-action-build"
description = "Custom action repository"
auto_init = true
visibility = "internal"
}
github_repository_project.project: Creating... 2024-02-17T17:11:39.084-0300 [INFO] Starting apply for github_repository_project.project 2024-02-17T17:11:39.085-0300 [DEBUG] github_repository_project.project: applying the planned Create change 2024-02-17T17:11:39.325-0300 [ERROR] provider.terraform-provider-github_v6.0.0: Response contains error diagnostic: @module=sdk.proto tf_req_id=1f84db87-4b84-4e98-2e58-2983d12aa923 @caller=github.com/hashicorp/terraform-plugin-go@v0.20.0/tfprotov5/internal/diag/diagnostics.go:62 diagnostic_summary="POST https://api.github.com/repos/xxxx-org/test-action-build/projects: 410 Projects are disabled for this repository []" tf_proto_version=5.4 tf_resource_type=github_repository_project tf_rpc=ApplyResourceChange diagnostic_detail="" diagnostic_severity=ERROR tf_provider_addr=provider timestamp=2024-02-17T17:11:39.325-0300 2024-02-17T17:11:39.354-0300 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot 2024-02-17T17:11:39.355-0300 [ERROR] vertex "github_repository_project.project" error: POST https://api.github.com/repos/Xxxxxxx/test-action-build/projects: 410 Projects are disabled for this repository [] ╷ │ Error: POST https://api.github.com/repos/xxxxx/test-action-build/projects: 410 Projects are disabled for this repository [] │ │ with github_repository_project.project, │ on main.tf line 35, in resource "github_repository_project" "project": │ 35: resource "github_repository_project" "project" { │ ╵ 2024-02-17T17:11:39.363-0300 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF" 2024-02-17T17:11:39.365-0300 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/github/6.0.0/linux_amd64/terraform-provider-github_v6.0.0 pid=2541 2024-02-17T17:11:39.365-0300 [DEBUG] provider: plugin exited
I stumbled upon this issue while searching for https://github.com/integrations/terraform-provider-github/issues/1910 .
I speculate that the errors seen above might be related to https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository#has_projects :
Per the GitHub documentation when in an organization that has disabled repository projects it will default to false and will otherwise default to true. If you specify true when it has been disabled it will return an error.
Expected Behavior
A GitHub repository is created with a project according to the following Terraform configuration:
I expect the project to be created because the repository resource has the
has_projects=true
attribute.Actual Behavior
The project is not created. The project resource that I am using has the
depends_on
attribute so that it is only created after the repo resource. However, I received an error that said that the project could not be created because projects have not been enabled for the repository.I'm not sure if this is a Terraform provider issue or an issue with the GitHub API itself. I wonder how I can see the request that the provider makes to the API?
Terraform Version
Terraform v1.4.6 on darwin_arm64
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
$ terraform apply
Debug Output
Panic Output
No response
Code of Conduct