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

When try to apply hcp_vault_cluster got rpc error #360

Closed
nickspanin opened this issue Jul 28, 2022 · 4 comments
Closed

When try to apply hcp_vault_cluster got rpc error #360

nickspanin opened this issue Jul 28, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@nickspanin
Copy link

Terraform Version and Provider Version

Terraform version: 1.2.6
HCP provider version: 0.37.0

Affected Resource(s)

  • hcp_vault_cluster

Terraform Configuration Files

resource "hcp_vault_cluster" "vaut_cluster" {
  cluster_id        = "test-cluster"
  hvn_id            = hcp_hvn.vault_network.hvn_id
  tier              = "dev"
  public_endpoint   = false
  lifecycle {
    prevent_destroy = false
  }
}

Debug Output

2022-07-28T15:32:48.524+0300 [ERROR] plugin.(*GRPCProvider).ApplyResourceChange: error="rpc error: code = Unavailable desc = transport is closing"
2022-07-28T15:32:48.524+0300 [ERROR] plugin.(*GRPCProvider).ApplyResourceChange: error="rpc error: code = Unavailable desc = transport is closing"
2022-07-28T15:32:48.524+0300 [ERROR] plugin.(*GRPCProvider).ApplyResourceChange: error="rpc error: code = Unavailable desc = transport is closing"
2022-07-28T15:32:48.524+0300 [ERROR] vertex "module.vault.hcp_aws_network_peering.vpc_peering_eks" error: Plugin did not respond
2022-07-28T15:32:48.524+0300 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-07-28T15:32:48.524+0300 [ERROR] vertex "module.vault.hcp_vault_cluster.vaut_cluster" error: Plugin did not respond
2022-07-28T15:32:48.524+0300 [ERROR] vertex "module.vault.hcp_aws_network_peering.vpc_peering_to_clientvpn" error: Plugin did not respond

Panic Output

Stack trace from the terraform-provider-hcp_v0.37.0_x5 plugin:

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 129 [running]:
github.com/hashicorp/terraform-provider-hcp/internal/provider.getObservabilityConfig(0x104e20d, 0xe, 0xc000128e00, 0xea8980, 0xc000590f40, 0x203001, 0x203000)
github.com/hashicorp/terraform-provider-hcp/internal/provider/resource_vault_cluster.go:824 +0x225
github.com/hashicorp/terraform-provider-hcp/internal/provider.resourceVaultClusterCreate(0x1195b08, 0xc0003c3e00, 0xc000128e00, 0xeea660, 0xc000142540, 0xc000590df0, 0x0, 0x0)
github.com/hashicorp/terraform-provider-hcp/internal/provider/resource_vault_cluster.go:271 +0x17a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0004e00e0, 0x1195b40, 0xc000414f00, 0xc000128e00, 0xeea660, 0xc000142540, 0x0, 0x0, 0x0)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:707 +0x17f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0004e00e0, 0x1195b40, 0xc000414f00, 0xc0004111e0, 0xc000128c80, 0xeea660, 0xc000142540, 0x0, 0x0, 0x0, ...)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0x79d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00000c240, 0x1195b40, 0xc000414d50, 0xc000012aa0, 0x10521b2, 0x13, 0x1047484)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xb4f
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0002360a0, 0x1195b40, 0xc000414d50, 0xc0002d71f0, 0x0, 0x0, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:813 +0x70c
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0xfffb00, 0xc0002360a0, 0x1195b40, 0xc000414450, 0xc0002d7180, 0x0, 0x1195b40, 0xc000414450, 0xc000418600, 0x5a3)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00021a380, 0x119e8f8, 0xc0000a0680, 0xc0001f9440, 0xc0004a5830, 0x17d4580, 0x0, 0x0, 0x0)
google.golang.org/[email protected]/server.go:1295 +0x693
google.golang.org/grpc.(*Server).handleStream(0xc00021a380, 0x119e8f8, 0xc0000a0680, 0xc0001f9440, 0x0)
google.golang.org/[email protected]/server.go:1636 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000036690, 0xc00021a380, 0x119e8f8, 0xc0000a0680, 0xc0001f9440)
google.golang.org/[email protected]/server.go:932 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:930 +0x1fd

Error: The terraform-provider-hcp_v0.37.0_x5 plugin crashed!

Steps to Reproduce

  1. terraform apply
@nickspanin nickspanin added the bug Something isn't working label Jul 28, 2022
@bcmdarroch
Copy link
Contributor

bcmdarroch commented Jul 29, 2022

Thanks for reporting this bug! I've forwarded this along to Vault team and we'll get a fix out soon.

Some follow-up questions:

  • Are you using a module? Which one? If not, can you share the rest of your HCP config?
  • As a workaround, does removing the lifecycle block resolve the issue?
  • Were there any changes to the Vault cluster resource previous to this run? Or was this the first run?

@nickspanin
Copy link
Author

@bcmdarroch

  1. Im using hashicorp/hcp 0.37.0 for create vault cluster and hashicorp/aws 4.24.0 for peering connection
resource "hcp_hvn" "vault_network" {
  hvn_id            = "test-network"
  cloud_provider    = "aws"
  region            = "eu-west-1"
  cidr_block        = "172.25.16.0/20"
}

resource "hcp_vault_cluster" "vaut_cluster" {
  cluster_id        = "test-cluster"
  hvn_id            = hcp_hvn.vault_network.hvn_id
  tier              = "dev"
  public_endpoint   = false
  lifecycle {
    prevent_destroy = false
  }
}
  1. Im tryed to remove lifecycle and try to apply only creating hcp network and vault cluster - this not help,
    resource hcp_hvn was create and when resource hcp_vault_cluster try to apply i got this crash.

  2. This is deploy from scratch.

@nickspanin
Copy link
Author

Fix this issue when delete

  metrics_config {
  }
  audit_log_config {
  }

@kkredit
Copy link
Contributor

kkredit commented Aug 1, 2022

#364 should fix this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants