Servarr events entrypoints don't crash the runtime when unconfigured #7

Merged
jschoubben merged 1 commits from fix/arr-events-guard into main 2026-09-05 21:14:44 +00:00
Owner

radarr, sonarr, lidarr, bookshelf built their API client at import in index.ts (Client.fromEnv()), which throws when no API key is present — crash-looping the runtime container. Now guarded exactly as their tools/index.ts already is: buildClient() returns null on failure, the poll loop starts only when configured, and behaviour is identical when a key IS present. All four typecheck. Surfaced while building the media e2e (worked around there with a lab key; this is the real fix).

https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF

radarr, sonarr, lidarr, bookshelf built their API client at import in `index.ts` (`Client.fromEnv()`), which throws when no API key is present — crash-looping the runtime container. Now guarded exactly as their `tools/index.ts` already is: `buildClient()` returns null on failure, the poll loop starts only when configured, and behaviour is identical when a key IS present. All four typecheck. Surfaced while building the media e2e (worked around there with a lab key; this is the real fix). https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
jschoubben added 1 commit 2026-09-05 21:14:36 +00:00
The radarr/sonarr/lidarr/bookshelf events entrypoints built their client
with XClient.fromEnv() at import time, which throws when no API key/URL is
available yet — crash-looping the runtime container. The tools already
guard this; the events entrypoint did not.

Mirror the tools' guard: build the client in a try/catch, and only start
the poll loop when it succeeds. When it fails, log one line and stay idle
until a key is available. Behaviour when configured is unchanged.

Claude-Session: https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
jschoubben merged commit eb5cf65be3 into main 2026-09-05 21:14:44 +00:00
jschoubben deleted branch fix/arr-events-guard 2026-09-05 21:14:44 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#7