Skip to content

[BUG]: github provider 6.5.0 is failing on updating github_organization_ruleset #2542

Closed

Description

@mkushakov

Expected Behavior

To make changes on resource github_organization_ruleset

Actual Behavior

Terraform crashes when executing apply.

Terraform Version

Terraform v1.7.5
on linux_amd64

  • Installed integrations/github v6.5.0 (signed by a HashiCorp partner, key ID 38027F80D7FD5FB2)

Affected Resource(s)

  • github_organization_ruleset

Terraform Configuration Files

Steps to Reproduce

terraform plan -out=tfplan -detailed-exitcode
terraform apply tfplan

Debug Output

╷
 │ Error: Plugin did not respond
 │ 
 │   with github_organization_ruleset.main_merge_check_sonarqube,
 │   on rulesets.tf line 499, in resource "github_organization_ruleset" "main_merge_check_sonarqube":
 │  499: resource "github_organization_ruleset" "main_merge_check_sonarqube" {
 │ 
 │ The plugin encountered an error, and failed to respond to the
 │ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
 │ contain more details.
 ╵

Panic Output

Stack trace from the terraform-provider-github_v6.5.0 plugin:
 
 panic: interface conversion: interface {} is nil, not bool
 
 goroutine 9621 [running]:
 github.com/integrations/terraform-provider-github/v6/github.expandRules({0xc000d2fac0?, 0xf16546?, 0x0?}, 0x1)
 	github.com/integrations/terraform-provider-github/v6/github/respository_rules_utils.go:327 +0x2694
 github.com/integrations/terraform-provider-github/v6/github.resourceGithubRulesetObject(0xc000912800, {0xc0004e0ad0, 0x8})
 	github.com/integrations/terraform-provider-github/v6/github/respository_rules_utils.go:33 +0x2c5
 github.com/integrations/terraform-provider-github/v6/github.resourceGithubOrganizationRulesetUpdate(0xc000912800, {0xd302c0, 0xc0003a1600})
 	github.com/integrations/terraform-provider-github/v6/github/resource_github_organization_ruleset.go:577 +0x71
 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0x1077bb0?, {0x1077bb0?, 0xc000f46ae0?}, 0xd?, {0xd302c0?, 0xc0003a1600?})
 	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:828 +0x15f
 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0003c8c40, {0x1077bb0, 0xc000f46ae0}, 0xc00089c270, 0xc000996300, {0xd302c0, 0xc0003a1600})
 	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:947 +0x83a
 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000396660, {0x1077bb0?, 0xc000f46a20?}, 0xc000a809b0)
 	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1153 +0xd5c
 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0002597c0, {0x1077bb0?, 0xc000f46210?}, 0xc0004dc000)
 	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:865 +0x3d0
 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xedc6c0, 0xc0002597c0}, {0x1077bb0, 0xc000f46210}, 0xc000912000, 0x0)
 	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x1a6
 google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001ab000, {0x1077bb0, 0xc000f46180}, {0x107c4b0, 0xc0002e4180}, 0xc00030c120, 0xc00050a960, 0x1712558, 0x0)
 	google.golang.org/[email protected]/server.go:1369 +0xdf8
 google.golang.org/grpc.(*Server).handleStream(0xc0001ab000, {0x107c4b0, 0xc0002e4180}, 0xc00030c120)
 	google.golang.org/[email protected]/server.go:1780 +0xe8b
 google.golang.org/grpc.(*Server).serveStreams.func2.1()
 	google.golang.org/[email protected]/server.go:1019 +0x8b
 created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 39
 	google.golang.org/[email protected]/server.go:1030 +0x125
 
 Error: The terraform-provider-github_v6.5.0 plugin crashed!

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    Status: Triage
    Type: Bug
    on Jan 20, 2025
  2. tim-acima commented on Feb 18, 2025

    @tim-acima

    Has anyone found a workaround for this bug?

    I tried to manually create the ruleset via click'ops, and then import it - which worked. But then TF wanted to update the ruleset and it failed. This one is blocking all work on a org-wide ruleset.

  3. mkushakov commented on Feb 26, 2025

    @mkushakov
    Author

    @tim-acima we just rolled back to previous version as workaround :(

  4. moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Activeon Feb 27, 2025
  5. osakiy commented on Mar 7, 2025

    @osakiy

    @tim-acima
    same here.
    It works well like that but it is inconvenient.

    required_providers {
      github = {
        source  = "integrations/github"
    -    version = "= 6.5.0"
    +    version = "= 6.4.0"
      }
    }
  6. ashraidiam commented on Mar 10, 2025

    @ashraidiam

    I just came to report the same issue.

    I have just added this as a temp workout, ensuring the config is correctly set in the UI.

        # intrim fix for the resource modification not executing correctly
        ignore_changes = [rules[0].deletion, rules[0].required_linear_history]
    
  7. tim-acima commented on Mar 12, 2025

    @tim-acima

    Hey @kfcampbell , any chance a bug fix on this could make it into the next release? 🙏

  8. tim-acima commented on Mar 27, 2025

    @tim-acima

    Pinging this issue again, to keep it from going stale. We're still running into this issue.

  9. jtaguinod commented on Apr 11, 2025

    @jtaguinod

    Same issue we are having.

  10. jtaguinod commented on Apr 11, 2025

    @jtaguinod

    conditions { ref_name { include = ["~DEFAULT_BRANCH"] exclude = [] } }

    Make sure include is not empty. It worked for me after that.

  11. grimm26 commented on Apr 11, 2025

    @grimm26
    conditions {                                                                                                                                                                                                                                                                    
        repository_name {                                                                                                                                                                                                                                                             
          include = ["~ALL"]                                                                                                                                                                                                                                                          
          exclude = ["template"]                                                                                                                                                                                                                                                      
        }                                                                                                                                                                                                                                                                             
        ref_name {                                                                                                                                                                                                                                                                    
          include = ["~DEFAULT_BRANCH"]                                                                                                                                                                                                                                               
          exclude = []                                                                                                                                                                                                                                                                
        }                                                                                                                                                                                                                                                                             
      }    
    

    This is exactly what I have and I still get the error.

  12. jtaguinod commented on Apr 11, 2025

    @jtaguinod
    conditions {                                                                                                                                                                                                                                                                    
        repository_name {                                                                                                                                                                                                                                                             
          include = ["~ALL"]                                                                                                                                                                                                                                                          
          exclude = ["template"]                                                                                                                                                                                                                                                      
        }                                                                                                                                                                                                                                                                             
        ref_name {                                                                                                                                                                                                                                                                    
          include = ["~DEFAULT_BRANCH"]                                                                                                                                                                                                                                               
          exclude = []                                                                                                                                                                                                                                                                
        }                                                                                                                                                                                                                                                                             
      }    
    

    This is exactly what I have and I still get the error.

    try this.
    replace
    include = ["~ALL"]
    with
    include = ["*"]

  13. 9 remaining items

  14. tzoratto commented on Jul 8, 2025

    @tzoratto

    @mkushakov Have you seen the current state of this repository? PR fixing blocking issues such as this one are not even reviewed by the GitHub team…

  15. sfuerte commented on Jul 11, 2025

    @sfuerte
  16. mkushakov commented on Sep 11, 2025

    @mkushakov
    Author

    We have forked and fixed this issue on top of other improvements like go-github sdk bump to recent version, added more features support for rulesets and rewrite provider using terraform provider framework instead of old plugin sdk
    https://registry.terraform.io/providers/nexthink-oss/github/latest

  17. tim-acima commented on Sep 15, 2025

    @tim-acima

    Submitted a ticket today asking for GitHub support or attention to this issue. I received this as a response:

    terraform-provider-github is not something GitHub can support at this time. However, this issue has been brought up with GitHub's product leadership team. We are currently focused on API scaling investments and are exploring options to ensure the health of this project.

    If you're paying for GitHub, I'd suggest putting in a ticket as well to increase awareness of support shortcomings.

  18. grimm26 commented on Sep 15, 2025

    @grimm26

    Submitted a ticket today asking for GitHub support or attention to this issue. I received this as a response:

    terraform-provider-github is not something GitHub can support at this time. However, this issue has been brought up with GitHub's product leadership team. We are currently focused on API scaling investments and are exploring options to ensure the health of this project.

    If you're paying for GitHub, I'd suggest putting in a ticket as well to increase awareness of support shortcomings.

    I have and was basically given the same brush-off. I hold little hope in M$ support of an open source project. I see 2 options:

    1. we converge on a fork and that becomes the default github provider going forward
    2. migrate to gitlab
  19. added
    priority
    and removed
    Status: Triage
    on Oct 14, 2025
  20. moved this from Backlog to On Deck in Terraform Provideron Oct 14, 2025
  21. moved this from On Deck to In Review in Terraform Provideron Oct 21, 2025
  22. moved this from 🔥 Backlog to ✅ Done in 🧰 Octokit Activeon Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Bugpriority

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions