Problem
Terraform Enterprise becomes unhealthy or unusable, exhibiting symptoms such as poor application performance, a slow user interface (UI), or failing runs with configuration version errors. These issues may occur suddenly without any recent configuration changes.
Cause
The underlying cause is insufficient disk space on the host machine, specifically within the Docker environment. Terraform Enterprise uses Docker volumes for its containers, and these volumes can grow excessively, consuming all available disk space.
To confirm that the issue is related to disk space, check the system journal for relevant error messages.
$ journalctl | grep 'no space left on device'
If this command returns multiple entries indicating a lack of space, the Docker volumes are the likely cause.
Solution
To resolve this issue, you must reclaim disk space by pruning unused Docker objects, including volumes.
Run the
docker system prunecommand with the--volumesflag to remove all unused containers, networks, images, and volumes.$ docker system prune --volumes
- Confirm the action when prompted by Docker.
Important Considerations
If you use a custom build worker image, the prune command may delete it. You must restart Terraform Enterprise after pruning to reload a fresh copy of the image.
Additional Information
For more details on managing the Terraform Enterprise operational environment, refer to the official Terraform Enterprise documentation. For information on the docker system prune command, consult the official Docker documentation.