Search code examples
tokenwarningsttlconsul-template

consul-template: [WARN] vault.token: TTL of xxyyzz exceeded the effective max_ttl of xxyyzz; TTL value is capped accordingly


The problem of unresponsive consul-template occurs while querying a set of keys. The vault and consul tokens are valid and still 'vault.token' has a TTL expiry warning. After the warning, all the key lookups get an HTTP 504.


Solution

  • During consul-template execution, I got the following error:

    [WARN] vault.token: TTL of "768h0m0s" exceeded the effective max_ttl 
    of "750h45m48s"; TTL value is capped accordingly
    

    The vault and consul tokens had enough TTL left and hence there was no problem with tokens.

    The problem lied with the template. The behavior of consul-template was “If a token read is failed, consul would just throw TTL warning and HTTP error code 504”.

    The solution is to review the template file and make sure that all requested consul reads of key names match with keys in consul.