Introduction
Problem
During a Terraform run, you're seeing the following error regarding a read-only file system issue on your Terraform Enterprise FDO Podman.
[ERROR] terraform:
Failed handling run: error="operation failed: failed fetching Terraform: failed downloading terraform: failed downloading "https://releases.hashicorp.com/terraform/1.3.5/terraform_1.3.5_linux_amd64.zip": GET "https://releases.hashicorp.com/terraform/1.3.5/terraform_1.3.5_linux_amd64.zip": giving up after 5 attempt(s):
failed making temp file: open /tmp/terraform/aefsdafdsfasfsadfasfasfafaf8d5.download-f8fsdfdsfasdfsafasdfasffa4:
read-only file system
Prerequisites
- Using Terraform Enterprise FDO Podman
Cause
The following settings in tfe.yaml configuration file for Podman maybe misconfigured:
- The environment variable called
TFE_DISK_CACHE_VOLUME_NAME
is missing or not pointing to a valid volume.
- The volume mount below is missing or is not pointing to a valid volume
- mountPath: "/var/cache/tfe-task-worker/terraform"
name: "terraform-enterprise_terraform-enterprise-cache-pvc" - The volume below is missing or is not correct
- name: "terraform-enterprise_terraform-enterprise-cache-pvc"
persistentVolumeClaim:
claimName: "terraform-enterprise_terraform-enterprise-cache"
Solution:
Verify that the tfe.yaml matches the example configurations shared from the Deploy Terraform Enterprise to Podman documentation.
Below is the code example specific to the CACHE setting.
---
apiVersion: "v1"
kind: "Pod"
metadata:
labels:
app: "terraform-enterprise"
name: "terraform-enterprise"
spec:
restartPolicy: "Never"
containers:
- env: - name: "TFE_DISK_CACHE_VOLUME_NAME"
value: "terraform-enterprise_terraform-enterprise-cache" ... volumeMounts: - mountPath: "/var/cache/tfe-task-worker/terraform"
name: "terraform-enterprise_terraform-enterprise-cache-pvc"
... volumes:
- name: "terraform-enterprise_terraform-enterprise-cache-pvc" persistentVolumeClaim:
claimName: "terraform-enterprise_terraform-enterprise-cache"
Outcome
After a restart of Terraform Enterprise the issue should be resolved.