Resolving OpenTofu/Terraform init timeouts when using Terraspace

Last updated: December 19, 2025

If you're experiencing timeouts during tofu init or terraform init when using Terraspace as your orchestrator, this issue may be related to Terraspace's log level configuration and buffer settings.

Symptoms

  • Timeouts during tofu init or terraform init commands

  • Error message: "It took too long to run terraform init"

  • Exception: "NameError: uninitialized constant Terraspace::Terraform::Args::Default"

  • Terraspace appears to hang during initialization

Root Cause

This issue occurs when Terraspace's log level is set to debug, which can cause excessive output that overwhelms Terraspace's buffer system. When OpenTofu/Terraform generates large volumes of debug output, it can cause a deadlock where Terraspace "hangs" while trying to process the output stream.

Solution

Change your Terraspace log level from debug back to info:

  1. Locate your Terraspace configuration file

  2. Change the log level setting from debug to info

  3. Re-run your Terraspace commands

Alternative Solution

If you need to keep debug logging enabled, you can adjust the TS_BUFFER_BLOCK_SIZE environment variable to handle larger volumes of output:

Set TS_BUFFER_BLOCK_SIZE to a higher value to prevent deadlocks when processing large amounts of debug output. Terraspace uses IO#read_nonblock to stream output from OpenTofu/Terraform commands, and increasing this buffer size can help handle excessive debug output.

Additional Notes

This issue is specific to how Terraspace handles output buffering from OpenTofu/Terraform child processes. The problem occurs because Terraspace redirects command output to log files, which can create bottlenecks when processing large volumes of debug information.

For more information about this known limitation, see the related Terraspace GitHub issues and documentation on buffer configuration.