Skip to content

Call to user API crashing provider in 3.9.0

Created by: deberon

Terraform Version

1.1.4

Provider Version

3.9.0 (rolling back to 3.8.0 resolves the error)

Affected Resource(s)

  • data.gitlab_user

Terraform Configuration Files

data "gitlab_user" "users" {
  for_each = toset(concat(var.maintainers, var.developers))
  username = each.key
}

Panic Output

-----------------------------------------------------: timestamp=2022-02-04T15:48:29.361Z
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: panic: runtime error: invalid memory address or nil pointer dereference
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc0be03]
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: goroutine 55 [running]:
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: github.com/gitlabhq/terraform-provider-gitlab/gitlab.dataSourceGitlabUserRead(0xfc19a8, 0xc0003fe900, 0xc00026f500, 0xe1dd20, 0xc0004c4400, 0xc0004dfc70, 0xc0003e78b8, 0x40e0f8)
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 	github.com/gitlabhq/terraform-provider-gitlab/gitlab/data_source_gitlab_user.go:234 +0x5e3
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0001277a0, 0xfc1938, 0xc0001b3b80, 0xc00026f500, 0xe1dd20, 0xc0004c4400, 0x0, 0x0, 0x0)
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource.go:358 +0x17f
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc0001277a0, 0xfc1938, 0xc0001b3b80, 0xc00026f400, 0xe1dd20, 0xc0004c4400, 0xc0004c4400, 0xc00026f400, 0x0, 0x0)
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource.go:569 +0xfd
2022-02-04T15:48:29.363Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc0000ad4d0, 0xfc1938, 0xc0001b3b80, 0xc000325cc0, 0xea9bd8, 0x12, 0x0)
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/grpc_provider.go:1133 +0x518
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadDataSource(0xc000302200, 0xfc19e0, 0xc0001b3b80, 0xc000316c30, 0x0, 0x0, 0x0)
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 	github.com/hashicorp/terraform-plugin-go@v0.5.0/tfprotov5/tf5server/server.go:478 +0x2f5
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler(0xe57c80, 0xc000302200, 0xfc19e0, 0xc00058b080, 0xc0003fe420, 0x0, 0xfc19e0, 0xc00058b080, 0xc000205080, 0x16c)
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 	github.com/hashicorp/terraform-plugin-go@v0.5.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:416 +0x214
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: google.golang.org/grpc.(*Server).processUnaryRPC(0xc00027ae00, 0xfc9838, 0xc0000c1500, 0xc000116e00, 0xc00007e840, 0x1475cb0, 0x0, 0x0, 0x0)
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 	google.golang.org/grpc@v1.32.0/server.go:1194 +0x52b
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: google.golang.org/grpc.(*Server).handleStream(0xc00027ae00, 0xfc9838, 0xc0000c1500, 0xc000116e00, 0x0)
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 	google.golang.org/grpc@v1.32.0/server.go:1517 +0xd0c
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc00003e250, 0xc00027ae00, 0xfc9838, 0xc0000c1500, 0xc000116e00)
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 	google.golang.org/grpc@v1.32.0/server.go:859 +0xab
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: created by google.golang.org/grpc.(*Server).serveStreams.func1
2022-02-04T15:48:29.364Z [DEBUG] provider.terraform-provider-gitlab_v3.9.0: 	google.golang.org/grpc@v1.32.0/server.go:857 +0x1fd
2022-02-04T15:48:29.365Z [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/gitlabhq/gitlab/3.9.0/linux_amd64/terraform-provider-gitlab_v3.9.0 pid=42 error="exit status 2"
2022-02-04T15:48:29.365Z [ERROR] plugin.(*GRPCProvider).ReadDataSource: error="rpc error: code = Unavailable desc = transport is closing"
2022-02-04T15:48:29.366Z [ERROR] vertex "module.aws_group.data.gitlab_group.base" error: Plugin did not respond
2022-02-04T15:48:29.366Z [ERROR] vertex "module.aws_group.data.gitlab_group.base" error: Plugin did not respond
2022-02-04T15:48:29.366Z [ERROR] vertex "module.aws_group.data.gitlab_group.base (expand)" error: Plugin did not respond
2022-02-04T15:48:29.366Z [ERROR] plugin.(*GRPCProvider).ReadDataSource: error="rpc error: code = Unavailable desc = transport is closing"

Expected Behavior

The module should fetch user data from the gitlab API and the terraform plan succeeds.

Actual Behavior

The terraform plan fails with these errors:

│ Error: Request cancelled

│   with module.tf_modules_group.data.gitlab_group.base,
│   on modules/group/main.tf line 17, in data "gitlab_group" "base":
│   17: data "gitlab_group" "base" {

│ The plugin.(*GRPCProvider).ValidateDataResourceConfig request was
│ cancelled.

Steps to Reproduce

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

  1. Use provided HCL
  2. terraform apply

Important Factoids

Rolling back to v3.8.0 fixes this.