Problem
When using an HCP Terraform agent for a run, the operation fails during the Terraform unpacking phase with an input/output error. The user interface or logs display an error message similar to the following:
Operation failed: failed unpacking Terraform: failed unpacking file "LICENSE.txt": sync /home/tfc-agent/.tfc-agent/component/terraform/runs/run-xXXXXxxXxXxxXxx/bin/LICENSE.txt: input/output error
Prerequisites
- HCP Terraform configured to use self-hosted agents (agent execution mode).
Cause
This error typically indicates that the host machine running the HCP Terraform agent has insufficient disk space. The agent needs to download and unpack the Terraform binary for each run, and a lack of available space prevents files like LICENSE.txt from being written to disk, resulting in an I/O error.
Solution
To resolve this issue, you must ensure the agent's host machine meets the minimum system requirements, specifically regarding available disk space.
- Connect to the host machine where the HCP Terraform agent is running.
- Verify that the machine has sufficient free resources. According to the HCP Terraform agent hardware requirements, the host must have at least:
- 4 GB of free disk space.
- 2 GB of system memory.
- Free up disk space or provision a larger volume for the agent host if the requirements are not met.
Outcome
After ensuring the agent host has adequate disk space and memory, subsequent HCP Terraform runs should complete without the unpacking error.