Skip to content

Terraform Stacks - Local paths have to be root level #38005

@Gerruhtz

Description

@Gerruhtz

Terraform Version

1.14.2

Terraform Configuration Files

component "virtual-machine" {
  source = "../../modules/vm"
  inputs = {
    servers      = 1
    env          = var.env
    hostname     = "test"
    vm_id        = 900
    cpu_cores    = 1
    memory       = 1024
    distribution = "ubuntu"
    release      = "noble"
    disk_size    = 20
  }
  providers = {
    proxmox           = provider.proxmox.this
    bitwarden-secrets = provider.bitwarden-secrets.this
  }
}

--- 

component "virtual-machine" {
  source = "./vm"
  inputs = {
    servers      = 1
    env          = var.env
    hostname     = "test"
    vm_id        = 900
    cpu_cores    = 1
    memory       = 1024
    distribution = "ubuntu"
    release      = "noble"
    disk_size    = 20
  }
  providers = {
    proxmox           = provider.proxmox.this
    bitwarden-secrets = provider.bitwarden-secrets.this
  }
}

Debug Output

2025-12-12T09:47:58.081+0100 [INFO]  Terraform version: 1.14.2
2025-12-12T09:47:58.081+0100 [DEBUG] using github.com/hashicorp/go-tfe v1.94.0
2025-12-12T09:47:58.081+0100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.24.0
2025-12-12T09:47:58.081+0100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2025-12-12T09:47:58.081+0100 [DEBUG] using github.com/zclconf/go-cty v1.16.3
2025-12-12T09:47:58.081+0100 [INFO]  Go runtime version: go1.25.5
2025-12-12T09:47:58.081+0100 [INFO]  CLI args: []string{"terraform", "stacks", "init"}
2025-12-12T09:47:58.081+0100 [TRACE] Stdout is a terminal of width 237
2025-12-12T09:47:58.081+0100 [TRACE] Stderr is a terminal of width 237
2025-12-12T09:47:58.081+0100 [TRACE] Stdin is a terminal
2025-12-12T09:47:58.081+0100 [DEBUG] Attempting to open CLI config file: 
2025-12-12T09:47:58.081+0100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2025-12-12T09:47:58.081+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2025-12-12T09:47:58.081+0100 [DEBUG] ignoring non-existing provider search directory 
2025-12-12T09:47:58.081+0100 [DEBUG] ignoring non-existing provider search directory 
2025-12-12T09:47:58.081+0100 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2025-12-12T09:47:58.082+0100 [INFO]  CLI command args: []string{"stacks", "init"}
2025-12-12T09:47:58.082+0100 [TRACE] stacksplugin hostname not set, falling back to "app.terraform.io"
2025-12-12T09:47:58.082+0100 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
2025-12-12T09:47:58.478+0100 [TRACE] No stacksplugin cache path store at '.terraform/.stackspluginpath`, using default '/.terraform.d/stacksplugin'
2025-12-12T09:47:58.478+0100 [TRACE] stacksplugin cache directory found at "/.terraform.d/stacksplugin"
2025-12-12T09:47:58.479+0100 [TRACE] stacksplugin manifest cache found for host "app.terraform.io"
2025-12-12T09:47:58.479+0100 [DEBUG] performing request: method=GET url=https://app.terraform.io/stacksplugin.v1/manifest.json
2025-12-12T09:47:58.479+0100 [TRACE] HTTP client GET request to https://app.terraform.io/stacksplugin.v1/manifest.json
2025-12-12T09:47:58.867+0100 [TRACE] wrote stacksplugin manifest cache to "/.terraform.d/stacksplugin/app.terraform.io/manifest.json"
2025-12-12T09:47:58.867+0100 [TRACE] checking for stacksplugin archive for darwin_arm64. Supported architectures: [darwin_amd64 darwin_arm64 freebsd_386 freebsd_amd64 freebsd_amd linux_386 linux_amd64 linux_arm linux_arm64 netbsd_386 netbsd_amd64 netbsd_arm openbsd_386 openbsd_amd64 openbsd_arm solaris_amd64 windows_386 windows_amd64]
2025-12-12T09:47:58.868+0100 [TRACE] plugin "1.1.1" binary located at "/.terraform.d/stacksplugin/bin/darwin_arm64/tfstacks" (resolved from cache)
2025-12-12T09:47:58.868+0100 [DEBUG] created stacks logger: level=trace
2025-12-12T09:47:58.868+0100 [DEBUG] stacks: starting plugin: path=/.terraform.d/stacksplugin/bin/darwin_arm64/tfstacks args=["/.terraform.d/stacksplugin/bin/darwin_arm64/tfstacks"]
2025-12-12T09:47:58.873+0100 [DEBUG] stacks: plugin started: path=/.terraform.d/stacksplugin/bin/darwin_arm64/tfstacks pid=70598
2025-12-12T09:47:58.873+0100 [DEBUG] stacks: waiting for RPC address: plugin=/.terraform.d/stacksplugin/bin/darwin_arm64/tfstacks
2025-12-12T09:47:58.894+0100 [DEBUG] stacks: using plugin: version=1
2025-12-12T09:47:58.894+0100 [DEBUG] stacks.tfstacks: plugin address: address=/var/folders/6q/pkdcx5f97wj5hn4b5dms9j480000gn/T/plugin1075467194 network=unix timestamp="2025-12-12T09:47:58.894+0100"
2025-12-12T09:47:58.896+0100 [TRACE] stacks.stdio: waiting for stdio data
2025-12-12T09:47:58.898+0100 [TRACE] stacks.tfstacks: Plugin Execute with args [init]: timestamp="2025-12-12T09:47:58.898+0100"
2025-12-12T09:47:59.298+0100 [TRACE] stacks.tfstacks: sending command response to stderr: "\x1b[31m╷\x1b[0m\n\x1b[31m│\x1b[0m \x1b[31m\x1b[1mError: \x1b[0m\x1b[1mFailed to read configuration directory\x1b[0m\n\x1b[31m│\x1b[0m\n\x1b[31m│\x1b[0m Could not open configuration directory ../vm: readdir ../vm: invalid argument.\n\x1b[31m╵\x1b[0m": timestamp="2025-12-12T09:47:59.298+0100"
2025-12-12T09:47:59.298+0100 [TRACE] stacks.tfstacks: sending command response to stderr: "\n": timestamp="2025-12-12T09:47:59.298+0100"
2025-12-12T09:47:59.299+0100 [TRACE] stacks.tfstacks: sending command response to stdout: "\x1b[31m\x1b[1mFailure!\x1b[0m Could not initialize configuration.": timestamp="2025-12-12T09:47:59.298+0100"
2025-12-12T09:47:59.299+0100 [TRACE] stacks.tfstacks: sending command response to stdout: "\n": timestamp="2025-12-12T09:47:59.298+0100"
2025-12-12T09:47:59.299+0100 [TRACE] stacks.tfstacks: Plugin Execute sending ExitCode 1: timestamp="2025-12-12T09:47:59.298+0100"
2025-12-12T09:47:59.299+0100 [INFO]  stacks.tfstacks: Context cancelled, initiating graceful shutdown: timestamp="2025-12-12T09:47:59.298+0100"
╷
│ Error: Failed to read configuration directory
│
│ Could not open configuration directory ../vm: readdir ../vm: invalid argument.
╵
Failure! Could not initialize configuration.
2025-12-12T09:47:59.299+0100 [TRACE] received exit code: 1
2025-12-12T09:47:59.300+0100 [DEBUG] stacks.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2025-12-12T09:47:59.303+0100 [INFO]  stacks: plugin process exited: plugin=/.terraform.d/stacksplugin/bin/darwin_arm64/tfstacks id=70598
2025-12-12T09:47:59.303+0100 [DEBUG] stacks: plugin exited

Expected Behavior

Documentation says that the component block accepts the same module sources as traditional modules. https://developer.hashicorp.com/terraform/language/block/stack/tfcomponent/component#source

Actual Behavior

Running 'terraform stacks init' results in a crash where it can't read the module directory.

Steps to Reproduce

  1. 'terraform stacks init'

Additional Context

Running on MacOS Tahoe 26.1

References

No response

Generative AI / LLM assisted development?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugnewnew issue not yet triagedstacksRelating to the Stacks features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions