Error: Plugin did not respond
Describe the need
resource "github_branch_protection" "github_branch_protection" {
for_each = toset(var.is_service_repo ? var.github_branch_protection_name : ["main"])
repository_id = github_repository.github_repository.name
pattern = each.value
enforce_admins = false
require_conversation_resolution = true
required_status_checks {
strict = true
}
}
resource "github_repository_environment" "github_repository_environment" {
for_each = toset(var.is_service_repo ? var.github_repository_environments : [])
repository = github_repository.github_repository.name
environment = each.value
deployment_branch_policy {
protected_branches = false
custom_branch_policies = true
}
}
when we are trying to execute it , by using terraform apply terraform apply -auto-approve -input=false
the source and version used is below
github = {
source = "integrations/github"
version = "~> 5.0"
}
the above is the terraform code for github_repository_environment and github_branch_protection
we are receiving the error as plugin did not respond , i have attached the logs below , kindly help on this as soon as possible .
SDK Version
No response
API Version
No response
Relevant log output
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.cb_repository.github_branch_protection.github_branch_protection["develop"] will be created
+ resource "github_branch_protection" "github_branch_protection" {
+ allows_deletions = false
+ allows_force_pushes = false
+ blocks_creations = false
+ enforce_admins = false
+ id = (known after apply)
+ lock_branch = false
+ pattern = "develop"
+ repository_id = "cb-test-t"
+ require_conversation_resolution = true
+ require_signed_commits = false
+ required_linear_history = false
+ required_status_checks {
+ strict = true
}
}
# module.cb_repository.github_branch_protection.github_branch_protection["main"] will be created
+ resource "github_branch_protection" "github_branch_protection" {
+ allows_deletions = false
+ allows_force_pushes = false
+ blocks_creations = false
+ enforce_admins = false
+ id = (known after apply)
+ lock_branch = false
+ pattern = "main"
+ repository_id = "cb-test-t"
+ require_conversation_resolution = true
+ require_signed_commits = false
+ required_linear_history = false
+ required_status_checks {
+ strict = true
}
}
# module.cb_repository.github_branch_protection.github_branch_protection["staging"] will be created
+ resource "github_branch_protection" "github_branch_protection" {
+ allows_deletions = false
+ allows_force_pushes = false
+ blocks_creations = false
+ enforce_admins = false
+ id = (known after apply)
+ lock_branch = false
+ pattern = "staging"
+ repository_id = "cb-test-t"
+ require_conversation_resolution = true
+ require_signed_commits = false
+ required_linear_history = false
+ required_status_checks {
+ strict = true
}
}
# module.cb_repository.github_repository.github_repository will be created
+ resource "github_repository" "github_repository" {
+ allow_auto_merge = false
+ allow_merge_commit = true
+ allow_rebase_merge = true
+ allow_squash_merge = true
+ archived = false
+ default_branch = (known after apply)
+ delete_branch_on_merge = false
+ description = "testing"
+ etag = (known after apply)
+ full_name = (known after apply)
+ git_clone_url = (known after apply)
+ html_url = (known after apply)
+ http_clone_url = (known after apply)
+ id = (known after apply)
+ merge_commit_message = "PR_TITLE"
+ merge_commit_title = "MERGE_MESSAGE"
+ name = "cb-test-t"
+ node_id = (known after apply)
+ private = (known after apply)
+ repo_id = (known after apply)
+ squash_merge_commit_message = "COMMIT_MESSAGES"
+ squash_merge_commit_title = "COMMIT_OR_PR_TITLE"
+ ssh_clone_url = (known after apply)
+ svn_url = (known after apply)
+ visibility = "private"
}
# module.cb_repository.github_repository_environment.github_repository_environment["dev-apse2"] will be created
+ resource "github_repository_environment" "github_repository_environment" {
+ environment = "dev-apse2"
+ id = (known after apply)
+ repository = "cb-test-t"
+ deployment_branch_policy {
+ custom_branch_policies = true
+ protected_branches = false
}
}
# module.cb_repository.github_repository_environment.github_repository_environment["dev-euc1"] will be created
+ resource "github_repository_environment" "github_repository_environment" {
+ environment = "dev-euc1"
+ id = (known after apply)
+ repository = "cb-test-t"
+ deployment_branch_policy {
+ custom_branch_policies = true
+ protected_branches = false
}
}
# module.cb_repository.github_repository_environment.github_repository_environment["dev-use1"] will be created
+ resource "github_repository_environment" "github_repository_environment" {
+ environment = "dev-use1"
+ id = (known after apply)
+ repository = "cb-test-t"
+ deployment_branch_policy {
+ custom_branch_policies = true
+ protected_branches = false
}
}
# module.cb_repository.github_repository_environment.github_repository_environment["prod-apse2"] will be created
+ resource "github_repository_environment" "github_repository_environment" {
+ environment = "prod-apse2"
+ id = (known after apply)
+ repository = "cb-test-t"
+ deployment_branch_policy {
+ custom_branch_policies = true
+ protected_branches = false
}
}
# module.cb_repository.github_repository_environment.github_repository_environment["prod-euc1"] will be created
+ resource "github_repository_environment" "github_repository_environment" {
+ environment = "prod-euc1"
+ id = (known after apply)
+ repository = "cb-test-t"
+ deployment_branch_policy {
+ custom_branch_policies = true
+ protected_branches = false
}
}
# module.cb_repository.github_repository_environment.github_repository_environment["prod-use1"] will be created
+ resource "github_repository_environment" "github_repository_environment" {
+ environment = "prod-use1"
+ id = (known after apply)
+ repository = "cb-test-t"
+ deployment_branch_policy {
+ custom_branch_policies = true
+ protected_branches = false
}
}
# module.cb_repository.github_repository_environment.github_repository_environment["staging-use1"] will be created
+ resource "github_repository_environment" "github_repository_environment" {
+ environment = "staging-use1"
+ id = (known after apply)
+ repository = "cb-test-t"
+ deployment_branch_policy {
+ custom_branch_policies = true
+ protected_branches = false
}
}
Plan: 11 to add, 0 to change, 0 to destroy.
module.cb_repository.github_repository.github_repository: Creating...
module.cb_repository.github_repository.github_repository: Creation complete after 6s [id=cb-test-t]
module.cb_repository.github_repository_environment.github_repository_environment["dev-euc1"]: Creating...
module.cb_repository.github_repository_environment.github_repository_environment["prod-apse2"]: Creating...
module.cb_repository.github_branch_protection.github_branch_protection["staging"]: Creating...
module.cb_repository.github_repository_environment.github_repository_environment["staging-use1"]: Creating...
module.cb_repository.github_repository_environment.github_repository_environment["prod-euc1"]: Creating...
module.cb_repository.github_branch_protection.github_branch_protection["develop"]: Creating...
module.cb_repository.github_repository_environment.github_repository_environment["prod-use1"]: Creating...
module.cb_repository.github_repository_environment.github_repository_environment["dev-use1"]: Creating...
module.cb_repository.github_branch_protection.github_branch_protection["main"]: Creating...
module.cb_repository.github_repository_environment.github_repository_environment["dev-apse2"]: Creating...
╷
│ Error: Plugin did not respond
│
│ with module.cb_repository.github_branch_protection.github_branch_protection["develop"],
│ on .terraform/modules/cb_repository/modules/github/cb_repository/main.tf line 8, in resource "github_branch_protection" "github_branch_protection":
│ 8: resource "github_branch_protection" "github_branch_protection" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ with module.cb_repository.github_branch_protection.github_branch_protection["staging"],
│ on .terraform/modules/cb_repository/modules/github/cb_repository/main.tf line 8, in resource "github_branch_protection" "github_branch_protection":
│ 8: resource "github_branch_protection" "github_branch_protection" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ with module.cb_repository.github_branch_protection.github_branch_protection["main"],
│ on .terraform/modules/cb_repository/modules/github/cb_repository/main.tf line 8, in resource "github_branch_protection" "github_branch_protection":
│ 8: resource "github_branch_protection" "github_branch_protection" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ with module.cb_repository.github_repository_environment.github_repository_environment["dev-use1"],
│ on .terraform/modules/cb_repository/modules/github/cb_repository/main.tf line 21, in resource "github_repository_environment" "github_repository_environment":
│ 21: resource "github_repository_environment" "github_repository_environment" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ with module.cb_repository.github_repository_environment.github_repository_environment["prod-euc1"],
│ on .terraform/modules/cb_repository/modules/github/cb_repository/main.tf line 21, in resource "github_repository_environment" "github_repository_environment":
│ 21: resource "github_repository_environment" "github_repository_environment" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ with module.cb_repository.github_repository_environment.github_repository_environment["prod-use1"],
│ on .terraform/modules/cb_repository/modules/github/cb_repository/main.tf line 21, in resource "github_repository_environment" "github_repository_environment":
│ 21: resource "github_repository_environment" "github_repository_environment" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ with module.cb_repository.github_repository_environment.github_repository_environment["dev-euc1"],
│ on .terraform/modules/cb_repository/modules/github/cb_repository/main.tf line 21, in resource "github_repository_environment" "github_repository_environment":
│ 21: resource "github_repository_environment" "github_repository_environment" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ with module.cb_repository.github_repository_environment.github_repository_environment["prod-apse2"],
│ on .terraform/modules/cb_repository/modules/github/cb_repository/main.tf line 21, in resource "github_repository_environment" "github_repository_environment":
│ 21: resource "github_repository_environment" "github_repository_environment" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ with module.cb_repository.github_repository_environment.github_repository_environment["staging-use1"],
│ on .terraform/modules/cb_repository/modules/github/cb_repository/main.tf line 21, in resource "github_repository_environment" "github_repository_environment":
│ 21: resource "github_repository_environment" "github_repository_environment" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ with module.cb_repository.github_repository_environment.github_repository_environment["dev-apse2"],
│ on .terraform/modules/cb_repository/modules/github/cb_repository/main.tf line 21, in resource "github_repository_environment" "github_repository_environment":
│ 21: resource "github_repository_environment" "github_repository_environment" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
Stack trace from the terraform-provider-github_v5.14.0 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0xe1d030]
goroutine 73 [running]:
github.com/integrations/terraform-provider-github/v5/github.resourceGithubRepositoryEnvironmentRead(0xc0003d18f0, {0xeb2f80?, 0xc000762000?})
github.com/integrations/terraform-provider-github/v5/github/resource_github_repository_environment.go:128 +0x4b0
github.com/integrations/terraform-provider-github/v5/github.resourceGithubRepositoryEnvironmentCreate(0xf30620?, {0xeb2f80?, 0xc000762000})
github.com/integrations/terraform-provider-github/v5/github/resource_github_repository_environment.go:98 +0x2e5
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc0001ed180, 0xc000357860, 0xc000378d60, {0xeb2f80, 0xc000762000})
github.com/hashicorp/[email protected]/helper/schema/resource.go:320 +0x438
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc00013af00, 0xc0006179a0, 0x10aabd2?, 0xf?)
github.com/hashicorp/[email protected]/helper/schema/provider.go:294 +0x70
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc000116f10, {0xc0003d13b0?, 0x4b86c6?}, 0xc0003d13b0)
github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:895 +0x7c5
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x105cba0?, 0xc000116f10}, {0x12c5550, 0xc0005de5a0}, 0xc0006f3f20, 0x0)
github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3305 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000232a80, {0x12c8ca0, 0xc00011b1e0}, 0xc000534fc0, 0xc0002b0fc0, 0x19835e0, 0x0)
google.golang.org/[email protected]/server.go:1283 +0xcfd
google.golang.org/grpc.(*Server).handleStream(0xc000232a80, {0x12c8ca0, 0xc00011b1e0}, 0xc000534fc0, 0x0)
google.golang.org/[email protected]/server.go:1620 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:920 +0x28a
Error: The terraform-provider-github_v5.14.0 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.
Error: Terraform exited with code 1.
Error: Process completed with exit code 1.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
I recently started seeing an issue very similar to this as well. I had a pre-existing GitHub resource managed by Terraform that was working fine last time I planned/applied the workspace (10 days ago), but now it has started failing.
One of the resources failing with this error (note: this error is also happening on data.github_repository entities, which cite (*GRPCProvider).ReadDataSource in the error message):
resource "github_actions_runner_group" "beta_linux_runners" {
name = "beta-linux-runners"
visibility = "all"
}
Error message (Terraform v1.3.0, provider v5.16.0)
Terraform v1.3.0
on linux_amd64
Initializing plugins and modules...
...
│ Error: Plugin did not respond
│
│ with github_actions_runner_group.beta_linux_runners,
│ on github-thrivent.tf line 19, in resource "github_actions_runner_group" "beta_linux_runners":
│ 19: resource "github_actions_runner_group" "beta_linux_runners" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more
│ details.
...
Stack trace
Stack trace from the terraform-provider-github_v5.16.0 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0xde71cd]
goroutine 65 [running]:
github.com/integrations/terraform-provider-github/v5/github.resourceGithubActionsRunnerGroupRead(0xc000518540, {0xeb2f80?, 0xc0005c6400?})
github.com/integrations/terraform-provider-github/v5/github/resource_github_actions_runner_group.go:188 +0x82d
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000149400, 0xc000590370, {0xeb2f80, 0xc0005c6400})
github.com/hashicorp/[email protected]/helper/schema/resource.go:470 +0x1aa
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadResource(0xc00011e8a8, {0xc000114600?, 0x4b86c6?}, 0xc000114600)
github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:535 +0x34b
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadResource_Handler({0x105cba0?, 0xc00011e8a8}, {0x12c5730, 0xc000536270}, 0xc0001145a0, 0x0)
github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3269 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002ac380, {0x12c8e80, 0xc00048e1a0}, 0xc0005f0000, 0xc0002aeea0, 0x19845b0, 0x0)
google.golang.org/[email protected]/server.go:1283 +0xcfd
google.golang.org/grpc.(*Server).handleStream(0xc0002ac380, {0x12c8e80, 0xc00048e1a0}, 0xc0005f0000, 0x0)
google.golang.org/[email protected]/server.go:1620 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:920 +0x28a
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0xde71cd]
goroutine 41 [running]:
github.com/integrations/terraform-provider-github/v5/github.resourceGithubActionsRunnerGroupRead(0xc0000c9570, {0xeb2f80?, 0xc0001bcc40?})
github.com/integrations/terraform-provider-github/v5/github/resource_github_actions_runner_group.go:188 +0x82d
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000536e60, 0xc00086a2d0, {0xeb2f80, 0xc0001bcc40})
github.com/hashicorp/[email protected]/helper/schema/resource.go:470 +0x1aa
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadResource(0xc0001150b8, {0xc00084c120?, 0x4b8746?}, 0xc00084c120)
github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:535 +0x34b
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadResource_Handler({0x105cba0?, 0xc0001150b8}, {0x12c5730, 0xc00084ec60}, 0xc00084c0c0, 0x0)
github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3269 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000230a80, {0x12c8e80, 0xc000118820}, 0xc00015c480, 0xc000371350, 0x19845b0, 0x0)
google.golang.org/[email protected]/server.go:1283 +0xcfd
google.golang.org/grpc.(*Server).handleStream(0xc000230a80, {0x12c8e80, 0xc000118820}, 0xc00015c480, 0x0)
google.golang.org/[email protected]/server.go:1620 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:920 +0x28a
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0xde71cd]
goroutine 23 [running]:
github.com/integrations/terraform-provider-github/v5/github.resourceGithubActionsRunnerGroupRead(0xc00013e690, {0xeb2f80?, 0xc00028e340?})
github.com/integrations/terraform-provider-github/v5/github/resource_github_actions_runner_group.go:188 +0x82d
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000143d60, 0xc000735900, {0xeb2f80, 0xc00028e340})
github.com/hashicorp/[email protected]/helper/schema/resource.go:470 +0x1aa
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadResource(0xc00011a920, {0xc00073e2a0?, 0x4b86c6?}, 0xc00073e2a0)
github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:535 +0x34b
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadResource_Handler({0x105cba0?, 0xc00011a920}, {0x12c5730, 0xc000768540}, 0xc00073e240, 0x0)
github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3269 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001fe380, {0x12c8e80, 0xc00030eb60}, 0xc000210a20, 0xc000435230, 0x19845b0, 0x0)
google.golang.org/[email protected]/server.go:1283 +0xcfd
google.golang.org/grpc.(*Server).handleStream(0xc0001fe380, {0x12c8e80, 0xc00030eb60}, 0xc000210a20, 0x0)
google.golang.org/[email protected]/server.go:1620 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:920 +0x28a
Error: The terraform-provider-github_v5.16.0 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.
Update - in our case, I believe the issue is a different one than the one @cb-musaibsharieff is encountering, because pinning the provider version to v5.14.0 allows the plan to run without these memory errors. The issue arises when we switch to v5.15.0 and v5.16.0, so I think something was introduced in v5.15.0 that caused it to break. @kfcampbell should I open a separate issue for this?
Hello, I have the same issue with this resource:
resource "github_actions_runner_group" "demo" {
name = "demo"
visibility = "selected"
selected_repository_ids = [
"10000"
]
}
I use v5.16.0 version of the GitHub Provider and 1.3.4 Terraform.
As @cwthrivent mentioned, it might not be the same cause of this GitHub issue but let me report it 🙏
@kfcampbell should I open a separate issue for this?
Yes please, that'd be great.
@kfcampbell should I open a separate issue for this?
Yes please, that'd be great.
Thanks, I have created #1524.
👋 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!