You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have an upstream Vault Enterprise deployment that implements namespaces.
I create a namespace /apps/myapp and create a transit secret engine within that namespace.
I created auto-unseal keys within the transit secret engine that I intend to use to auto-unseal a downstream Vault opensource cluster.
If I use the token field in the seal stanza - everything works fine as expected.
However, if I use the VAULT_TOKEN environment variable instead, the first node in the cluster auto-unseals ok using vault operater init but the other peer nodes cannot join the raft cluster due to this error:
2024-12-20T10:40:09.426Z [ERROR] core: failed to get raft challenge: leader_addr=https://vault-os-1.*****.*****.co.uk:8200
error=
| error during raft bootstrap init call: Error making API request.
|
| URL: PUT https://vault-os-1.*****.*****.co.uk:8200/v1/sys/storage/raft/bootstrap/challenge
| Code: 500. Errors:
|
| * error performing token check: failed to look up namespace from the token: no namespace
Tested on Vault opensource 1.17.2 and 1.18.3
To Reproduce
Steps to reproduce the behavior:
Have upstream Vault Enteprise cluster that implements namespaces.
Within a test namespace on the upstream cluster, create unseal policy and a periodic orphaned token as described in hashicorp docs linked above.
Expected behavior
After running vault operator init on the first node of the cluster, the other Raft nodes should join the cluster due to the retry_join in the configuration.
In a working environment, the output of vault operator raft list-peers should show the 3 nodes:
Describe the bug
I have an upstream Vault Enterprise deployment that implements namespaces.
I create a namespace
/apps/myapp
and create a transit secret engine within that namespace.I created auto-unseal keys within the transit secret engine that I intend to use to auto-unseal a downstream Vault opensource cluster.
Policy is applied and periodic orphan token generated as per process described at:
Auto-unseal Vault using transit secrets engine | Vault | HashiCorp Developer
On my downstream Vault Opensource cluster, I add the
seal
stanza as described in the docs. The docs state that I can either:token
field in theseal
stanza.VAULT_TOKEN
environment variable.https://developer.hashicorp.com/vault/docs/configuration/seal/transit#token
token (string: ): The Vault token to use. This may also be specified by the VAULT_TOKEN environment variable.
If I use the
token
field in theseal
stanza - everything works fine as expected.However, if I use the
VAULT_TOKEN
environment variable instead, the first node in the cluster auto-unseals ok usingvault operater init
but the other peer nodes cannot join the raft cluster due to this error:Tested on Vault opensource 1.17.2 and 1.18.3
To Reproduce
Steps to reproduce the behavior:
vault.hcl
shown below./etc/vault.d/vault.env
set valueVAULT_TOKEN=<token>
VAULT_ADDR
as normal, then runvault operator init
. The vault will unseal and you will be presented with Recovery keys and root token.Expected behavior
After running
vault operator init
on the first node of the cluster, the other Raft nodes should join the cluster due to theretry_join
in the configuration.In a working environment, the output of
vault operator raft list-peers
should show the 3 nodes:Environment:
Vault Server Version (retrieve with
vault status
): 1.18.3Vault CLI Version (retrieve with
vault version
): Vault v1.18.3 (7ae4eca), built 2024-12-16T14:00:53ZServer Operating System/Architecture: Tested on Ubuntu 22.04 and OEL 9u5
Vault with HAProxy layer 4 loadbalancer in front which has frontend on port 443 and backend on port 8200.
Vault server configuration file(s):
Additional context
If I set the token directly in the
vault.hcl
file like below, everything works correctly.The problem seems to be the
VAULT_TOKEN
in thevault.env
file is either not respected, or is interfering with the Raft challenge workflow.The
vault.env
file is loaded with the systemd service:The text was updated successfully, but these errors were encountered: