mumoshu / terraform-provider-helmfile

Deploy Helmfile releases from Terraform
126 stars 20 forks source link

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

Closed andrewnazarov closed 4 years ago

andrewnazarov commented 4 years ago

I'm moving forward from the previous version to the most recent and the latest fails for all our environment with

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

during terraform plan stage. There are no changes in any helmfile state except for one. And for that specific environment, the error is the same. Retry didn't help.

helmfile version: v0.109.0

Turning debug on I've got the following:

2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: 
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: goroutine 16 [running]:
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: github.com/mumoshu/terraform-provider-helmfile/pkg/tfhelmfile.MustRead(0x12307a0, 0xc0001d47e0, 0x7f0dc5dea008)
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile:   /go/src/terraform-provider-helmfile/pkg/tfhelmfile/resource_release_set.go:192 +0x91b
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: github.com/mumoshu/terraform-provider-helmfile/pkg/tfhelmfile.read(0xc0001d47e0, 0xe1e2e0, 0x195ea60, 0xc00023d888, 0x1, 0x1, 0xc0001d47e0, 0x0)
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile:   /go/src/terraform-provider-helmfile/pkg/tfhelmfile/resource_release_set.go:311 +0x3b
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: github.com/mumoshu/terraform-provider-helmfile/pkg/tfhelmfile.resourceReleaseSetRead(0xc0001d47e0, 0xe1e2e0, 0x195ea60, 0xc0001d47e0, 0x0)
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile:   /go/src/terraform-provider-helmfile/pkg/tfhelmfile/resource_release_set.go:137 +0x77
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc00017a900, 0xc000589130, 0xe1e2e0, 0x195ea60, 0xc00015e6f8, 0x0, 0x0)
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile:   /go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.0.0/helper/schema/resource.go:455 +0x119
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadResource(0xc00015e4a0, 0x123ef00, 0xc00049e930, 0xc000588f50, 0xc00015e4a0, 0xc00049e930, 0xc00059ca80)
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile:   /go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.0.0/internal/helper/plugin/grpc_provider.go:525 +0x3d8
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadResource_Handler(0xfd0aa0, 0xc00015e4a0, 0x123ef00, 0xc00049e930, 0xc0005b7560, 0x0, 0x123ef00, 0xc00049e930, 0xc000157900, 0x10d0)
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile:   /go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.0.0/internal/tfplugin5/tfplugin5.pb.go:3153 +0x217
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000ea000, 0x124ac40, 0xc0002d2a80, 0xc0004f2600, 0xc000142540, 0x1934510, 0x0, 0x0, 0x0)
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile:   /go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:995 +0x460
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: google.golang.org/grpc.(*Server).handleStream(0xc0000ea000, 0x124ac40, 0xc0002d2a80, 0xc0004f2600, 0x0)
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile:   /go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:1275 +0xd97
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000152000, 0xc0000ea000, 0x124ac40, 0xc0002d2a80, 0xc0004f2600)
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile:   /go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:710 +0xbb
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile: created by google.golang.org/grpc.(*Server).serveStreams.func1
 2020-07-22T20:37:42.488Z [DEBUG] plugin.terraform-provider-helmfile:   /go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:708 +0xa1
 2020/07/22 20:37:42 [ERROR] <root>: eval: *terraform.EvalRefresh, err: rpc error: code = Unavailable desc = transport is closing
 2020/07/22 20:37:42 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
 2020-07-22T20:37:42.491Z [DEBUG] plugin: plugin process exited: path=/root/.terraform.d/plugins/linux_amd64/terraform-provider-helmfile pid=341 error="exit status 2"
 2020-07-22T20:37:42.797Z [DEBUG] plugin: plugin exited

We have concurrency set to 1.

mumoshu commented 4 years ago

@andrewnazarov Thanks! I've successfully reproduced this and it's fixed in v0.3.4.

// I've recently changed the default path from "helmfile.yaml" to "", and this bug was introduced due to some deficiency in the migration logic in the provider to rewrite the state for default values change.

andrewnazarov commented 4 years ago

I'm sorry to say that, but Error: Provider produced inconsistent final plan strikes back (https://github.com/mumoshu/terraform-provider-helmfile/issues/22)

For environments that have no helmfile state changes terraform apply works and I can confirm it's faster than the intermediate working version was. For environments that have helmfile state changes terraform apply fails with the aforementioned Error: Provider produced inconsistent final plan.

andrewnazarov commented 4 years ago

This might be closed, I think