Skip to content

[BUG]: github_repository_ruleset resource crashes when merge queues are enabled #2192

Closed as not planned

Description

@siddharthab

Expected Behavior

  1. Create and deploy a github_repository_ruleset resource with Terraform.
  2. Through some other API or web console, enable merge queues in the ruleset.
  3. Run terraform plan. This step should succeed and show no changes (until merge queues are supported in Terraform).

Actual Behavior

On running terraform plan, the plugin crashes.

Terraform Version

Terraform v1.7.4 on darwin_arm64 + provider registry.terraform.io/integrations/github v6.0.1

Affected Resource(s)

  • github_repository_ruleset
  • github_organization_ruleset

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

No response

Panic Output

Stack trace from the terraform-provider-github_v6.0.1 plugin:

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

goroutine 162 [running]:
github.com/integrations/terraform-provider-github/v6/github.resourceGithubRepositoryRulesetRead(0x14000608300, {0x105870f60?, 0x14000258b40?})
	github.com/integrations/terraform-provider-github/v6/github/resource_github_repository_ruleset.go:480 +0x494
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x105a59be0?, {0x105a59be0?, 0x1400042ba70?}, 0xd?, {0x105870f60?, 0x14000258b40?})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:783 +0x130

Code of Conduct

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

Activity

  1. added
    Status: Triage
    Type: Bug
    on Mar 11, 2024
  2. added
    Status: Up for grabs
    and removed
    Status: Triage
    on Mar 12, 2024
  3. moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Activeon Mar 12, 2024
  4. shmargum commented on Apr 30, 2024

    @shmargum

    this also appears to be the case for
    required_workflows
    on linux_amd64 (github hosted runners)
    i could not reproduce the issue on mac
    both on terraform 1.8.2 and github provider 6.2.1
    this seems related to #2113

    Stack trace from the terraform-provider-github_v6.2.1 plugin:
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xc607ad]
    goroutine 51 [running]:
    github.com/integrations/terraform-provider-github/v6/github.resourceGithubOrganizationRulesetRead(0xc00045a700, {0xd1eb40?, 0xc0000a8a80?})
    	github.com/integrations/terraform-provider-github/v6/github/resource_github_organization_ruleset.go:525 +0x56d
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x10569d0?, {0x10569d0?, 0xc000464f30?}, 0xd?, {0xd1eb40?, 0xc0000a8a80?})
    	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:783 +0x15f
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0000e5c00, {0x10569d0, 0xc000464f30}, 0xc000297ba0, {0xd1eb40, 0xc0000a8a80})
    	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1089 +0x529
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc000010270, {0x10569d0?, 0xc000464e70?}, 0xc0000a9cc0)
    	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:667 +0x4aa
    github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc000404640, {0x10569d0?, 0xc0004644e0?}, 0xc000092ba0)
    
  5. grantcarthew commented on May 2, 2024

    @grantcarthew

    Same here for "Require code scanning results".

    Deploy ruleset, change in the browser, and terraform plan. I don't think the code scanning is supported yet, but either way:

    Stack trace from the terraform-provider-github_v6.2.1 plugin:
    
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xc9a387]
    
    goroutine 193 [running]:
    github.com/integrations/terraform-provider-github/v6/github.resourceGithubRepositoryRulesetRead(0xc00058cf80, {0xd1eb40?, 0xc000532800?})
    	github.com/integrations/terraform-provider-github/v6/github/resource_github_repository_ruleset.go:480 +0x567
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x10569d0?, {0x10569d0?, 0xc0004cfa70?}, 0xd?, {0xd1eb40?, 0xc000532800?})
    	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:783 +0x15f
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0003f9260, {0x10569d0, 0xc0004cfa70}, 0xc0005275f0, {0xd1eb40, 0xc000532800})
    	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1089 +0x529
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc000376540, {0x10569d0?, 0xc0004cf9b0?}, 0xc00071c580)
    	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:667 +0x4aa
    github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc000277680, {0x10569d0?, 0xc0004cf230?}, 0xc0009bc7e0)
    	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:775 +0x4c3
    github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xebdec0, 0xc000277680}, {0x10569d0, 0xc0004cf230}, 0xc00058cc00, 0x0)
    	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:482 +0x1a6
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc00019b000, {0x10569d0, 0xc0004cf1a0}, {0x105b258, 0xc00039f520}, 0xc000b12a20, 0xc000480150, 0x16d9a08, 0x0)
    	google.golang.org/[email protected]/server.go:1385 +0xdd1
    google.golang.org/grpc.(*Server).handleStream(0xc00019b000, {0x105b258, 0xc00039f520}, 0xc000b12a20)
    	google.golang.org/[email protected]/server.go:1796 +0xfb8
    google.golang.org/grpc.(*Server).serveStreams.func2.1()
    	google.golang.org/[email protected]/server.go:1029 +0x8b
    created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 15
    	google.golang.org/[email protected]/server.go:1040 +0x125
    
    Error: The terraform-provider-github_v6.2.1 plugin crashed!
    
  6. github-actions commented on Jan 28, 2025

    @github-actions

    👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

  7. added
    Status: Stale
    on Jan 28, 2025
  8. moved this from 🔥 Backlog to ✅ Done in 🧰 Octokit Activeon Feb 4, 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

    Status: StaleStatus: Up for grabsType: Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions