terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

[BUG]: `github_actions_runner_group` return error.

Open WilliamB17 opened this issue 1 year ago • 7 comments

Expected Behavior

Normally, the way I use the resource, I should be able to create group runners without any errors.

resource "github_actions_runner_group" "runner_group" {
  for_each = local.runners

  name       = each.key
  visibility = "private"
}

Actual Behavior

When the resource is used, it returns an error, but the resource has been created.

github_actions_runner_group.runner_group["infrastructure"]: Creating...
│ Error: Invalid address to set: []string{"id"}
│ 
│   with github_actions_runner_group.runner_group["infrastructure"],
│   on main.tf line 22, in resource "github_actions_runner_group" "runner_group":
│   22: resource "github_actions_runner_group" "runner_group" {
│ 

Terraform Version

Terraform v1.7.3 on darwin_arm64

github = {
      source  = "integrations/github"
      version = "6.0.0"
 }

Affected Resource(s)

  • github_actions_runner_group

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

No response

Panic Output

No response

Code of Conduct

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

WilliamB17 avatar Feb 20 '24 10:02 WilliamB17

Can confirm I'm experiencing the same issue with 6.0.0, if I revert back to 5.45.0 there are no issues.

j-nix avatar Feb 21 '24 09:02 j-nix

Also the same here.

david-heward-unmind avatar Feb 22 '24 09:02 david-heward-unmind

Have the same issue but already when running terraform plan

$ terraform plan
github_actions_runner_group.this: Refreshing state... [id=8]

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Invalid address to set: []string{"id"}
│
│   with github_actions_runner_group.this,
│   on main.tf line 1, in resource "github_actions_runner_group" "this":
│    1: resource "github_actions_runner_group" "this" {
│

I assume it's the same underlying issue.

andreas-aman avatar Feb 28 '24 07:02 andreas-aman

I have the same issue trying to import a group:

import {
  to = github_actions_runner_group.test
  id = "5"
}

(Terrafrom 1.7.4, provider 6.0.0)

I tried adding the target resource or using terraform plan -generate-config-out=gen.tf. Either way it fails with the cryptic

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Invalid address to set: []string{"id"}

In my case it doesn't even point to the problematic resource/block.

laughedelic avatar Mar 01 '24 02:03 laughedelic

+1

oliverwiegers avatar Mar 01 '24 13:03 oliverwiegers

Same error here.

ohookins avatar Mar 04 '24 06:03 ohookins

My guess is that's related to us checking the result of this call to d.Set("id". PRs are appreciated!

kfcampbell avatar Mar 04 '24 19:03 kfcampbell

+1

chrheg avatar Mar 08 '24 08:03 chrheg

The naive, quick thing to do would be to replace

	if err = d.Set("id", runnerGroup.GetID()); err != nil {
		return err
	}

with

	_ = d.Set("id", runnerGroup.GetID())

but I don't love that. The better thing to do would be to debug the provider to figure out why the Set is erroring.

kfcampbell avatar Mar 08 '24 18:03 kfcampbell

Same on v6.2.0

ViacheslavKudinov avatar Mar 20 '24 09:03 ViacheslavKudinov