Problem
During the initial setup of Terraform Enterprise, the application may fail to start. The admin console UI may display a STARTING ... Waiting for app to report ready status message, which then fails with the error: ERROR... Ready state command canceled: context deadline exceeded.
This error prevents the Terraform Enterprise services from starting successfully.
Cause
This error typically occurs when the hostname parameter in the Terraform Enterprise application settings is not configured with a fully qualified domain name (FQDN) or IP address that is resolvable by the instance itself.
Additional logs may show connection refused errors.
For the Replicated container, you may see the following output.
Ready state command "http_status_code" failed, retrying in 2s...: Get "http://$IP/_health_check": dial tcp :80: connect: connection refused
For the RabbitMQ container, you may see the following output.
dial tcp $IP: connect: connection refused
Verify the Cause
Check the current hostname configuration. Run the following command.
$ replicatedctl app-config export --template '{{.hostname.Value}}'Verify that the configured hostname is resolvable from within the primary application container.
For Terraform Enterprise
v202205-1and later, run the following command.$ docker exec -it tfe-atlas nslookup $(replicatedctl app-config export --template '{{.hostname.Value}}')For older versions, run the following command.
$ docker exec -it ptfe_atlas nslookup $(replicatedctl app-config export --template '{{.hostname.Value}}')
Solutions
To resolve this issue, you must update the hostname configuration with a resolvable FQDN or IP address. You can perform this update through the admin console UI or from the command line. A restart of the Terraform Enterprise application is required after applying the change.
Solution 1: Configure the Hostname in the Admin Console (GUI)
- Navigate to the admin console settings page at
https://<TFE_HOSTNAME_OR_IP>:8800/settings#hostname. - Enter a resolvable FQDN or IP address in the Hostname field.
- Click Save & continue to apply the changes.
- When prompted, restart the application from the dashboard at
https://<TFE_HOSTNAME_OR_IP>:8800/dashboard.
Solution 2: Configure the Hostname from the Command Line (CLI)
- Connect to the Terraform Enterprise instance using a secure shell (SSH) connection.
Set the
hostnameparameter to a resolvable FQDN or IP address. Replace<FQDN_OR_IP>with the correct value.$ replicatedctl app-config set hostname --value="<FQDN_OR_IP>"
Verify that the
hostnameparameter was set successfully.$ replicatedctl app-config export --template '{{.hostname.Value}}'Restart the Terraform Enterprise application to apply the new configuration.
## Stop the application $ replicatedctl app stop ## Verify the application is stopped $ replicatedctl app status ## Start the application $ replicatedctl app start
Outcome
After you configure the hostname with a resolvable value and restart the application, all Terraform Enterprise services and containers should start successfully. You can monitor the startup process in the admin console dashboard at https://<TFE_HOSTNAME_OR_IP>:8800/dashboard.