Problem
Some customers may experience during the initial installation setup of Terraform Enterprise/TFE receiving an error in the GUI when attempting to initially start the services. The app may first get stuck at STARTING ... Waiting for app to report ready status and after some minutes go by the process may error out and display a message ERROR... Ready state command canceled: context deadline exceeded prohibiting the services from starting.
Cause
-
This behavior is symptomatic of the
hostnameparameter within the Terraform Enterprise/TFE application settings not configured with aFQDN or IPas TFE expects a resolvableFQDN or IP
-
The
hostnameparameter is sometimes missed or not configured correctly as part of the initial install
-
Addtional logging may suggest:
Replicated: Ready state command "http_status_code" failed, retrying in 2s...: Get "http://$IP/_health_check": dial tcp :80: connect: connection refused Rabbitmq container: dial tcp $IP: connect: connection refused - Validate the hostname by running
$replicatedctl app-config export --template '{{.hostname.Value}}' - Check if the hostname is resolvable
For Terraform Enterprise$docker exec -it ptfe_atlas nslookup $(replicatedctl app-config export --template '{{.hostname.Value}}')v202205-1or later:$docker exec -it tfe-atlas nslookup $(replicatedctl app-config export --template '{{.hostname.Value}}')
Solutions
Ensure a resolvable FQDN or IP is configured in the TFE hostname parameter setting. Updating the hostname configuration with a resolvable FQDN or IP can be conducted within the GUI or from the command line and requires restarting the Terraform Enterprise Application:
-
Solution 1 (GUI)
-
Configure the
FQDN hostname or IPinhttps://TFE_HOSTNAME_OR_IP:8800/settings#hostnameand save the changes -
Restart the application at
https://TFE_HOSTNAME_OR_IP:8800/dashboard
-
Configure the
-
Solution 2 (Command line)
-
Connect to the TFE instance using a protocol such as
ssh - Review the current hostname configuration by running
$replicatedctl app-config export --template '{{.hostname.Value}}' -
To set the
hostnameparameter execute$replicatedctl app-config set hostname --value="$FQDN or $IP" -
Verify the
hostnameparameter was set successfully withreplicatedctl app-config export --template '{{.hostname.Value}}' - Restart the TFE application
$replicatedctl app stop-
$replicatedctl app status(to ensure the app is in a stopped state) $replicatedctl app start
-
Connect to the TFE instance using a protocol such as
Outcome
Once the hostname is defined accordingly the TFE application should fully start its services and relevant containers as seen here during the process https://TFE_HOSTNAME_OR_IP:8800/dashboard
Additional Information
-
- For additional assistance please contact HashiCorp Support to request additional assistance.