added error messages page and link fixes to a few pages

This commit is contained in:
trujillo-adam 2022-08-25 16:58:20 -07:00
parent 4fe9a5cc0c
commit 9018da0e6e
4 changed files with 87 additions and 2 deletions

View File

@ -0,0 +1,81 @@
---
layout: docs
page_title: Error Messages
description: >-
Look up Consul-Terraform-Sync error message to learn how to resolve potential issues using CTS.
---
# Error Messages
This topic explains error messages you may encounter when using Consul-Terraform-Sync (CTS).
## Example error log messages
If you configured the CTS cluster to run in [high availability mode](/docs/nia/usage/run-ha) and the the local module is missing, then the following message appears in the log:
```shell-session
[ERROR] ha.compat: error="compatibility check failure: stat ./example-module: no such file or directory"
```
The resolution is to create the missing local module on the incompatible CTS instance. Refer to the [`module` documentation](/docs/nia/configuration#module) in the CTS configuration reference for additional information.
## Example API and CLI error messages
In the following example response error:
* CTS can determine the leader.
* `high_availability.instance.address` is configured for the leader.
* The CTS instance you sent the request to is not the leader.
```json
{
"error": {
"message": "redirect requests to leader 'cts-01' at cts-01.example.com:8558"
}
}
```
The resolution is to redirect the request to the leader instance, for example:
```shell-session
$ curl --request GET cts-01.example.com:8558/v1/tasks
```
---
In the following example response error:
* CTS can determine the leader.
* The CTS instance you sent the request to is not the leader.
* `high_availability.instance.address` is not configured.
```json
{
"error": {
"message": "redirect requests to leader 'cts-01'"
}
}
```
The resolution is to identify the leader instance address and redirect the request to the leader. We recommend deploying a cluster that has three instances. You can query each instance until the leader responds.
---
In the following example response error:
* The CTS instance you sent the request to is not the leader.
* The CTS is unable to determine the leader.
* Note that these conditions are rare.
```json
{
"error": {
"message": "redirect requests to leader"
}
}
```
The resolution is to identify and send the request to the leader CTS instance. You can identify the leader by either making a call to the [`status` API endpoint](/docs/nia/api/status) or by checking the logs for the following entry:
```shell-session
[INFO] ha: acquired leadership lock: id=<ID-OF-CTS-INSTANCE>
```

View File

@ -89,7 +89,7 @@ The Terraform module for a task in CTS is the core component of the integration.
Working with a Terraform provider, you can write an integration task for CTS by [creating a Terraform module](/docs/nia/terraform-modules) that is compatible with the Terraform driver or use a module built by partners below.
Refer to [Configuration](/docs/nia/installation/configure) for information about configuring CTS and how to use Terraform providers and modules for tasks.
Refer to [Configuration](/docs/nia/configuration) for information about configuring CTS and how to use Terraform providers and modules for tasks.
### Partner Terraform Modules

View File

@ -84,7 +84,7 @@ If the `high_availability.cluster.storage.namespace` field is configured, then y
We recommend deploying a cluster that includes three CTS instances. This is so that the cluster has one leader and two followers.
1. Create an HCL configuration file that includes the settings you want to include, including the `high_availability` block. Refer to [Configuration Options for Consul-Terraform-Sync](/docs/nia/installation/configure) for all configuration options.
1. Create an HCL configuration file that includes the settings you want to include, including the `high_availability` block. Refer to [Configuration Options for Consul-Terraform-Sync](/docs/nia/configuration) for all configuration options.
1. Issue the startup command and pass the configuration file. Refer to the [`start` command reference](/docs/nia/cli/start#modes) for additional information about CTS startup modes.
```shell-session
$ consul-terraform-sync start -config-file ha-config.hcl

View File

@ -774,6 +774,10 @@
{
"title": "Run Consul-Terraform-Sync with High Availability",
"path": "nia/usage/run-ha"
},
{
"title": "Error Messages",
"path": "nia/usage/errors-ref"
}
]
},