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

github_repository_file creation will panic #733

Closed
magodo opened this issue Mar 17, 2021 · 1 comment · Fixed by #732
Closed

github_repository_file creation will panic #733

magodo opened this issue Mar 17, 2021 · 1 comment · Fixed by #732
Labels
r/repository_file Type: Bug Something isn't working as documented

Comments

@magodo
Copy link
Contributor

magodo commented Mar 17, 2021

Affected Resource(s)

github_repository_file

Terraform Configuration Files

resource "github_repository_file" "foo" {
  repository          = github_repository.foo.name
  branch              = "main"
  file                = ".gitignore"
  content             = "**/*.tfstate"
  commit_message      = "Managed by Terraform"
  commit_author       = "Terraform User"
  commit_email        = "[email protected]"
}

Debug Output

2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: goroutine 25 [running]:
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*ResourceData).Set(0xc0002a2e70, 0x10ffeba, 0x6, 0xf0ea80, 0xc0001de6f0, 0xc000792370, 0x42)
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: 	github.com/hashicorp/[email protected]/helper/schema/resource_data.go:206 +0x2ee
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: github.com/terraform-providers/terraform-provider-github/github.resourceGithubRepositoryFileCreate(0xc0002a2e70, 0xedc5a0, 0xc00020c780, 0x2, 0x1b4daa0)
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: 	github.com/terraform-providers/terraform-provider-github/github/resource_github_repository_file.go:207 +0x7de
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc0002a7280, 0xc00026caa0, 0xc0001beda0, 0xedc5a0, 0xc00020c780, 0xf78001, 0xc0000b2368, 0xc00050d590)
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: 	github.com/hashicorp/[email protected]/helper/schema/resource.go:305 +0x365
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc0000a4400, 0xc0005738e0, 0xc00026caa0, 0xc0001beda0, 0xc0003a0e08, 0xc00000e368, 0xf79ce0)
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: 	github.com/hashicorp/[email protected]/helper/schema/provider.go:294 +0x99
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc00000e020, 0x13743c0, 0xc00050c930, 0xc00070cd20, 0xc00000e020, 0xc00050c930, 0xc000530a48)
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: 	github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:885 +0x8b4
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x10b77a0, 0xc00000e020, 0x13743c0, 0xc00050c930, 0xc00070ccc0, 0x0, 0x13743c0, 0xc00050c930, 0xc00054ac00, 0x10b3)
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: 	github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3189 +0x217
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: google.golang.org/grpc.(*Server).processUnaryRPC(0xc0004fe2c0, 0x137e380, 0xc000703680, 0xc0001a8300, 0xc000288cc0, 0x1b135a0, 0x0, 0x0, 0x0)
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: 	google.golang.org/[email protected]/server.go:995 +0x460
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: google.golang.org/grpc.(*Server).handleStream(0xc0004fe2c0, 0x137e380, 0xc000703680, 0xc0001a8300, 0x0)
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: 	google.golang.org/[email protected]/server.go:1275 +0xd3d
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc0007121c0, 0xc0004fe2c0, 0x137e380, 0xc000703680, 0xc0001a8300)
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: 	google.golang.org/[email protected]/server.go:710 +0xa1
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: created by google.golang.org/grpc.(*Server).serveStreams.func1
2021-03-17T10:07:05.767+0800 [DEBUG] plugin.terraform-provider-github_v4.5.2: 	google.golang.org/[email protected]/server.go:708 +0xa1
2021-03-17T10:07:05.769+0800 [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/github/4.5.2/linux_amd64/terraform-provider-github_v4.5.2 pid=19110 error="exit status 2"

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

References

#732 shall fix this.

@jcudit
Copy link
Contributor

jcudit commented Mar 22, 2021

Thanks for root causing this and coming through with the fix ❤️

Got this queued for some light testing but likely will ship with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r/repository_file Type: Bug Something isn't working as documented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants