gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
8.09k stars 981 forks source link

broken pipe #3452

Open KarelMacek opened 1 month ago

KarelMacek commented 1 month ago

Describe the bug

I am encountering a persistent "broken pipe" error when running Terragrunt with the Google Cloud provider. The error appears after the provider authenticates successfully but before any resources are created or modified. This issue occurs consistently, regardless of network or machine.

Steps To Reproduce

  1. Set up a GCP project and create a service account with the necessary permissions.
  2. Configure the following Terragrunt and Terraform files:
# Root terragrunt.hcl
generate "provider" {
  path = "providers.tf"
  if_exists = "overwrite"
  contents = <<EOF
provider "google" {
  project = var.project_id
  region  = var.region
}

provider "google-beta" {
  project = var.project_id
  region  = var.region
}

terraform {
  required_version = "v1.9.2"
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "5.38.0"
    }
    google-beta = {
      source  = "hashicorp/google-beta"
      version = "5.38.0"
    }
  }
}
EOF
}

# Child terragrunt.hcl (in gcf directory)
include {
  path = find_in_parent_folders()
}

inputs = {
  project_name          = local.env_vars.project_name
  project_suffix        = local.env_vars.project_suffix
  project_id            = local.env_vars.project_id
  region                = local.env_vars.region
  service_account_email = local.env_vars.service_account_email
  bucket_name           = local.env_vars.bucket_name
  capacity_gb           = 1024
  zone                  = local.env_vars.zone
}
  1. Run terragrunt init successfully.
  2. Run terragrunt apply -auto-approve.

The error message appears as follows:

21:28:43.777 ERROR  terraform invocation failed in /mnt/c/Users/KarelMacek/PycharmProjects/temus-dialogforge-infrastructure/terraform/gcp/resources/demo/gcf error=[/mnt/c/Users/KarelMacek/PycharmProjects/temus-dialogforge-infrastructure/terraform/gcp/resources/demo/gcf] signal: broken pipe
21:28:43.778 ERROR  1 error occurred:
        * [/mnt/c/Users/KarelMacek/PycharmProjects/temus-dialogforge-infrastructure/terraform/gcp/resources/demo/gcf] signal: broken pipe

Expected behavior

I expected the terragrunt apply process to complete without errors, proceeding with the resource creation and modification after successful authentication with the Google Cloud provider.

Nice to haves

Versions

Additional context

I've tried the following steps to troubleshoot the issue:

Any suggestions or insights would be greatly appreciated. Thank you!

denis256 commented 1 month ago

Hello, tried to run with --terragrunt-non-interactive, it is generating the same error?

dalgibbard commented 1 month ago

This issue was reaised before and fixed iirc; have you tried the latest version of TG?

yhakbar commented 1 month ago

Hey @KarelMacek ,

To avoid having this issue go stale, please do the following:

  1. Provide a fully reproducible example if the issue you are facing (no undefined local values, etc).

    This will help us reproduce the scenario you are encountering, allowing us to ensure that it's still and issue, and that we are correctly addressing the problem.

  2. Retest on v0.68.1. That is the latest version of Terragrunt, and per @dalgibbard 's comment, a similar issue was fixed after 0.67.4.