> For the complete documentation index, see [llms.txt](https://docs.empe.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.empe.io/develop/wallet-server/error-handling-and-troubleshooting.md).

# Error Handling and Troubleshooting

Common responses and fixes:

* 401 Invalid access token
  * Missing/invalid `Authorization: Bearer <JWT>` header
  * Disallowed `alg` (only RS256/ES256)
  * Missing `sub`
  * Expired token → header includes `WWW-Authenticate: Bearer error="expired_token"`
  * `JWT_PROVIDER_PUBLIC_KEY` misconfigured (must be Base64 DER SPKI)
* 400 Flow init failed
  * QR content is not supported by the server you pointed to
  * Verifier/issuer returned a 4xx → message surfaced in `data.errorMessage`
* 404 Process not found
  * Wrong or expired `processId`
  * Confirm called by a different user than the one who initiated
* 422 Proof verification failed (credential import)
  * VC proof invalid or schema missing/mismatched
* 400 Credential subject mismatch
  * Subject DID differs from holder DID and `allowForeignSubject=false`
* Database connection errors
  * Verify `DB_*` values and connectivity; run migrations
* did:web configuration errors
  * Ensure `DID_WEB_DOMAIN` is set
  * If `DID_WEB_PORT` is set, it must be numeric

Tips:

* Use `/health/liveness` and `/health/readiness` to check service and DB
* Use debug endpoints locally to generate a working token quickly


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.empe.io/develop/wallet-server/error-handling-and-troubleshooting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
