We often encounter situations where a Vault user has made a typographical error in their server startup configuration file. When Vault has trouble parsing the configuration, the errors presented can sometimes be cryptic. This is one such common scenario.
Problem
Vault has been given the following configuration with which to start:
storage "consul" {
address = "consul.example.com:8500"
path = "vault"
}
listener "tcp" {
address = "127.0.0.1:8200"
cluster_address = "127.0.0.1:8201"
tls_disable = 1
}
log_level = info
ui = true
Vault will not start, throwing the error:
error loading configuration from vault.hcl: At 12:13: Unknown token: 12:13 IDENT info
Prerequisites (if applicable)
- Any version of Vault capable of parsing HCL-formatted configuration files
Cause
The error above tells us two things that are wrong about the configuration file.
- There is an issue at line 12, character 13 of the configuration file, `12:13`
- Vault was unable to identify a token specified at this position.
Overview of possible solutions (if applicable)
Solutions:
The issue at line 12, character 13 is the word `info`. Vault expects a quoted string for the log_level instead of a bare word. Here is the fix:
log_level = info
---
log_level = "info"
Outcome
After quoting the string `info`, Vault is able to start.