We are trying to setup a vault cluster, 3 vault VM, with HA and with raft storage, but we are facing this error:
“Error unsealing: context deadline exceeded” in the second vault VM/third vault VM.
We are able to:
init in the first node;
unseal successfully with 3 keys,
But when we try to unseal in the second/thrid node with this command:
sudo vault operator unseal
We are able to unseal with 2 keys, but when we try to unseal with the third key,
It will hold for a while and then prompt this in red color : Error unsealing: context deadline exceeded
This is just a complex way of saying that the Vault server failed to respond in a reasonable amount of time. It gives no clue as to why that is the case.
To find out more, you would have to look at the log messages printed by the Vault server to stdout/stderr.
I am not sure if this is the correct way to debug or look at the log messages
daniel@D-VAULT2:/root$ journalctl -f -u vault
May 19 23:36:14 D-VAULT2 vault[770]:
May 19 23:36:14 D-VAULT2 vault[770]: 2023-05-19T23:36:14.880+0800 [ERROR] core: failed to retry join raft cluster: retry=2s
May 19 23:36:14 D-VAULT2 vault[770]: err=
May 19 23:36:14 D-VAULT2 vault[770]: | failed to send answer to raft leader node: Error making API request.
May 19 23:36:14 D-VAULT2 vault[770]: |
May 19 23:36:14 D-VAULT2 vault[770]: | URL: PUT https://vault1.rc.local:8200/v1/sys/storage/raft/bootstrap/answer
May 19 23:36:14 D-VAULT2 vault[770]: | Code: 500. Errors:
May 19 23:36:14 D-VAULT2 vault[770]: |
May 19 23:36:14 D-VAULT2 vault[770]: | * Preventing server addition that would require removal of too many servers and cause cluster instability
May 19 23:36:14 D-VAULT2 vault[770]:
May 19 23:36:16 D-VAULT2 vault[770]: 2023-05-19T23:36:16.575+0800 [ERROR] core: failed to get raft challenge: leader_addr=https://vault2.rc.local:8200 error="error dur ing raft bootstrap init call: context deadline exceeded"
May 19 23:36:16 D-VAULT2 vault[770]: 2023-05-19T23:36:16.881+0800 [INFO] core: security barrier not initialized
May 19 23:36:16 D-VAULT2 vault[770]: 2023-05-19T23:36:16.882+0800 [INFO] core: attempting to join possible raft leader node: leader_addr=https://vault1.rc.local:8200
May 19 23:36:16 D-VAULT2 vault[770]: 2023-05-19T23:36:16.882+0800 [INFO] core: attempting to join possible raft leader node: leader_addr=https://vault2.rc.local:8200
May 19 23:36:16 D-VAULT2 vault[770]: 2023-05-19T23:36:16.882+0800 [INFO] core: attempting to join possible raft leader node: leader_addr=https://vault3.rc.local:8200
May 19 23:36:16 D-VAULT2 vault[770]: 2023-05-19T23:36:16.889+0800 [ERROR] core: failed to get raft challenge: leader_addr=https://vault3.rc.local:8200
May 19 23:36:16 D-VAULT2 vault[770]: error=
May 19 23:36:16 D-VAULT2 vault[770]: | error during raft bootstrap init call: Error making API request.
May 19 23:36:16 D-VAULT2 vault[770]: |
May 19 23:36:16 D-VAULT2 vault[770]: | URL: PUT https://vault3.rc.local:8200/v1/sys/storage/raft/bootstrap/challenge
May 19 23:36:16 D-VAULT2 vault[770]: | Code: 503. Errors:
May 19 23:36:16 D-VAULT2 vault[770]: |
May 19 23:36:16 D-VAULT2 vault[770]: | * Vault is sealed
May 19 23:36:16 D-VAULT2 vault[770]:
May 19 23:36:16 D-VAULT2 vault[770]: 2023-05-19T23:36:16.891+0800 [ERROR] core: failed to retry join raft cluster: retry=2s
May 19 23:36:16 D-VAULT2 vault[770]: err=
May 19 23:36:16 D-VAULT2 vault[770]: | failed to send answer to raft leader node: Error making API request.
May 19 23:36:16 D-VAULT2 vault[770]: |
May 19 23:36:16 D-VAULT2 vault[770]: | URL: PUT https://vault1.rc.local:8200/v1/sys/storage/raft/bootstrap/answer
May 19 23:36:16 D-VAULT2 vault[770]: | Code: 500. Errors:
May 19 23:36:16 D-VAULT2 vault[770]: |
May 19 23:36:16 D-VAULT2 vault[770]: | * Preventing server addition that would require removal of too many servers and cause cluster instability