Introduction
Consul-Terraform-Sync (CTS) is a Consul Enterprise feature, that is a service-oriented tool for managing network infrastructure automation in near real-time. CTS runs as a daemon and integrates the network topology maintained by your Consul cluster with your network infrastructure to dynamically secure and connect services.
When CTS first starts up it is expected that all tasks will succeed on the initial run, however, any subsequent failures will not cause CTS to crash.
Problem
When starting the CTS application, it crashes during the initial boot. Below is an example of the output that might be observed in the logs:
[ERROR] driver.tfc: The Terraform run has errored.
[ERROR] tasksmanager: error applying task: task_name=cts-test-task error="unexpected run status for workspace xxxxxxxx: run-xxxxxxxxx errored"
[ERROR] cli: error running controller: error="unexpected run status for workspace xxxxxxxx: run-xxxxxxxxx errored"
[ERROR] cli: unexpected shutdown: error=<nil>
This output indicates that the initial run of CTS failed when attempting to run the custom task named cts-test-task
, which caused the CTS application to shutdown unexpectedly. An inspection of the log states that there was an error in applying the task and it caused the application to fail in this instance. In this example, cts-test-task
was configured to access a resource that didn't exist.
Cause
-
Misconfigured task
-
Missing resources, that CTS expects
Solutions:
To resolve this issue with CTS crashing, review the log lines to identify which task caused the application to crash. Once the task has been identified, please make sure that the task is configured properly and that all expected resources by CTS are currently active.
- The proper configuration of CTS can be found in the Automate your network configuration with Consul-Terraform-Sync tutorial.
- Additional configuration information can be found in the Consul-Terraform-Sync Configuration documentation.
Outcome
CTS will start up as expected and continue to run. If further issues persist, please consider reaching out to our online community or if your company has an active support package, open a ticket with HashiCorp support.