Problem
When starting Terraform Enterprise with Flexible Deployment Options (FDO), the application fails with a database timeout error during its startup checks. The log output includes the following errors:
==> /var/log/terraform-enterprise/terraform-enterprise.log <== ... [ERROR] terraform-enterprise: check failed: name=database duration=1m0.001926008s err=timeout ... [ERROR] terraform-enterprise: the following startup checks failed: checks=["database"] [ERROR] terraform-enterprise: startup: error="startup checks failed"
Cause
This error occurs because the database name specified in the TFE_DATABASE_NAME configuration value does not exist in the external PostgreSQL instance. The Terraform Enterprise application requires this database to exist before the application's first launch.
Solution
To resolve this issue, you must manually create the required database within your external PostgreSQL instance before starting the Terraform Enterprise application.
- Connect to your PostgreSQL instance.
- Create the database with the same name you configured for
TFE_DATABASE_NAME. - Attempt to start the Terraform Enterprise application again.
Additional Information
For more details on configuring external services for Terraform Enterprise, please refer to the official documentation on external service requirements.