Teknium
fdd32f81d4
fix(web): report a corrupt state.db as a throttled 503 status instead of a traceback per poll
...
The dashboard polls /api/analytics/usage and /api/analytics/models every
few seconds. When state.db is malformed the read raised straight through
the handler, so uvicorn logged a full traceback at ERROR on every poll —
one fleet host wrote ~520K identical journal entries in 24 h.
Wrap both analytics handlers in `corrupt_store_as_status`: a corrupt-image
sqlite3.DatabaseError (is_malformed_db_error) becomes a 503 with an
explicit `state_db_corrupt` payload pointing at `hermes doctor`, and the
warning is gated per store path via `{path: monotonic}` (>=300 s), then
debug. Busy/locked and every other error propagate unchanged, and the file
is never renamed or quarantined from the dashboard — repair stays with
`hermes doctor` / `hermes sessions repair`. `_session_db_path_for_profile`
is split out of `_open_session_db_for_profile` so the router can name the
store without opening it.
Refs #96591
Reported-by: #96591
2026-09-11 06:37:27 -07:00
..
2026-09-07 04:46:04 -07:00
2026-09-10 03:58:37 -07:00
2026-09-11 19:04:06 +10:00
2026-09-06 07:19:21 -07:00
2026-09-11 19:04:06 +10:00
2026-09-03 13:22:51 -07:00
2026-09-11 06:21:48 -07:00
2026-09-03 14:21:52 -07:00
2026-09-03 17:28:02 -07:00
2026-09-07 22:47:33 +05:30
2026-09-03 23:55:56 -07:00
2026-09-11 06:23:23 -07:00
2026-09-11 06:37:27 -07:00
2026-09-11 06:37:27 -07:00
2026-09-10 10:45:57 -07:00
2026-09-07 10:24:17 +02:00
2026-09-04 00:53:42 -07:00
2026-09-03 13:38:36 -07:00
2026-09-03 13:29:35 -07:00
2026-09-10 10:45:57 -07:00
2026-09-07 06:06:46 -07:00
2026-09-03 13:38:36 -07:00
2026-09-11 06:37:27 -07:00
2026-09-11 19:04:06 +10:00
2026-09-11 19:04:06 +10:00
2026-09-11 06:37:27 -07:00
2026-09-11 06:24:54 -07:00
2026-09-11 06:24:11 -07:00
2026-09-09 02:35:41 -07:00
2026-09-09 04:38:01 -07:00
2026-09-11 19:04:06 +10:00
2026-09-09 13:30:28 -07:00
2026-09-03 13:28:22 -07:00
2026-09-07 22:47:33 +05:30
2026-09-10 11:48:01 -07:00
2026-09-03 14:21:52 -07:00
2026-09-06 22:45:31 +05:30
2026-09-03 13:29:55 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 13:46:50 -07:00
2026-09-03 13:28:22 -07:00
2026-09-07 06:09:56 -07:00
2026-09-08 17:13:48 -07:00
2026-09-08 17:13:48 -07:00
2026-09-06 07:19:21 -07:00
2026-09-05 02:31:06 -07:00
2026-09-10 18:13:16 -07:00
2026-09-03 13:12:50 -07:00
2026-09-11 06:37:27 -07:00
2026-09-11 10:30:29 +10:00
2026-09-03 13:46:50 -07:00
2026-09-08 02:27:24 +05:30
2026-09-03 16:35:01 -07:00
2026-09-11 06:23:23 -07:00
2026-09-11 06:24:54 -07:00
2026-09-03 13:16:47 -07:00
2026-09-10 10:45:57 -07:00
2026-09-09 18:26:15 +05:30
2026-09-03 13:46:50 -07:00
2026-09-03 15:07:39 -07:00
2026-09-09 09:19:54 -07:00
2026-09-09 13:30:28 -07:00
2026-09-03 13:46:50 -07:00
2026-09-03 13:48:49 -07:00
2026-09-10 02:21:16 +05:30
2026-09-03 13:28:22 -07:00
2026-09-11 19:04:06 +10:00
2026-09-03 17:45:53 -07:00
2026-09-04 04:56:11 -07:00
2026-09-04 01:28:31 -07:00
2026-09-04 20:24:24 -04:00
2026-09-09 11:31:10 -07:00
2026-09-03 19:33:28 -07:00
2026-09-03 14:21:52 -07:00
2026-09-03 13:46:50 -07:00
2026-09-03 14:21:52 -07:00
2026-09-11 06:24:54 -07:00
2026-09-07 06:04:23 -07:00
2026-09-03 13:46:50 -07:00
2026-09-03 13:46:50 -07:00
2026-09-09 18:26:15 +05:30
2026-09-11 06:37:27 -07:00
2026-09-03 13:46:50 -07:00
2026-09-03 13:46:50 -07:00
2026-09-03 13:46:50 -07:00
2026-09-03 13:46:50 -07:00
2026-09-03 13:46:50 -07:00
2026-09-03 13:46:50 -07:00
2026-09-09 09:19:57 -07:00
2026-09-03 16:35:01 -07:00
2026-09-03 13:46:50 -07:00
2026-09-05 12:21:21 +05:30
2026-09-05 17:00:18 -07:00
2026-09-09 12:20:38 -07:00
2026-09-10 10:27:07 -07:00
2026-09-11 19:04:06 +10:00
2026-09-03 14:21:52 -07:00
2026-09-03 14:21:52 -07:00
2026-09-07 08:23:08 -07:00
2026-09-03 13:12:50 -07:00
2026-09-03 13:12:50 -07:00
2026-09-03 13:12:50 -07:00
2026-09-09 18:25:11 +05:30