Problem
When OPEN_NOTEBOOK_ENCRYPTION_KEY doesn't match the key used to encrypt saved credentials, the GET /api/credentials endpoint returns a 500 Internal Server Error, making the entire credentials page inaccessible.
This happens even though get_by_provider already handles this gracefully (it logs a warning and skips the invalid credential). The list_credentials endpoint doesn't have the same resilience.
Current behavior
ERROR | api.routers.credentials:list_credentials:113 - Error listing credentials:
Decryption failed: data appears to be encrypted but key is incorrect.
GET /api/credentials HTTP/1.1" 500 Internal Server Error
The user can't see, manage, or delete their credentials through the UI. The only recovery path is going directly to SurrealDB.
Expected behavior
list_credentials should skip credentials that fail to decrypt (same behavior as get_by_provider), returning the ones that work and optionally flagging the broken ones
- Ideally, show a warning in the UI for credentials that couldn't be decrypted, with a clear action to delete them
Why this matters
This is the most common symptom when a user misconfigures OPEN_NOTEBOOK_ENCRYPTION_KEY (e.g. leaves the placeholder value, or changes it after credentials were saved). The 500 error makes recovery confusing — users think their data is lost, when it's just inaccessible.
Related
Surfaced in #720.
Problem
When
OPEN_NOTEBOOK_ENCRYPTION_KEYdoesn't match the key used to encrypt saved credentials, theGET /api/credentialsendpoint returns a 500 Internal Server Error, making the entire credentials page inaccessible.This happens even though
get_by_provideralready handles this gracefully (it logs a warning and skips the invalid credential). Thelist_credentialsendpoint doesn't have the same resilience.Current behavior
The user can't see, manage, or delete their credentials through the UI. The only recovery path is going directly to SurrealDB.
Expected behavior
list_credentialsshould skip credentials that fail to decrypt (same behavior asget_by_provider), returning the ones that work and optionally flagging the broken onesWhy this matters
This is the most common symptom when a user misconfigures
OPEN_NOTEBOOK_ENCRYPTION_KEY(e.g. leaves the placeholder value, or changes it after credentials were saved). The 500 error makes recovery confusing — users think their data is lost, when it's just inaccessible.Related
Surfaced in #720.