Introduction
This article addresses a specific error that can occur when you generate a support bundle in Terraform Enterprise (TFE), even when the host machine appears to have sufficient overall disk space.
The Problem
When attempting to create a support bundle, the process fails with an error message similar to this:
error executing command: error=error processing support bundle job: error preparing directory for support bundle: error verifying available disk space: not enough space in /run/terraform-enterprise/support-bundles/... for support bundle
Prerequisites
A running instance of TFE on FDO deployment.
Access to the TFE application host to modify configuration files and run commands.
Cause
TFE performs a pre-flight check before generating a support bundle to ensure there is enough temporary space. Here is how that process works:
Size Estimation: TFE measures the size of your existing application logs located in
/var/log/terraform-enterprise.Space Verification: It checks if this estimated space is available in the temporary staging directory, located under
/runinside the container.Tmpfs Limitation: In most containerized deployments, the
/rundirectory is mounted as atmpfs(temporary file storage system) that resides in RAM. By default,tmpfsis often limited to 50% of the host's RAM.
The error occurs when the log directory is larger than the available space in the memory-backed /run directory. Even if you use external object storage, this local staging step is still required.
Solutions
Solution 1: Reduce Log Directory Size
This is the quickest fix. By cleaning up old log files, you reduce the estimated size required, allowing the pre-flight check to pass.
-
Access the container:
docker exec -it <tfe_container_name> /bin/bash -
Check log size:
sudo du -sh /var/log/terraform-enterprise -
Check available space in /run:
df -h /run -
Delete old logs (e.g., older than 14 days):
Note:
The-mtime 14parameter used in this examples is for illustrative purposes. If your investigation requires a broader timeframe, adjust this value accordingly. If you do not have external backup, consider archiving logs to a secondary location before permanent deletion. For future, you can also utilize orchestration engine based log rotation mechanisms to automate.find /var/log/terraform-enterprise -type f -mtime +14 -name '*.log' -delete Verify: Re-run the
ducommand and attempt to generate the bundle again.
Solution 2: Increase the Tmpfs Size for /run
If you need to keep your logs, you can increase the memory allocated to the /run directory.
a. For Docker Compose
Update your docker-compose.yml to include a specific size for the tmpfs mount:
services:
terraform-enterprise:
# ... other configuration ...
tmpfs:
- /tmp:mode=01777
- /run:size=12Gi # Adjust this value as neededRestart TFE with docker-compose up -d to apply.
b. For Kubernetes or Podman
Update your deployment.yaml to include a sizeLimit on the run volume:
spec:
volumes:
- name: run
emptyDir:
medium: Memory
sizeLimit: 12Gi # Adjust as needed
Apply the manifest with kubectl apply -f your-manifest.yaml.
Solution 3: Switch /run to a Disk-Backed Volume
If logs are exceptionally large or memory is constrained, you can move /run from RAM to the actual disk.
Modify Configuration: Remove the
/runentry fromtmpfs(Docker) oremptyDir(Kubernetes).Add a Volume Mount: Map a directory on the host to the container's
/run.
Docker Compose Example:
Note: Depending on your underlying storage I/O capabilities, moving `/run` from memory to disk may incur performance overhead.
services:
terraform-enterprise:
volumes:
- /path/on/host/tfe-run:/run
Outcome
After applying one of these solutions, the support bundle generation should complete successfully. You can verify this in the TFE user interface, where the status will change to Completed and the file will be available for download.