vault_precondition_failed
412: The secret is not as expected.
The secret is not as expected. Answered with 412.
What it means
A write or delete named the version it expected with If-Match, or asked with If-None-Match: * to create only, and the secret is not in that state: another write changed it, or removed it, since that version was read; a write under If-Match found no secret of that name; or the name already holds one. A delete of a name that holds nothing is vault_secret_not_found, with or without If-Match. The check and the write are one step, so of two writers naming the same version exactly one lands. A version is never handed out twice within an Org, so a version read before a delete does not match what is written under the name after it. Nothing was changed.
What to do
Read the secret again (GET /api/vault/secrets/{name}/value), decide anew from what it holds now (another Instance may already have done what you meant to) and write with its current version in If-Match.
The body
{
"type": "https://tigby.eu/problems/vault_precondition_failed",
"title": "The secret is not as expected",
"status": 412,
"detail": "…what was refused, naming this request's own values",
"code": "vault_precondition_failed",
"doc_url": "https://docs.tigby.eu/errors/vault_precondition_failed",
"agent_hint": "…the next step, for software"
}Branch on code. The detail names this request's own Handle, id or limit and is not part of the contract.