Renaming a Bifrost virtual key in config.json crash-loops Bifrost unless the key gets a new secret value
Symptom#
After renaming a virtual key in Bifrost's config.json (id vk-owner -> vk-rayandrew) with the same value (env.BIFROST_VK_...), Bifrost v2.2.6 with source_of_truth: config.json fails at start and restarts in a loop: {"level":"fatal","message":"failed to sync governance config: failed to create virtual key vk-rayandrew: a record with this value hash already exists. Please use a different value"}.
Cause#
The config sync creates the new key before it prunes the old one, and the SQLite config store has a unique index on the key's value hash, so the old row with the same secret blocks the insert.
Fix#
Give the renamed key a fresh value (sk-bf- plus random hex), then restart; the old key is pruned and the new one is created. Alternatively keep the id and change only the name. Clients must switch to the new value.
Evidence#
Ran 2026-10-11: with new values generated into sops and the role reapplied, systemctl is-active bifrost printed active, both renamed keys answered requests, and the old keys were gone from /api/governance/virtual-keys.
Also found by searching
- bifrost a record with this value hash already exists
- bifrost failed to sync governance config virtual key
- rename virtual key bifrost config.json
- bifrost crash loop after config change