Introduction
TFE fails to start with Ready state command canceled: context deadline exceeded
After upgrade or on fresh installation (mounted disk installation)
Problem
When checking TFE-enterprise logs or support bundle
[ERROR] terraform-enterprise: check failed: name=disk duration=\"92.452µs\" err=\"open /opt/terraform-enterprise/data/checkdisk: permission denied\"","component":"terraform-enterprise"}
Cause
- Wrong file system permissions preventing to create
checkdisk
on/xxx/terraform-enterprise/data/
- In working installation Files permissions on this directory needs to be as following
drwxr-xr-x 6 root root 4096 Mar 12 12:14 .
drwxr-xr-x 4 root root 4096 Mar 12 12:09 ..
drwxr-xr-x 3 root root 4096 Mar 12 09:31 aux
drwxr-xr-x 2 root root 6 Mar 12 12:07 data
drwxr-xr-x 3 root root 4096 Mar 12 12:13 postgres
drwxr-xr-x 2 root root 4096 Mar 12 12:13 postgres-backup
- In case of having non-root user and needs to test the profile of that user working properly or missing any permissions
1. connect toterraform-enterprise
containerdocker exec -it terraform-enterprise bash
terraform-enterprise@xxx:/opt/terraform-enterprise/data$ ls -al
2. try to create file at this directory
total 20
drwxrwxr-x 6 root root 4096 Mar 12 10:20 .
drwxr-xr-x 3 root root 18 Mar 12 10:07 ..
drwxrwxr-x 3 root root 4096 Mar 12 09:31 aux
drwxrwxr-x 2 root root 6 Mar 7 12:07 data
drwxrwxr-x 3 root root 4096 Mar 12 12:13 postgres
drwxrwxr-x 2 root root 4096 Mar 12 12:13 postgres-backuptouch test
if getting permissions errortouch test
then directories permissions/TFE user role are missing
touch: cannot touch 'test' : Permission denied
Overview of possible solutions (if applicable)
Solutions:
-
needs to review files permissions on the install-path or role assigned for the non-root user
Outcome
After fixing the permissions TFE starts normally