HewlettPackard / terraform-provider-oneview

Automates the provisioning of physical infrastructure from a private cloud using templates from HPE OneView with Terraform
Apache License 2.0
49 stars 30 forks source link

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

Closed Lanata07 closed 1 year ago

Lanata07 commented 1 year ago

I am facing this issue trying to apply new server profile : Error: rpc error: code = Unavailable desc = transport is closing on server profile

_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

oneview_server_profile.ServerProfiles["pbgmmmbe09509"]: Creating... oneview_server_profile.ServerProfiles["pbgmmmbe09508"]: Creating...

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

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

Releasing state lock. This may take a few moments... ERRO[0010] 1 error occurred:

Using:

I have already created at least 30 profiles whitout any issue

Lanata07 commented 1 year ago

Configuration :

nabhajit-ray commented 1 year ago

Hi @Lanata07 , Thanks for raising the issue. Can you please share the configuration file you are using to apply the server profile ? Also have can you try with the latest sdk 8.5.0-13?

Lanata07 commented 1 year ago

Hi @nabhajit-ray , I have tried as well with the provider 8.1.0-13 since OneView is currently in version "Firmware 8.10.00-0472141" same issue And as requested I have just tried with version 8.50.-13 same issue :

oneview_server_profile.ServerProfiles["pbgmmmbe09509"]: Creating...
oneview_server_profile.ServerProfiles["pbgmmmbe09508"]: Creating...
oneview_server_profile.ServerProfiles["pbgmmmbe09505"]: Modifying... [id=pbgmmmbe09505]
oneview_server_profile.ServerProfiles["pbgmmmbe09506"]: Modifying... [id=pbgmmmbe09506]
╷
│ Error: Plugin did not respond
│ 
│   with oneview_server_profile.ServerProfiles["pbgmmmbe09508"],
│   on main.tf line 1, in resource "oneview_server_profile" "ServerProfiles":
│    1: resource "oneview_server_profile" "ServerProfiles" {
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.

Configuration file :

# ---------------------------------------------------------------------------------------------------------------------
# Include configurations that are common used across multiple environments.
# ---------------------------------------------------------------------------------------------------------------------
# Include the root `terragrunt.hcl` configuration. The root configuration contains settings that are common across all
# components and environments, such as how to configure remote state.
include "root" {
  path = find_in_parent_folders()
}

terraform {
  source = "${local.base_source_url}?ref=${local.base_source_version}"

  extra_arguments "common_vars" {
    commands = get_terraform_commands_that_need_vars()
    arguments = [
      "-var-file=${dirname(find_in_parent_folders())}/terraform.tfvars"
    ]
  }
}
locals {
  # Expose the base source URL so different versions of the module can be deployed in different environments. This will
  # be used to construct the terraform block in the child terragrunt configurations.
  base_source_url     = "XXXXXXXXX/sys-ter-module-oneview.git//synergy/servers/server-profile"
  base_source_version = "2.0.2"
}

dependencies {
  paths = ["../../networking/logical-interconnect-group", "../enclosure-group", "../logical-enclosure", "../server-profile-template"]
}

# ---------------------------------------------------------------------------------------------------------------------
# Override parameters for this environment
# ---------------------------------------------------------------------------------------------------------------------
# For production, we want to specify override parameters here. These
# inputs get merged with the common inputs from the root and the envcommon terragrunt.hcl
inputs = {
  server_profiles = [
    {
      server_profile_name = "cpbgc02hvesxmts01"
      server_profile_type = "ServerProfileV12"
      hardware_name       = "cpbgc02syfra00014, bay 1"
      affinity            = "BayAndServer"
      template            = "sptesxmts"
    },
    {
      server_profile_name = "cpbgc02hvesxmts02"
      server_profile_type = "ServerProfileV12"
      hardware_name       = "cpbgc02syfra00015, bay 1"
      affinity            = "BayAndServer"
      template            = "sptesxmts"
    },...........
nabhajit-ray commented 1 year ago

Hi @Lanata07 ,

We could not reproduce the issue. Please provide the server profile template configuration . Can you please share terraform logs by follwing the steps below

  1. export by enabling TF_LOG=TRACE
  2. export TF_LOG_PATH-='terraform.log' 3 Run your configuration again.

Can you check if the connection is stable between terraform client and OneView?

Lanata07 commented 1 year ago
2023-09-06T14:07:02.037+0100 [INFO]  Terraform version: 1.5.6
2023-09-06T14:07:02.038+0100 [DEBUG] using github.com/hashicorp/go-tfe v1.26.0
2023-09-06T14:07:02.038+0100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.2
2023-09-06T14:07:02.038+0100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.0
2023-09-06T14:07:02.038+0100 [DEBUG] using github.com/zclconf/go-cty v1.12.2
2023-09-06T14:07:02.038+0100 [INFO]  Go runtime version: go1.20.7
2023-09-06T14:07:02.038+0100 [INFO]  CLI args: []string{"terraform", "--version"}
2023-09-06T14:07:02.038+0100 [TRACE] Stdout is not a terminal
2023-09-06T14:07:02.038+0100 [TRACE] Stderr is not a terminal
2023-09-06T14:07:02.038+0100 [TRACE] Stdin is a terminal
2023-09-06T14:07:02.038+0100 [DEBUG] Attempting to open CLI config file: /home/XXXXXXX/.terraformrc
2023-09-06T14:07:02.038+0100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-09-06T14:07:02.038+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-09-06T14:07:02.038+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.terraform.d/plugins
2023-09-06T14:07:02.038+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.local/share/terraform/plugins
2023-09-06T14:07:02.038+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.local/share/flatpak/exports/share/terraform/plugins
2023-09-06T14:07:02.038+0100 [DEBUG] ignoring non-existing provider search directory /var/lib/flatpak/exports/share/terraform/plugins
2023-09-06T14:07:02.038+0100 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2023-09-06T14:07:02.038+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2023-09-06T14:07:02.038+0100 [INFO]  CLI command args: []string{"version", "--version"}
2023-09-06T14:07:21.564+0100 [INFO]  Terraform version: 1.5.6
2023-09-06T14:07:21.564+0100 [DEBUG] using github.com/hashicorp/go-tfe v1.26.0
2023-09-06T14:07:21.564+0100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.2
2023-09-06T14:07:21.564+0100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.0
2023-09-06T14:07:21.564+0100 [DEBUG] using github.com/zclconf/go-cty v1.12.2
2023-09-06T14:07:21.564+0100 [INFO]  Go runtime version: go1.20.7
2023-09-06T14:07:21.564+0100 [INFO]  CLI args: []string{"terraform", "--version"}
2023-09-06T14:07:21.564+0100 [TRACE] Stdout is not a terminal
2023-09-06T14:07:21.564+0100 [TRACE] Stderr is not a terminal
2023-09-06T14:07:21.564+0100 [TRACE] Stdin is a terminal
2023-09-06T14:07:21.564+0100 [DEBUG] Attempting to open CLI config file: /home/XXXXXXX/.terraformrc
2023-09-06T14:07:21.564+0100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-09-06T14:07:21.564+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-09-06T14:07:21.564+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.terraform.d/plugins
2023-09-06T14:07:21.564+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.local/share/terraform/plugins
2023-09-06T14:07:21.564+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.local/share/flatpak/exports/share/terraform/plugins
2023-09-06T14:07:21.565+0100 [DEBUG] ignoring non-existing provider search directory /var/lib/flatpak/exports/share/terraform/plugins
2023-09-06T14:07:21.565+0100 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2023-09-06T14:07:21.565+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2023-09-06T14:07:21.565+0100 [INFO]  CLI command args: []string{"version", "--version"}
2023-09-06T14:07:56.713+0100 [INFO]  Terraform version: 1.5.6
2023-09-06T14:07:56.713+0100 [DEBUG] using github.com/hashicorp/go-tfe v1.26.0
2023-09-06T14:07:56.713+0100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.2
2023-09-06T14:07:56.713+0100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.0
2023-09-06T14:07:56.713+0100 [DEBUG] using github.com/zclconf/go-cty v1.12.2
2023-09-06T14:07:56.713+0100 [INFO]  Go runtime version: go1.20.7
2023-09-06T14:07:56.713+0100 [INFO]  CLI args: []string{"terraform", "--version"}
2023-09-06T14:07:56.713+0100 [TRACE] Stdout is not a terminal
2023-09-06T14:07:56.713+0100 [TRACE] Stderr is not a terminal
2023-09-06T14:07:56.713+0100 [TRACE] Stdin is a terminal
2023-09-06T14:07:56.713+0100 [DEBUG] Attempting to open CLI config file: /home/XXXXXXX/.terraformrc
2023-09-06T14:07:56.713+0100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-09-06T14:07:56.713+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-09-06T14:07:56.713+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.terraform.d/plugins
2023-09-06T14:07:56.713+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.local/share/terraform/plugins
2023-09-06T14:07:56.713+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.local/share/flatpak/exports/share/terraform/plugins
2023-09-06T14:07:56.714+0100 [DEBUG] ignoring non-existing provider search directory /var/lib/flatpak/exports/share/terraform/plugins
2023-09-06T14:07:56.714+0100 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2023-09-06T14:07:56.714+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2023-09-06T14:07:56.714+0100 [INFO]  CLI command args: []string{"version", "--version"}
2023-09-06T14:13:35.670+0100 [INFO]  Terraform version: 1.5.6
2023-09-06T14:13:35.670+0100 [DEBUG] using github.com/hashicorp/go-tfe v1.26.0
2023-09-06T14:13:35.670+0100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.2
2023-09-06T14:13:35.670+0100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.0
2023-09-06T14:13:35.670+0100 [DEBUG] using github.com/zclconf/go-cty v1.12.2
2023-09-06T14:13:35.670+0100 [INFO]  Go runtime version: go1.20.7
2023-09-06T14:13:35.670+0100 [INFO]  CLI args: []string{"terraform", "apply"}
2023-09-06T14:13:35.670+0100 [TRACE] Stdout is a terminal of width 259
2023-09-06T14:13:35.670+0100 [TRACE] Stderr is a terminal of width 259
2023-09-06T14:13:35.670+0100 [TRACE] Stdin is a terminal
2023-09-06T14:13:35.670+0100 [DEBUG] Attempting to open CLI config file: /home/XXXXXXX/.terraformrc
2023-09-06T14:13:35.670+0100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-09-06T14:13:35.670+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-09-06T14:13:35.670+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.terraform.d/plugins
2023-09-06T14:13:35.670+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.local/share/terraform/plugins
2023-09-06T14:13:35.670+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.local/share/flatpak/exports/share/terraform/plugins
2023-09-06T14:13:35.670+0100 [DEBUG] ignoring non-existing provider search directory /var/lib/flatpak/exports/share/terraform/plugins
2023-09-06T14:13:35.670+0100 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2023-09-06T14:13:35.670+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2023-09-06T14:13:35.671+0100 [INFO]  CLI command args: []string{"apply"}
2023-09-06T14:13:35.671+0100 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2023-09-06T14:13:35.671+0100 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2023-09-06T14:13:35.671+0100 [DEBUG] New state was assigned lineage "dcb46659-eb27-ef97-866c-d5c23c035d7b"
2023-09-06T14:13:35.671+0100 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
2023-09-06T14:13:35.671+0100 [TRACE] Meta.Backend: instantiated backend of type <nil>
2023-09-06T14:13:35.672+0100 [TRACE] providercache.fillMetaCache: scanning directory .terraform/providers
2023-09-06T14:13:35.672+0100 [TRACE] getproviders.SearchLocalDirectory: failed to resolve symlinks for .terraform/providers: lstat .terraform: no such file or directory
2023-09-06T14:13:35.672+0100 [TRACE] providercache.fillMetaCache: error while scanning directory .terraform/providers: cannot search .terraform/providers: lstat .terraform/providers: no such file or directory
2023-09-06T14:13:35.673+0100 [DEBUG] checking for provisioner in "."
2023-09-06T14:13:35.673+0100 [DEBUG] checking for provisioner in "/home/XXXXXXX/.terraform.versions"
2023-09-06T14:13:48.843+0100 [INFO]  Terraform version: 1.5.6
2023-09-06T14:13:48.843+0100 [DEBUG] using github.com/hashicorp/go-tfe v1.26.0
2023-09-06T14:13:48.843+0100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.2
2023-09-06T14:13:48.843+0100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.0
2023-09-06T14:13:48.843+0100 [DEBUG] using github.com/zclconf/go-cty v1.12.2
2023-09-06T14:13:48.843+0100 [INFO]  Go runtime version: go1.20.7
2023-09-06T14:13:48.843+0100 [INFO]  CLI args: []string{"terraform", "--version"}
2023-09-06T14:13:48.843+0100 [TRACE] Stdout is not a terminal
2023-09-06T14:13:48.843+0100 [TRACE] Stderr is not a terminal
2023-09-06T14:13:48.843+0100 [TRACE] Stdin is a terminal
2023-09-06T14:13:48.843+0100 [DEBUG] Attempting to open CLI config file: /home/XXXXXXX/.terraformrc
2023-09-06T14:13:48.843+0100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-09-06T14:13:48.843+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-09-06T14:13:48.843+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.terraform.d/plugins
2023-09-06T14:13:48.843+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.local/share/terraform/plugins
2023-09-06T14:13:48.843+0100 [DEBUG] ignoring non-existing provider search directory /home/XXXXXXX/.local/share/flatpak/exports/share/terraform/plugins
2023-09-06T14:13:48.843+0100 [DEBUG] ignoring non-existing provider search directory /var/lib/flatpak/exports/share/terraform/plugins
2023-09-06T14:13:48.843+0100 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2023-09-06T14:13:48.843+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2023-09-06T14:13:48.843+0100 [INFO]  CLI command args: []string{"version", "--version"}

Connection seems to be stable between Oneview and the execution node.

nabhajit-ray commented 1 year ago

The logs seems to be partial , can you attach the complete log file. Also share the spt configuration .

Lanata07 commented 1 year ago

hello @nabhajit-ray,
I manage to solve the issue by destroying all ressources and apply it again. But the issue was on ILO side of one of the server hardware. for some reason no ILO addresses were allocated to the server. I then did an efuse and the server retrieve his ILO address. Thanks :)