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. Most likely the key is nt present in consul or vault.
Written with StackEdit.