Describe the bug
Every time I run "vault operator snapshot restore " command, cluster where I am restoring ends up with corrupted data and needs stopping each node, removing raft data, initializing of cluster, restoring snapshot again with cluster root token.
To Reproduce
Steps to reproduce the behavior:
- On "origin" vault cluster run
vault operator raft snapshot save snapshot-origin-cluster
- On "destination" vault cluster run
vault operator raft snapshot restore (-force) snapshot-origin-cluster
- run vault status on destination vault cluster - no output
- try to unseal nodes:
{"errors":["node was removed from a HA cluster"]}
{"errors":["node was removed from a HA cluster"]}
{"errors":["node was removed from a HA cluster"]}
{"errors":["node was removed from a HA cluster"]}
{"errors":["node was removed from a HA cluster"]}
{"errors":["node was removed from a HA cluster"]}
- destination cluster is broken, fix it
Expected behaviorIf I am restoring snapshot from different cluster, I would expect destination cluster to seal since keys dont match.
If I am restoring snapshot from same cluster, I would expect destination cluster increasing raft index and staying unsealed
Environment:
- Vault Server Version (retrieve with
vault status): 1.21.0
- Vault CLI Version (retrieve with
vault version): v1.16.2
- Server Operating System/Architecture: Ubuntu 24.04, amd64
Vault server configuration file(s):
{
"api_addr": "https://n02.example.org:443",
"cluster_addr": "https://n02.example.org:444",
"disable_mlock": false,
"listener": [
{
"tcp": {
"address": "0.0.0.0:443",
"cluster_address": "0.0.0.0:444",
"telemetry": [
{
"unauthenticated_metrics_access": true
}
],
"tls_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem",
"tls_client_ca_file": "/etc/ssl/certs/ca-certificates.crt",
"tls_disable": false,
"tls_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem"
}
}
],
"log_level": "Error",
"storage": {
"raft": {
"path": "/etc/vault.d/raft",
"performance_multiplier": "1",
"retry_join": [
{
"leader_api_addr": "https://n01.example.org",
"leader_ca_cert_file": "/etc/ssl/certs/ca-certificates.crt",
"leader_client_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem",
"leader_client_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem"
},
{
"leader_api_addr": "https://n02.example.org",
"leader_ca_cert_file": "/etc/ssl/certs/ca-certificates.crt",
"leader_client_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem",
"leader_client_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem"
},
{
"leader_api_addr": "https://n03.example.org",
"leader_ca_cert_file": "/etc/ssl/certs/ca-certificates.crt",
"leader_client_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem",
"leader_client_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem"
},
{
"leader_api_addr": "https://n04.example.org",
"leader_ca_cert_file": "/etc/ssl/certs/ca-certificates.crt",
"leader_client_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem",
"leader_client_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem"
},
{
"leader_api_addr": "https://n05.example.org",
"leader_ca_cert_file": "/etc/ssl/certs/ca-certificates.crt",
"leader_client_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem",
"leader_client_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem"
}
]
}
},
"telemetry": {
"disable_hostname": true,
"prometheus_retention_time": "30s"
},
"ui": false
}
Additional context
Before upgrading to 1.21.0 I used 1.16.0 and I had no issues with restoring with or without force option. It literally worked as expected behaviour. So, I assume somewhere between 1.16.0 and 1.21.0 snapshot restore got broken. Broken, because in my humble opinion it makes no sense if one restores SAME cluster data, that destination where snapshot is restored gets broken, needs raft data removed, cluster reinitialized and restored with force again...
Describe the bug
Every time I run "vault operator snapshot restore " command, cluster where I am restoring ends up with corrupted data and needs stopping each node, removing raft data, initializing of cluster, restoring snapshot again with cluster root token.
To Reproduce
Steps to reproduce the behavior:
vault operator raft snapshot save snapshot-origin-clustervault operator raft snapshot restore (-force) snapshot-origin-clusterExpected behaviorIf I am restoring snapshot from different cluster, I would expect destination cluster to seal since keys dont match.
If I am restoring snapshot from same cluster, I would expect destination cluster increasing raft index and staying unsealed
Environment:
vault status): 1.21.0vault version): v1.16.2Vault server configuration file(s):
{ "api_addr": "https://n02.example.org:443", "cluster_addr": "https://n02.example.org:444", "disable_mlock": false, "listener": [ { "tcp": { "address": "0.0.0.0:443", "cluster_address": "0.0.0.0:444", "telemetry": [ { "unauthenticated_metrics_access": true } ], "tls_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem", "tls_client_ca_file": "/etc/ssl/certs/ca-certificates.crt", "tls_disable": false, "tls_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem" } } ], "log_level": "Error", "storage": { "raft": { "path": "/etc/vault.d/raft", "performance_multiplier": "1", "retry_join": [ { "leader_api_addr": "https://n01.example.org", "leader_ca_cert_file": "/etc/ssl/certs/ca-certificates.crt", "leader_client_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem", "leader_client_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem" }, { "leader_api_addr": "https://n02.example.org", "leader_ca_cert_file": "/etc/ssl/certs/ca-certificates.crt", "leader_client_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem", "leader_client_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem" }, { "leader_api_addr": "https://n03.example.org", "leader_ca_cert_file": "/etc/ssl/certs/ca-certificates.crt", "leader_client_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem", "leader_client_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem" }, { "leader_api_addr": "https://n04.example.org", "leader_ca_cert_file": "/etc/ssl/certs/ca-certificates.crt", "leader_client_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem", "leader_client_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem" }, { "leader_api_addr": "https://n05.example.org", "leader_ca_cert_file": "/etc/ssl/certs/ca-certificates.crt", "leader_client_cert_file": "/etc/letsencrypt/live/n02.example.org/fullchain.pem", "leader_client_key_file": "/etc/letsencrypt/live/n02.example.org/privkey.pem" } ] } }, "telemetry": { "disable_hostname": true, "prometheus_retention_time": "30s" }, "ui": false }Additional context
Before upgrading to 1.21.0 I used 1.16.0 and I had no issues with restoring with or without force option. It literally worked as expected behaviour. So, I assume somewhere between 1.16.0 and 1.21.0 snapshot restore got broken. Broken, because in my humble opinion it makes no sense if one restores SAME cluster data, that destination where snapshot is restored gets broken, needs raft data removed, cluster reinitialized and restored with force again...