Problem
Terraform Enterprise is failing to install due to a failed disk check. Executing docker logs <container ID>
reveals a similar error below in the logs.
[ERROR] terraform-enterprise: check failed: name=disk duration=\"355.554µs\"
err=\"open /var/lib/terraform-enterprise/checkdisk: read-only file system\"",
"component":"terraform-enterprise"}
Prerequisites
- Terraform Enterprise Flexible Deployment Option (FDO)
- Docker
- Mounted Disk install
Cause
- To ensure proper functionality, Terraform Enterprise conducts a read/write disk check on the
/var/lib/terraform-enterprise
directory defined in thecompose.yaml
file. This test will fail if Terraform does not have a target directory of/var/lib/terraform-enterprise
defined in thecompose.yaml
file. -
The problem here is mounting is not occurring for
/var/lib/terraform-enterprise
instead, mounting is performed for the sub-paths for/var/lib/terraform-enterprise/postgres
and/var/lib/terraform-enterprise/archivist
. TFE doesn't expect that, which is why the check fails. Terraform Enterprise expects the whole disk path to be writable, not just sub-paths for various internal services - In the example compose.yaml file, the volume excerpt below does not have the target path
/var/lib/terraform-enterprise
defined, resulting in the disk check failing.- compose.yaml
-
- type: bind
source: /opt/tfe/postgres/pgdata
target: /var/lib/terraform-enterprise/postgres
- type: bind
source: /opt/tfe/aux/archivist
target: /var/lib/terraform-enterprise/archivist
Overview of possible solutions
Solutions:
-
Provide a volume bind configuration for the file path /var/lib/terraform
-
- type: bind
source: <mounted_disk_path_on_host>
target: /var/lib/terraform-enterprise
-
Outcome
Terraform Enterprise Flexible Deployment Option should pass the disk check