DeviaVir / terraform-provider-gsuite

A @HashiCorp Terraform provider for managing G Suite resources.
MIT License
271 stars 77 forks source link

Missing argument Name on user creation #113

Closed alibabjo closed 4 years ago

alibabjo commented 4 years ago

Hello, I'm trying to create gsuite user, but systematically having the same issue :

Error: Missing required argument on user.tf line 16, in resource "gsuite_user" "developer": 16: resource "gsuite_user" "developer" { The argument "name" is required, but no definition was found. Error: Unsupported block type

here is my user data : resource "gsuite_user" "developer" { name { family_name = "testjha" given_name = "jhatest" } password = "testtest123!" primary_email = "developer@xx.xxx" }

any idea?

thk in advance Regard

DeviaVir commented 4 years ago

What version of terraform are you using? Do you see the same error when you use:

name = {
  family_name = "testjha"
  given_name = "jhatest"
}
alibabjo commented 4 years ago

i'm using v0.1.35 of Gsuite provider. with the above format , i've this error: Acquiring state lock. This may take a few moments... gsuite_user.developer: Creating...

Error: rpc error: code = Canceled desc = context canceled

panic: runtime error: invalid memory address or nil pointer dereference 2019-11-21T13:31:42.331Z [DEBUG] plugin.terraform-provider-gsuite: [signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0xe54b5a] 2019-11-21T13:31:42.331Z [DEBUG] plugin.terraform-provider-gsuite: 2019-11-21T13:31:42.331Z [DEBUG] plugin.terraform-provider-gsuite: goroutine 24 [running]: 2019-11-21T13:31:42.331Z [DEBUG] plugin.terraform-provider-gsuite: github.com/DeviaVir/terraform-provider-gsuite/gsuite.resourceUserCreate(0xc000160700, 0xf831c0, 0xc000156c60, 0x2, 0x1bbd880) 2019-11-21T13:31:42.332Z [DEBUG] plugin.terraform-provider-gsuite: /go/src/github.com/DeviaVir/terraform-provider-gsuite/gsuite/resource_user.go:450 +0x1c3a 2019-11-21T13:31:42.332Z [DEBUG] plugin.terraform-provider-gsuite: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Resource).Apply(0xc0000e7c80, 0xc0003e7f90, 0xc0001188a0, 0xf831c0, 0xc000156c60, 0xc000378d01, 0xc00037c938, 0xf7b0a0) 2019-11-21T13:31:42.332Z [DEBUG] plugin.terraform-provider-gsuite: /go/src/github.com/DeviaVir/terraform-provider-gsuite/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:305 +0x3b4 2019-11-21T13:31:42.332Z [DEBUG] plugin.terraform-provider-gsuite: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Provider).Apply(0xc0000e7e80, 0xc0007f9a68, 0xc0003e7f90, 0xc0001188a0, 0xc00037c7a8, 0xc00000f570, 0xf7cd80) 2019-11-21T13:31:42.333Z [DEBUG] plugin.terraform-provider-gsuite: /go/src/github.com/DeviaVir/terraform-provider-gsuite/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go:294 +0x18f 2019-11-21T13:31:42.333Z [DEBUG] plugin.terraform-provider-gsuite: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(GRPCProviderServer).ApplyResourceChange(0xc00000ea90, 0x1354ec0, 0xc000407590, 0xc000157920, 0xc00000ea90, 0xc000407590, 0xc0006e8bd0) 2019-11-21T13:31:42.333Z [DEBUG] plugin.terraform-provider-gsuite: /go/src/github.com/DeviaVir/terraform-provider-gsuite/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin/grpc_provider.go:885 +0x884 2019-11-21T13:31:42.333Z [DEBUG] plugin.terraform-provider-gsuite: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x10b9920, 0xc00000ea90, 0x1354ec0, 0xc000407590, 0xc0001578c0, 0x0, 0x1354ec0, 0xc000407590, 0xc0000a5b00, 0x457) 2019-11-21T13:31:42.333Z [DEBUG] plugin.terraform-provider-gsuite: /go/src/github.com/DeviaVir/terraform-provider-gsuite/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go:3189 +0x23e 2019-11-21T13:31:42.334Z [DEBUG] plugin.terraform-provider-gsuite: google.golang.org/grpc.(Server).processUnaryRPC(0xc0000c0000, 0x1362ca0, 0xc000874c00, 0xc00086ec00, 0xc000075e00, 0x1b92380, 0x0, 0x0, 0x0) 2019-11-21T13:31:42.334Z [DEBUG] plugin.terraform-provider-gsuite: /go/src/github.com/DeviaVir/terraform-provider-gsuite/vendor/google.golang.org/grpc/server.go:995 +0x466 2019-11-21T13:31:42.335Z [DEBUG] plugin.terraform-provider-gsuite: google.golang.org/grpc.(Server).handleStream(0xc0000c0000, 0x1362ca0, 0xc000874c00, 0xc00086ec00, 0x0) 2019-11-21T13:31:42.341Z [DEBUG] plugin.terraform-provider-gsuite: /go/src/github.com/DeviaVir/terraform-provider-gsuite/vendor/google.golang.org/grpc/server.go:1275 +0xda6 2019-11-21T13:31:42.341Z [DEBUG] plugin.terraform-provider-gsuite: google.golang.org/grpc.(Server).serveStreams.func1.1(0xc000036350, 0xc0000c0000, 0x1362ca0, 0xc000874c00, 0xc00086ec00) 2019-11-21T13:31:42.341Z [DEBUG] plugin.terraform-provider-gsuite: /go/src/github.com/DeviaVir/terraform-provider-gsuite/vendor/google.golang.org/grpc/server.go:710 +0x9f 2019-11-21T13:31:42.341Z [DEBUG] plugin.terraform-provider-gsuite: created by google.golang.org/grpc.(Server).serveStreams.func1 2019-11-21T13:31:42.342Z [DEBUG] plugin.terraform-provider-gsuite: /go/src/github.com/DeviaVir/terraform-provider-gsuite/vendor/google.golang.org/grpc/server.go:708 +0xa1 2019-11-21T13:31:42.344Z [DEBUG] plugin: plugin process exited: path=/root/.terraform.d/plugins/terraform-provider-gsuite pid=59 error="exit status 2" 2019/11/21 13:31:42 [DEBUG] gsuite_user.developer: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Canceled desc = context canceled 2019/11/21 13:31:42 [TRACE] : eval: terraform.EvalMaybeTainted 2019/11/21 13:31:42 [TRACE] EvalMaybeTainted: gsuite_user.developer encountered an error during creation, so it is now marked as tainted 2019/11/21 13:31:42 [TRACE] : eval: terraform.EvalWriteState 2019/11/21 13:31:42 [TRACE] EvalWriteState: removing state object for gsuite_user.developer 2019/11/21 13:31:42 [TRACE] : eval: terraform.EvalApplyProvisioners 2019/11/21 13:31:42 [TRACE] EvalApplyProvisioners: gsuite_user.developer has no state, so skipping provisioners 2019/11/21 13:31:42 [TRACE] : eval: terraform.EvalMaybeTainted 2019/11/21 13:31:42 [TRACE] EvalMaybeTainted: gsuite_user.developer encountered an error during creation, so it is now marked as tainted 2019/11/21 13:31:42 [TRACE] : eval: terraform.EvalWriteState 2019/11/21 13:31:42 [TRACE] EvalWriteState: removing state object for gsuite_user.developer 2019/11/21 13:31:42 [TRACE] : eval: terraform.EvalIf 2019/11/21 13:31:42 [TRACE] : eval: terraform.EvalIf 2019/11/21 13:31:42 [TRACE] : eval: terraform.EvalWriteDiff 2019/11/21 13:31:42 [TRACE] : eval: terraform.EvalApplyPost 2019/11/21 13:31:42 [ERROR] : eval: terraform.EvalApplyPost, err: rpc error: code = Canceled desc = context canceled 2019/11/21 13:31:42 [ERROR] : eval: terraform.EvalSequence, err: rpc error: code = Canceled desc = context canceled 2019/11/21 13:31:42 [TRACE] [walkApply] Exiting eval tree: gsuite_user.developer 2019/11/21 13:31:42 [TRACE] vertex "gsuite_user.developer": visit complete 2019/11/21 13:31:42 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping 2019/11/21 13:31:42 [TRACE] dag/walk: upstream of "provider.gsuite (close)" errored, so skipping 2019/11/21 13:31:42 [TRACE] dag/walk: upstream of "root" errored, so skipping 2019-11-21T13:31:42.608Z [DEBUG] plugin: plugin exited

Terraform crashed! This is always indicative of a bug within Terraform. A crash log has been placed at "crash.log" relative to your current working directory. It would be immensely helpful if you could please report the crash with Terraform1 so that we can fix this.

When reporting bugs, please include your terraform version. That information is available on the first line of crash.log. You can also get it by running 'terraform --version' on the command line.

SECURITY WARNING: the "crash.log" file that was created may contain sensitive information that must be redacted before it is safe to share on the issue tracker.

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

alibabjo commented 4 years ago

oups sorry, i've provide gsuite provider version.. I currently use terraform_0.12.15_linux_amd64.

alibabjo commented 4 years ago

Hello, solved.... You are right the good format is : name = { family_name = "testjha" given_name = "jhatest" }

but i have also forget to add the corresponding service account right on cloud identity ( user scope).... Maybe the error should be "permission denied" ?