Add Emby/Jellyfin deep API health checks to docker_watchdog.sh
Both had a basic HTTP check (Emby) or no coverage at all (Jellyfin), but neither would have caught today's real incident: Jellyfin's SQLite database locked up hard (repeated 'database table is locked' errors, 30s+ query timeouts) while its own /System/Info endpoint kept responding 200 the whole time — a basic HTTP check on that endpoint would never have tripped. /Users forces an actual DB round-trip and was confirmed live to hang during the exact incident. Generalized the API check's success condition to also accept array-shaped responses (/Users returns an array; the existing check only recognized object fields like .ServerName/.Id/.Version, which would error when applied to an array) — benefits any future array-returning endpoint, not just this one. Also corrected the host.conf.template's API_CHECKS format comment, which described a 3-field format the code never actually used.
This commit is contained in:
@@ -899,7 +899,10 @@ CYCLE_START=$(date +%s)
|
||||
continue
|
||||
fi
|
||||
|
||||
if echo "$_resp" | jq -e '.ServerName // .Id // .Version' >/dev/null 2>&1; then
|
||||
# Object-shaped responses (e.g. /System/Info) pass via ServerName/Id/Version.
|
||||
# Array-shaped responses (e.g. /Users) pass on any valid array — indexing an
|
||||
# array with a string key would itself error in jq, so branch on type first.
|
||||
if echo "$_resp" | jq -e 'if type == "array" then true else (.ServerName // .Id // .Version) != null end' >/dev/null 2>&1; then
|
||||
set_strikes "${container}_api" 0 "$WATCHDOG_STATE_FILE"
|
||||
else
|
||||
API_STRIKES=$(get_strikes "${container}_api" "$WATCHDOG_STATE_FILE")
|
||||
|
||||
Reference in New Issue
Block a user