Loading...
Loading...
### Terraform Version ```shell Terraform v1.15.8 on darwin_arm64 Your version of Terraform is out of date! The latest version is 1.15.9. You can update by downloading from https://developer.hashicorp.com/terraform/install --- Also tested and reproducible with versions `1.13.5` and `1.15.9`, same OS/arch. ``` ### Terraform Configuration Files ```terraform module "fixture" { source = "git::file:///absolute/path/to/fixture-module.git" } ``` ### Debug Output Trace: ``` 2026-08-21T15:42:32.379+0100 [INFO] Terraform version: 1.15.8 2026-08-21T15:42:32.379+0100 [DEBUG] using github.com/hashicorp/go-tfe v1.105.0 2026-08-21T15:42:32.379+0100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.24.0 2026-08-21T15:42:32.379+0100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.2.1 2026-08-21T15:42:32.379+0100 [DEBUG] using github.com/zclconf/go-cty v1.18.0 2026-08-21T15:42:32.379+0100 [INFO] Go runtime version: go1.26.5 2026-08-21T15:42:32.379+0100 [INFO] CLI args: []string{"terraform", "init", "-input=false"} 2026-08-21T15:42:32.379+0100 [TRACE] Stdout is not a terminal 2026-08-21T15:42:32.379+0100 [TRACE] Stderr is not a terminal 2026-08-21T15:42:32.379+0100 [TRACE] Stdin is not a terminal 2026-08-21T15:42:32.379+0100 [DEBUG] Attempting to open CLI config file: /.terraformrc 2026-08-21T15:42:32.379+0100 [INFO] Loading CLI configuration from /.terraformrc 2026-08-21T15:42:32.379+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins 2026-08-21T15:42:32.379+0100 [DEBUG] ignoring non-existing provider search directory /.terraform.d/plugins 2026-08-21T15:42:32.379+0100 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins 2026-08-21T15:42:32.379+0100 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins 2026-08-21T15:42:32.379+0100 [INFO] CLI command args: []string{"init", "-input=false"} 2026-08-21T15:42:32.381+0100 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config 2026-08-21T15:42:32.381+0100 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory 2026-08-21T15:42:32.381+0100 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend) 2026-08-21T15:42:32.381+0100 [TRACE] Meta.Backend: instantiated backend of type 2026-08-21T15:42:32.381+0100 [DEBUG] checking for provisioner in "." 2026-08-21T15:42:32.381+0100 [DEBUG] checking for provisioner in "//bin" 2026-08-21T15:42:32.381+0100 [TRACE] Meta.Backend: backend does not support operations, so wrapping it in a local backend 2026-08-21T15:42:32.381+0100 [TRACE] backend/local: state manager for workspace "default" will: - read initial snapshot from terraform.tfstate - write new snapshots to terraform.tfstate - create any backup at terraform.tfstate.backup 2026-08-21T15:42:32.381+0100 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate 2026-08-21T15:42:32.381+0100 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay 2026-08-21T15:42:32.381+0100 [TRACE] statemgr.Filesystem: read nil snapshot 2026-08-21T15:42:32.381+0100 [TRACE] ModuleInstaller: installing child modules for . into .terraform/modules 2026-08-21T15:42:32.381+0100 [TRACE] terraform.NewContext: starting 2026-08-21T15:42:32.381+0100 [TRACE] terraform.NewContext: complete 2026-08-21T15:42:32.381+0100 [TRACE] building graph for terraform dependencies 2026-08-21T15:42:32.381+0100 [TRACE] Executing graph transform *terraform.RootVariableTransformer 2026-08-21T15:42:32.381+0100 [TRACE] Executing graph transform *terraform.ModuleTransformer 2026-08-21T15:42:32.381+0100 [TRACE] ModuleTransformer: Added module.fixture as *terraform.nodeInstallModule 2026-08-21T15:42:32.381+0100 [TRACE] Executing graph transform *terraform.LocalTransformer 2026-08-21T15:42:32.381+0100 [TRACE] Executing graph transform *terraform.ReferenceTransformer 2026-08-21T15:42:32.381+0100 [DEBUG] ReferenceTransformer: "module.fixture" references: [] 2026-08-21T15:42:32.381+0100 [TRACE] Executing graph transform *terraform.TransformFilter 2026-08-21T15:42:32.381+0100 [TRACE] Executing graph transform *terraform.variableValidationTransformer 2026-08-21T15:42:32.381+0100 [TRACE] variableValidationTransformer: adding validation nodes for any existing variable evaluation nodes 2026-08-21T15:42:32.381+0100 [TRACE] Executing graph transform *terraform.RootTransformer 2026-08-21T15:42:32.381+0100 [TRACE] Executing graph transform *terraform.TransitiveReductionTransformer 2026-08-21T15:42:32.381+0100 [TRACE] Completed graph transform: module.fixture - *terraform.nodeInstallModule root - terraform.graphNodeRoot module.fixture - *terraform.nodeInstallModule ------ 2026-08-21T15:42:32.381+0100 [DEBUG] Starting graph walk: walkInit 2026-08-21T15:42:32.381+0100 [TRACE] vertex "module.fixture": starting visit (*terraform.nodeInstallModule) 2026-08-21T15:42:32.382+0100 [TRACE] vertex "module.fixture": belongs to 2026-08-21T15:42:32.382+0100 [DEBUG] Module installer: begin fixture 2026-08-21T15:42:37.383+0100 [TRACE] dag/walk: vertex "root" is waiting for "module.fixture" ``` Error: ``` [0m[1mInitializing the backend...[0m [0m[1mInitializing modules...[0m SIGQUIT: quit PC=0x18f26350c m=0 sigcode=0 goroutine 46 [runnable]: github.com/hashicorp/go-version.(*Version).bytes(0x0) github.com/hashicorp/go-version@v1.9.0/version.go:442 github.com/hashicorp/go-version.(*Version).String(...) github.com/hashicorp/go-version@v1.9.0/version.go:437 fmt.(*pp).handleMethods(...) fmt.(*pp).printArg(...) fmt.(*pp).doPrintf(...) log.Printf(...) github.com/hashicorp/terraform/internal/initwd.(*ModuleInstaller).moduleInstallWalker.func2(...) github.com/hashicorp/terraform/internal/initwd/module_install.go:284 github.com/hashicorp/terraform/internal/terraform.(*nodeInstallModule).Execute(...) ``` ### Expected Behavior A second `terraform init` should reuse the installed Git module and complete successfully. ### Actual Behavior The first initialization succeeds. The second initialization hangs after: ```shell Initializing the backend... Initializing modules... ``` ### Steps to Reproduce ```shell work="$(mktemp -d)" repo="$work/fixture-module.git" module="$work/module" root="$work/root" mkdir -p "$module" "$root" git init --bare "$repo" git -C "$module" init printf 'terraform {}\n' > "$module/main.tf" git -C "$module" add main.tf git -C "$module" -c user.name=fixture -c user.email=fixture@example.invalid commit -m fixture git -C "$module" remote add origin "file://$repo" git -C "$module" push origin HEAD:main printf 'module "fixture" {\n source = "git::file://%s"\n}\n' "$repo" > "$root/main.tf" terraform -chdir="$root" init -input=false terraform -chdir="$root" init -input=false ``` ### Additional Context Please take this with a grain of salt; while I'm a long time `terraform` user this is one of the few times I actually looked at the code. It seems like this might have been an issue for some time, but I only recently noticed it after upgrading to `terragrunt v1`. I'm not 100% sure of the mechanism that triggered the behavior, but seems to be tied to the new `.terragrunt-cache` directory. The module manifest generated by Terraform has no `Version` field for the `git::` source (I'm not sure this is to be expected for a non-registry module, or is a possible defect). I actually got around the problem in a local build by guarding the version check against `nil`, something like: ```go if record.Version != nil { log.Printf( "[TRACE] ModuleInstaller: Module installer: %s %s already installed in %s", key, record.Version, record.Dir, ) } else { log.Printf( "[TRACE] ModuleInstaller: Module installer: %s already installed in %s", key, record.Dir, ) } ``` Another way I found to bypass the problem is to run `terraform init -get=false` whenever I don't actually need provider refreshes. ### References _No response_ ### Generative AI / LLM assisted development? Investigation and local fix done manually, test config produced with Copilot.
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
BugZero Plan
Streamline upgrades with automated vendor bug scrubs
BugZero Prevent
Wish you caught this bug sooner? Get proactive today.