turbot / terraform-provider-turbot

Terraform Turbot provider
https://www.terraform.io/docs/providers/turbot/
Mozilla Public License 2.0
7 stars 4 forks source link

Crash when installing mod resource. terraform-provider-turbot_v1.6.1. Terraform v0.12.27 #94

Open kaidaguerre opened 4 years ago

kaidaguerre commented 4 years ago

when running this config resource "turbot_mod" "test"{ org = "turbot" mod = "turbot-terraform-provider-test" version = "*" } I received this output

turbot_folder.parent: Creating...
turbot_folder.parent: Creation complete after 1s [id=198835149867990]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
kai@Kais-MacBook-Pro terraform % terraform apply --auto-approve
turbot_folder.parent: Refreshing state... [id=198835149867990]
turbot_folder.parent: Destroying... [id=198835149867990]
turbot_folder.parent: Destruction complete after 0s
turbot_mod.test: Creating...

Error: rpc error: code = Unavailable desc = transport is closing

panic: runtime error: index out of range [2] with length 2
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: 
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: goroutine 40 [running]:
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: github.com/terraform-providers/terraform-provider-turbot/apiClient.BuildHttpErrorMessage(0x1e866a0, 0xc000284d60, 0xc000038098, 0xc0005312c0)
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   github.com/terraform-providers/terraform-provider-turbot/apiClient/errors.go:29 +0x445
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: github.com/terraform-providers/terraform-provider-turbot/apiClient.(*Client).doRequest(0xc0006b3c20, 0x1c91cd1, 0x87, 0xc0005313c0, 0x1a6d4a0, 0xc0003de780, 0x6, 0x256192e)
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   github.com/terraform-providers/terraform-provider-turbot/apiClient/client.go:247 +0x539
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: github.com/terraform-providers/terraform-provider-turbot/apiClient.(*Client).InstallMod(0xc0006b3c20, 0xc0003a62a0, 0x4, 0x4, 0xc0003a62a0)
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   github.com/terraform-providers/terraform-provider-turbot/apiClient/mod.go:17 +0x133
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: github.com/terraform-providers/terraform-provider-turbot/turbot.modInstall(0xc000220fc0, 0x1c4bf20, 0xc0006b3c20, 0x0, 0x0)
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   github.com/terraform-providers/terraform-provider-turbot/turbot/resource_turbot_mod.go:148 +0x97
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: github.com/terraform-providers/terraform-provider-turbot/turbot.resourceTurbotModInstall(0xc000220fc0, 0x1c4bf20, 0xc0006b3c20, 0x2, 0x2611300)
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   github.com/terraform-providers/terraform-provider-turbot/turbot/resource_turbot_mod.go:135 +0x243
2020-07-31T15:29:31.559+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc00009cb80, 0xc000101b30, 0xc0005387c0, 0x1c4bf20, 0xc0006b3c20, 0x1b01d01, 0xc0001732f8, 0xc0006b2960)
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   github.com/hashicorp/terraform@v0.12.0/helper/schema/resource.go:286 +0x365
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc00009d480, 0xc0005318d0, 0xc000101b30, 0xc0005387c0, 0xc000521828, 0xc000188300, 0x1b03d80)
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   github.com/hashicorp/terraform@v0.12.0/helper/schema/provider.go:285 +0x99
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: github.com/hashicorp/terraform/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc00009a5a8, 0x1e9f940, 0xc000401a10, 0xc0000777a0, 0xc00009a5a8, 0xc000401a10, 0xc00062aa48)
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   github.com/hashicorp/terraform@v0.12.0/helper/plugin/grpc_provider.go:842 +0x892
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: github.com/hashicorp/terraform/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1c17ba0, 0xc00009a5a8, 0x1e9f940, 0xc000401a10, 0xc000101950, 0x0, 0x1e9f940, 0xc000401a10, 0xc000524340, 0x197)
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   github.com/hashicorp/terraform@v0.12.0/internal/tfplugin5/tfplugin5.pb.go:3019 +0x217
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: google.golang.org/grpc.(*Server).processUnaryRPC(0xc000782900, 0x1eaa460, 0xc000602600, 0xc000523e00, 0xc000103110, 0x25d73c0, 0x0, 0x0, 0x0)
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   google.golang.org/grpc@v1.18.0/server.go:966 +0x46a
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: google.golang.org/grpc.(*Server).handleStream(0xc000782900, 0x1eaa460, 0xc000602600, 0xc000523e00, 0x0)
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   google.golang.org/grpc@v1.18.0/server.go:1245 +0xc9e
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc0001981c0, 0xc000782900, 0x1eaa460, 0xc000602600, 0xc000523e00)
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   google.golang.org/grpc@v1.18.0/server.go:685 +0xa1
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1: created by google.golang.org/grpc.(*Server).serveStreams.func1
2020-07-31T15:29:31.560+0100 [DEBUG] plugin.terraform-provider-turbot_v1.6.1:   google.golang.org/grpc@v1.18.0/server.go:683 +0xa1
2020-07-31T15:29:31.564+0100 [DEBUG] plugin: plugin process exited: path=/Users/kai/terraform/.terraform/plugins/darwin_amd64/terraform-provider-turbot_v1.6.1 pid=42986 error="exit status 2"
2020/07/31 15:29:31 [DEBUG] turbot_mod.test: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2020/07/31 15:29:31 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/07/31 15:29:31 [TRACE] EvalMaybeTainted: turbot_mod.test encountered an error during creation, so it is now marked as tainted
2020/07/31 15:29:31 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/07/31 15:29:31 [TRACE] EvalWriteState: removing state object for turbot_mod.test
2020/07/31 15:29:31 [TRACE] <root>: eval: *terraform.EvalApplyProvisioners
2020/07/31 15:29:31 [TRACE] EvalApplyProvisioners: turbot_mod.test has no state, so skipping provisioners
2020/07/31 15:29:31 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/07/31 15:29:31 [TRACE] EvalMaybeTainted: turbot_mod.test encountered an error during creation, so it is now marked as tainted
2020/07/31 15:29:31 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/07/31 15:29:31 [TRACE] EvalWriteState: removing state object for turbot_mod.test
2020/07/31 15:29:31 [TRACE] <root>: eval: *terraform.EvalIf
2020/07/31 15:29:31 [TRACE] <root>: eval: *terraform.EvalIf
2020/07/31 15:29:31 [TRACE] <root>: eval: *terraform.EvalWriteDiff
2020/07/31 15:29:31 [TRACE] <root>: eval: *terraform.EvalApplyPost
2020/07/31 15:29:31 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing
2020/07/31 15:29:31 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2020/07/31 15:29:31 [TRACE] [walkApply] Exiting eval tree: turbot_mod.test
2020/07/31 15:29:31 [TRACE] vertex "turbot_mod.test": visit complete
2020/07/31 15:29:31 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2020/07/31 15:29:31 [TRACE] dag/walk: upstream of "provider.turbot (close)" errored, so skipping
2020/07/31 15:29:31 [TRACE] dag/walk: upstream of "root" errored, so skipping
2020/07/31 15:29:31 [TRACE] statemgr.Filesystem: have already backed up original terraform.tfstate to terraform.tfstate.backup on a previous write
2020/07/31 15:29:31 [TRACE] statemgr.Filesystem: state has changed since last snapshot, so incrementing serial to 13
2020/07/31 15:29:31 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
2020/07/31 15:29:31 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info
2020/07/31 15:29:31 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock
2020-07-31T15:29:31.577+0100 [DEBUG] plugin: plugin exited

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

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 Terraform[1] 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.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
kai@Kais-MacBook-Pro terraform % 
kaidaguerre commented 4 years ago

venu received a similar error (no crash though) https://turbothq.slack.com/archives/CT39EEU3U/p1596090563464300

RupeshPatil20 commented 4 years ago

I think it's a issue of a clean install. I wasn't able to reproduce the error and crash.

 $ terraform --version
Terraform v0.13.0-beta3
+ provider registry.terraform.io/turbot/turbot v1.6.1

terraform {
  required_providers {
    turbot = {
      source = "turbot/turbot"
      version = "1.6.1"
    }
  }
}
resource "turbot_mod" "test" {
  org = "turbot"
  mod = "turbot-terraform-provider-test"
  version = "*"
}
 $ terraform apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # turbot_mod.test will be created
  + resource "turbot_mod" "test" {
      + id              = (known after apply)
      + mod             = "turbot-terraform-provider-test"
      + org             = "turbot"
      + parent          = "tmod:@turbot/turbot#/"
      + parent_akas     = (known after apply)
      + uri             = (known after apply)
      + version         = "*"
      + version_current = "5.0.2"
      + version_latest  = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

turbot_mod.test: Creating...
turbot_mod.test: Creation complete after 9s [id=199077573124797]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.