Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
siddharthab opened this issue Mar 11, 2024 · 3 comments
Closed
1 task done
Labels
Status: Stale Used by stalebot to clean house Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@siddharthab
Copy link

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/v2@v2.33.0/helper/schema/resource.go:783 +0x130

Code of Conduct

  • I agree to follow this project's Code of Conduct
@siddharthab siddharthab added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Mar 11, 2024
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Mar 12, 2024
@kfcampbell kfcampbell moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Mar 12, 2024
@shmargum
Copy link

shmargum commented Apr 30, 2024

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/v2@v2.33.0/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/v2@v2.33.0/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/v2@v2.33.0/helper/schema/grpc_provider.go:667 +0x4aa
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc000404640, {0x10569d0?, 0xc0004644e0?}, 0xc000092ba0)

@grantcarthew
Copy link

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/v2@v2.33.0/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/v2@v2.33.0/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/v2@v2.33.0/helper/schema/grpc_provider.go:667 +0x4aa
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc000277680, {0x10569d0?, 0xc0004cf230?}, 0xc0009bc7e0)
	github.com/hashicorp/terraform-plugin-go@v0.22.0/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/terraform-plugin-go@v0.22.0/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/grpc@v1.61.1/server.go:1385 +0xdd1
google.golang.org/grpc.(*Server).handleStream(0xc00019b000, {0x105b258, 0xc00039f520}, 0xc000b12a20)
	google.golang.org/grpc@v1.61.1/server.go:1796 +0xfb8
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/grpc@v1.61.1/server.go:1029 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 15
	google.golang.org/grpc@v1.61.1/server.go:1040 +0x125

Error: The terraform-provider-github_v6.2.1 plugin crashed!

@siddharthab siddharthab mentioned this issue Jun 10, 2024
4 tasks
Copy link

👋 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!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Jan 28, 2025
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 4, 2025
@github-project-automation github-project-automation bot moved this from 🔥 Backlog to ✅ Done in 🧰 Octokit Active Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Used by stalebot to clean house Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

4 participants