Problem
The TFE (Terraform Enterprise) application will not start up. The Replicated console will exhibit starting while toggle "waiting on components to start" then ultimately fail displaying an error "Container ptfe_postgresql_setup failed: Timeout waiting for event Postgres setup"
Running replicatedctl app status
from the command line on the TFE server may also display the error.
Cause
- The ptfe-postgresql-setup container logs show:
psql: error: could not translate host name "tfe-postgres" to address: Name or service not known
- This error suggests the database server name that was configured within TFE is not resolvable from the TFE server. TFE expects a resolvable IP or fully qualified domain name (FQDN) for the Postgres Database server
Solutions:
-
Ensure the database name and port that were configured in the TFE server are correct, for example, if it's an Relational Database (RDS) in Amazon Web Services (AWS) you can qualify the endpoint and port from the AWS console under RDS -> Databases -> Connectivity & security -> Endpoint and Port
- If necessary, updating the TFE server with the correct FQDN of the Database server would take place at https://$TFE-URL:8800/settings under the PostgreSQL Configuration section
-
If the Postgres server and port are correct, from the TFE server test the connectivity to the Postgres server that is listed in the error message. In the examples below, replace $tfe-postres with the IP or FQDN of the Postgres server
-
nc -vz $tfe-postgres 5432
nslookup $tfe-postgres
-
Outcome
Once the TFE server can resolve the FQDN of the Database server, the TFE components should start and the application will be available
Additional Information
- For additional assistance please contact HashiCorp Support.