Bootstrapping a Secrets Vault: Bugs That Hid Behind Success Messages
Initialising our infrastructure secrets vault lost its root token once, printed a false success message, silently dropped passwords from shared entries, and 'auto-unsealed' without ever unsealing. Four bugs, each hidden by output that said everything was fine.

Key Architectural Takeaways
- Store the one unrecoverable secret first, before any step that can fail.
- A script that prints success without checking a return value is lying; fail loudly instead.
- Verify values, not names: our earlier migration check read back item names and IDs but never the password field.
The challenge
We added OpenBao (an open-source Vault fork) as the infrastructure secrets store, alongside the password vault, with Raft storage, TLS from our private CA, AppRole authentication, a scoped policy and auto-unseal. A reconciliation script pushes each secret from the encrypted source of truth into both stores, so rotating a credential and re-running the sync keeps both current.
Bootstrapping it surfaced four real bugs.
1. The root token that was initialised and never saved
The first bootstrap run seemed to time out. In fact it had completed operator init, written the unseal key file and unsealed, then was killed before pushing the root token to the password vault. The result: an initialised vault with no recorded root token, which is unrecoverable by design, because unseal keys alone grant no API access. The vault was brand new and empty, so a clean wipe and re-init was safe. The script was then restructured so the push of the root token and keys happens first, before any other step that could fail.
2. A false "pushed" message
The next run failed to push because the CLI is Node-based and ignores the OS trust store, so it needed the private CA's root set explicitly in the script's environment. A login shell sets that variable, but a script run by Ansible does not. Worse, the script printed "pushed, safe now" whatever the push returned. It now checks the result and exits fatally if the critical push fails.
3. Shared entries that stored no password
Reading back the AppRole credentials showed null passwords. A personal-vault item round-tripped fine. The identical item scoped to an organisation collection lost its password field, whether created directly or moved in afterwards. Server logs showed clean 200s, so the empty value was leaving the client. Downgrading the client one version did not fix it. This affected every item in the shared collection, including the 17 secrets from an earlier migration that had been reported as verified. That earlier check had read back names and IDs and never looked at the password field. We deleted the 20 broken items and recreated them as personal items as a documented, interim workaround, and recorded the regression plainly: the humans could no longer see those entries in the shared collection.
4. Auto-unseal that never unsealed
After a real reboot the unseal service reported success and "already unsealed", but an independent status check showed the vault still sealed. Two bugs compounded. The script's address was the loopback IP, but the certificate is valid only for the host's name and real address, so every status call failed TLS verification. And the fallback value on a failed check was the lowercase string true, compared against Python's True, so any failure was read as "not sealed, nothing to do". Fixing the address and the comparison resolved it, and a later change made the script verify the outcome instead of trusting its own status. We found this only by rebooting for real.
Takeaway
Treat each success line as a claim and check it against the system: read values back, reboot and look, and exit non-zero when a critical step does not succeed.
Some of what's described here is a design that hasn't been fully tested yet; those parts say so in the text.