Terraform Enterprise Fails to Start with a Container Failure
Problem
Terraform Enterprise fails to start. The Replicated UI reports a generic container failure message, similar to the following example.
Container <tfe-container-name> failed:
An example of a specific failure message may be:
Container tfe-postgresql-setup failed: Timeout waiting for event "Postgres setup"
Cause
The startup failure is caused by an issue within the specific container identified in the error message. The Replicated UI does not display the detailed logs, which are necessary to diagnose the root cause.
Solution
To investigate the failure, you must inspect the logs of the failed container directly using the docker logs command.
- Identify the name of the failed container from the error message in the Replicated UI. In the example above, the container name is
tfe-postgresql-setup. Retrieve the logs for that container. Replace
<tfe-container-name>with the actual container name.$ docker logs <tfe-container-name>
Outcome
The command output provides detailed logs that can help identify the root cause of the failure.
For example, running the command for the tfe-postgresql-setup container may produce the following output.
$ docker logs tfe-postgresql-setup
Is the server running on that host and accepting TCP/IP connections? psql: error: connection to server at "tfe-postgresql.example.com" (10.0.0.10), port 5432 failed: Connection refused
In this example, the logs indicate that Terraform Enterprise cannot connect to the external PostgreSQL database because the connection was refused. This suggests a networking issue or that the database server is unavailable. The actionable information from the logs allows you to begin troubleshooting the database connectivity.
Different container failures will produce different log outputs, but the logs should provide the necessary information to diagnose and resolve the issue.