# Error catalog

> Every problem code a client can see, with its HTTP status, its title, and the fix to show the person.

From `docs/errors.md` in tensile-tools/tensile-auth at commit `e66760d` (v0.4.1-7-ge66760d). The HTML page is https://auth.tensile.tools/docs/reference/errors.

Every error the library returns reaches clients as RFC 9457 problem details (`application/problem+json`), from `auth.Describe` and `authhttp.Error`. Branch on `code`; show `title` and `fix` to people. Refusals of a need also carry a `challenge`: see [the guide](guide.md#6-refusals-and-challenges).

## Every code
| Code | Status | Title | What the person sees as the fix |
|---|---|---|---|
| `agent_inactive` | 409 | That agent is disabled | Ask its owner to enable it, or use another agent. |
| `approval_denied` | 403 | Request denied | The person denied this request. Ask them before trying again. |
| `approval_invalid` | 403 | That approval can't be used | The approval expired, was used, or was for a different action. Ask again. |
| `approval_pending` | 409 | Waiting for approval | Wait for the person to approve, then try again. To wait in one request, retry with the header Prefer: wait=60. |
| `claim_invalid` | 401 | That claim code doesn't work | Check the code, or ask the agent to sign up again for a new one. |
| `code_invalid` | 401 | That link or code doesn't work | A link or code works once, until it expires. Type a code in the tab where you started, or ask for another email. |
| `confirm_sign_in` | 401 | Sign in to confirm | Sign in, or enter your password, in this browser, then open the link again. |
| `conflict` | 409 | Changed at the same time | Reload and try again. |
| `depth_exceeded` | 400 | Check the request | Fix the request and send it again. |
| `email_invalid` | 400 | Check the email address | Enter one address, such as name@example.com, without a name or spaces. |
| `email_unverified` | 403 | Confirm your email address | Open the link in the confirmation message, or ask for another one, then try again. |
| `expiry_exceeded` | 400 | Check the request | Fix the request and send it again. |
| `factor_exists` | 409 | Already set up | Use the one you have, or remove it first. |
| `factor_rejected` | 401 | That didn't work | Check it and try again, or use another way to sign in. |
| `human_required` | 403 | A person must do this | Ask the person responsible for this agent or token to do it. |
| `invalid_request` | 400 | Check the request | Fix the request and send it again. |
| `key_required` | 400 | Check the request | Fix the request and send it again. |
| `last_sign_in_method` | 409 | Add another way to sign in first | Add a passkey or link a sign-in provider, then remove the password. |
| `no_password` | 409 | This account has no password | Sign in another way, or add a password. |
| `no_verified_email` | 409 | No confirmed email address | Confirm an email address for the account first. |
| `not_agent_owner` | 404 | Not found | Check the agent ID. |
| `not_claimed` | 409 | Not claimed yet | Wait for a person to claim this agent, then try again. |
| `not_found` | 404 | Not found | Check the ID. It may have been revoked or deleted. |
| `not_rotatable` | 400 | Check the request | Fix the request and send it again. |
| `parent_inactive` | 409 | That session has ended | Sign in again, then retry. |
| `password_breached` | 400 | Choose a different password | This password appeared in a data breach, so attackers try it. Choose another. |
| `password_common` | 400 | Choose a different password | This password is one of the most common. Choose one that others are unlikely to use. |
| `password_context` | 400 | Choose a different password | Don't build the password from your email address or this service's name: it needs 15 characters without them. |
| `password_invalid` | 400 | Choose a different password | The password contains bytes that aren't text. Type it again. |
| `password_too_long` | 400 | Choose a different password | Use at most 256 characters. |
| `password_too_short` | 400 | Choose a different password | Use at least 15 characters. A few unrelated words make a long password you can remember. |
| `quota_exceeded` | 403 | Limit reached | Revoke something you no longer use, or ask for a higher limit. |
| `recovery_hold` | 403 | Held after a recovery sign-in | Try again after 14:32 UTC. If you didn't use a recovery code, choose “That wasn't me” on another signed-in device. |
| `scope_exceeded` | 403 | More access than allowed | Ask only for scopes the parent session or approving person holds. |
| `scope_missing` | 403 | Missing permission | Use a session or token that has the scopes this needs. |
| `setup_incomplete` | 403 | Finish setting up your account | Save your recovery codes and type one back, and add a passkey or an authenticator app, then try again. |
| `sign_in_incomplete` | 401 | Start signing in again | Your sign-in expired or is missing a step. Sign in again. |
| `signup_rejected` | 403 | Signup refused | This server doesn't accept that signup. |
| `step_up_required` | 403 | Confirm it's you | Confirm it's you with a passkey, then try again. |
| `stronger_factor_required` | 403 | Use a stronger sign-in method | Add a passkey to your account, then try again. |
| `throttled` | 429 | Too many attempts | Wait, then try again. |
| `unauthenticated` | 401 | Sign in to continue | Sign in again. |
| `unavailable` | 503 | Try again shortly | Try again in a few seconds. |
| `undo_not_allowed` | 403 | Use another device | Undo the recovery from a device that was signed in before it. |

Codes that only appear after the person is identified: `code_reused` (a TOTP code used twice, with `retry_after`), `factor_locked`, and `password_wrong` (a wrong current password, from a step-up or a change). Before identification, every factor failure is `factor_rejected`, so responses never reveal whether an account or passkey exists. Unknown errors are `internal` with no detail.

`auth.Describe` is for errors from serving a request. Setup errors, such as `passkey.ErrConfig`, `password.ErrConfig`, `federation.ErrConfig`, an error from `auth.New`, and the error from `authhttp.Mux.Check`, aren't in this catalog: their messages name the field and the fix, so log them as they are and stop the server. Don't pass them to `Describe`: it has no problems for them, so most become `internal`, which hides the cause.

When a delegation asks for a scope that the parent holds but the agent isn't allowed (`AgentSpec.Scopes`), `scope_exceeded` has the fix “Ask only for scopes the agent is allowed, or allow the agent more scopes.”
