Troubleshooting: BYOK_KEY_UNAVAILABLE (409) and DECRYPTION_FAILED (502)
A BYOK-enforced tenant field-encryption call (encrypt or decrypt) fails closed with a 409 and codeBYOK_KEY_UNAVAILABLE when your
customer-managed key cannot serve the request. The read-side sibling is a
502 with code DECRYPTION_FAILED, which signals a ciphertext problem
rather than a key-lifecycle problem:
BYOK is a tenant-owned control: you hold the key in your own KMS and
Orbit stores only the reference. The refuse below is the platform
honoring your recorded policy, not a platform fault — when it can be
resolved from your side, this page tells you how.
Cause table
Read the current BYOK record withGET /api/v1/compliance/byok to tell
the causes apart — the state (pending / active / revoked),
enforced flag, and fingerprint decide which row applies.
The lifecycle itself is documented on the
BYOK concept page:
pending → active → revoked, with rotate available from pending or
active. Revoke is refused on an already-revoked key
(409 BYOK_ALREADY_REVOKED), and re-enabling after revocation means
registering anew (PUT), not un-revoking.
Decision checklist
Work through these in order before you change anything:- Read the record.
GET /api/v1/compliance/byokand notestateandenforced. Any authenticated user can read it; it never echoes the raw reference, only the truncatedfingerprint. - Match the state to a table row.
revoked→ re-register;pending→ activate;activewith the error on a fresh deploy → provisioning race;activeand stable → KMS reachability or the read-side mismatch. - Confirm
enforceflips on only withactive. Activation is the only path that can setenforce: true— re-check that it was run withenforce: truein the same call, not toggled later against apendingkey. - For
ENCRYPTION_FAILED/DECRYPTION_FAILED, do not retry. The write-side failure (IV or authTag generation failed) and the read-side 502 are not retry-safe. Open a ticket with therequest_idfrommeta.request_idon the response, exactly as the FAQ entry for DECRYPTION_FAILED instructs.
What NOT to do
- Do not disable
enforceto bypass the refuse. The refuse is your recorded policy doing its job; weakening it to get the call through leaves audit evidence that you ran outside your own policy, and a revoked key can never be re-enabled that way — re-register instead. - Do not rotate again while a rotate is in flight. For an enforced
key, rotate re-wraps the internal data-encryption key under the new
reference; issuing another rotate before the first completes compounds
the failure. Resolve the current rotation first — if it was refused
with
409 BYOK_REWRAP_FAILED, treat that as the blocker. - Do not re-paste the same ciphertext. On a 502
DECRYPTION_FAILED, the stored envelope pointed at a pre-rotate key. Re-reading it returns the same error every time. - Do not expect revocation to undo itself. Revocation destroys the
wrapped DEK and clears
enforce; nothing short of a freshPUTrestores BYOK.
When to escalate
Escalate to support@devotel.io when:- The cause row is KMS unreachable and you have confirmed the KMS endpoint is up, the reference exists, and the decrypt grant on Orbit’s service identity is intact — then the resolution failure is on the platform side.
- Any 502 DECRYPTION_FAILED — stale ciphertext needs re-encryption onto the current key, which only the platform can perform.
- Provisioning did not self-heal after one retry of
POST /compliance/byok/activate.
- The
request_idfrommeta.request_idon the 409/502 response - The
fingerprintfromGET /compliance/byok(never the raw reference) - The lifecycle
stateandenforcedvalues at failure time - For KMS-reachability suspects: provider name and confirmation that the key/alias exists and the grant is active
Related
- Customer-Managed Keys (BYOK) —
lifecycle, provider grammar, and the exact scope of
enforce. - Customer-Managed Keys guide — the dashboard walkthrough for the same lifecycle.
- Error Codes reference — the
BYOK_KEY_UNAVAILABLE,ENCRYPTION_FAILED, andDECRYPTION_FAILEDrows and the other BYOK conflict codes (BYOK_NOT_FOUND,BYOK_NOT_PENDING,BYOK_ALREADY_REVOKED,BYOK_REWRAP_FAILED).