ChannelWatch exposes lightweight probe endpoints, operator diagnostics in the web UI, and a channelwatch doctor CLI for container troubleshooting. This page describes the behavior implemented in app/ui/backend/main.py, app/core/cli/doctor.py, app/core/helpers/debug_bundle.py, and app/ui/components/diagnostics-panel.tsx.
There is no root GET /healthz route in v0.9. The implemented health routes are GET /healthz/live, GET /healthz/ready, and GET /healthz/startup. They are exempt from authentication and rate limits.
/healthz/live is a process liveness probe for the UI backend.
Response body:
{"status":"ok"}Status codes:
200when the FastAPI process can answer the request.
What it checks:
- It does not query the database.
- It does not query supervisor.
- It does not inspect the core process.
- It does not call any DVR.
/healthz/startup reports whether backend startup has completed.
Ready response:
{"status":"ready"}Not ready response:
{"status":"not_ready"}Status codes:
200when_STARTUP_COMPLETEis true.503when_STARTUP_COMPLETEis false.
What it checks:
- Only the backend startup flag.
- It does not query the database, supervisor, core process, or DVRs.
/healthz/ready is the readiness probe. It reads enabled DVR records from settings and the persisted watchdog snapshot, then reports whether every enabled, non deleted DVR monitor is ready without exposing DVR details.
Ready response shape:
{"status":"ready","ready":true}Degraded responses use the same two-field shape with "status":"degraded" and "ready":false.
Status codes:
200when at least one enabled DVR exists and all enabled DVR watchdog entries are ready.503when no enabled DVR is ready, when a DVR has no watchdog state yet, or when any enabled DVR is stale, dead, missing, or otherwise not ready.
What it checks:
- Enabled DVR records from the persisted settings model.
- The core watchdog snapshot from
/config/watchdog_status.jsonthroughload_watchdog_snapshot(). - Per DVR freshness and monitor state as last published by the core process.
- DVR connection state only as recorded in the watchdog snapshot. The readiness route does not make live DVR HTTP calls.
- The returned payload contains only
statusandready. It does not expose DVR names, IDs, addresses, versions, timestamps, monitor reasons, or tested-version ranges.
What it does not check directly:
- It does not run a database query.
- It does not query supervisor.
- It does not directly inspect the core process. Core health is inferred from the watchdog state it publishes.
GET /api/health is the authenticated detailed monitoring route when authentication is configured. It uses the same monitoring summary, returns 200 when ready, and returns 503 with "status":"degraded" when monitoring is not ready. Its response includes DVR IDs, DVR names, monitoring states, reasons, and notification-routing diagnostics; it still makes no live DVR calls.
Update status reports current_version separately from image_version.
worker_runtime reports the interpreter version and executable used by the
responding UI backend. On the v1.5.3 image fallback, this is the image
interpreter identity and a null verified_generation. When a v1.6.0 selected
generation is running, the status also reports the worker process ID, Python
prefix, loaded state, version and origin for requests, cryptography,
sqlmodel, uvicorn, pydantic_core, sqlalchemy and httptools, plus the
process-local verified generation claim. Unloaded optional modules remain
reported as unloaded; diagnostics do not import them merely to identify them.
The verified generation claim includes the application path, generation descriptor digest and dependency inventory digest. It is accepted only from the image-owned launcher's verified process state, never from environment variables. The reported package paths describe the actual selected worker, so they can be compared with the signed generation when diagnosing an update.
An updated application or worker package does not mean the container image, Python interpreter, operating system or image-owned verification packages have been updated. Report those separately when investigating an issue. An HTTP liveness response alone also does not prove a successful update: both core and UI must validate the exact activation identity.
Use the three implemented /healthz/* routes for Kubernetes style probes:
livenessProbe:
httpGet:
path: /healthz/live
port: http
readinessProbe:
httpGet:
path: /healthz/ready
port: http
startupProbe:
httpGet:
path: /healthz/startup
port: httpBehavior:
- Liveness should stay green as long as the UI backend process can serve HTTP. It is intentionally shallow so Kubernetes does not restart the container for transient DVR or core monitor issues.
- Readiness goes green only when the watchdog summary says all enabled DVR monitors are ready. A stale, missing, or dead monitor returns
503and should remove the pod from service. - Startup stays
503until backend startup finishes, then returns200.
These three /healthz/* routes are unauthenticated. They are also exempt from the standard API rate limiter. Use authenticated /api/health or the Diagnostics page when the operator needs per-DVR detail.
The bundled single-replica Helm chart sets service.publishNotReadyAddresses=true. Monitoring readiness therefore remains visible on the Pod without making the setup and diagnostics UI unreachable through the Service when no DVR is configured or an enabled DVR is degraded. Operators who deliberately want Kubernetes to remove a NotReady pod from Service endpoints can set service.publishNotReadyAddresses=false, but must provide another path to the UI during first-run setup and degraded monitoring.
The chart also forces the Deployment strategy to Recreate. ChannelWatch holds a container-lifetime single-writer lock for persistent /config, so Kubernetes must terminate the old pod before it starts the replacement. Checksums on the rendered ConfigMap and chart-managed Secret recreate the pod when those resources change. Helm cannot inspect the contents of a same-name secretConfig.existingSecret; after updating that external Secret, run kubectl rollout restart deployment -l app.kubernetes.io/instance=<release-name> in the release namespace.
The CLI source is app/core/cli/doctor.py. The callable entry point is run(argv: list[str] | None = None) -> None, and the parser program name is channelwatch doctor.
Invoke it inside a running container:
docker exec <container_name_or_id> channelwatch doctor config-check
docker exec <container_name_or_id> channelwatch doctor diagnose
docker exec <container_name_or_id> channelwatch doctor runtime-info
docker exec <container_name_or_id> channelwatch doctor debug bundle --output /config/channelwatch_debug_bundle.zipThe wrapper always launches the doctor with the image-owned application and Python interpreter. It does not import a selected runtime generation or inherit its Python and loader paths. Its package versions and paths therefore describe the image copy, while Update Center status describes the responding selected worker when v1.6.0 is active. Configuration commands still read the normal persisted /config data.
Available commands:
config-checkdry runs settings validation through both the core loader and UI schema loader. It reports how many DVRs each loader accepted.diagnosevalidates configured, enabled, non deleted DVRs. It checks TCP connectivity, reads each DVR/statusresponse, checks DVR version compatibility, and verifies/api/v1/channelsauthentication behavior with the configured DVR API key when present.runtime-infoprints JSON for the actual diagnostic process.diagnostic_sourceidentifies whether the loaded application is the container image, a selected application, or another application.application_dirandapplication_versiondescribe that loaded code;process_runtimedescribes the interpreter and loaded dependency origins; andverified_generationis present only when that process has verified a runtime generation. It does not infer a generation from an active pointer or environment variable. The installedchannelwatchwrapper deliberately launches the image application and therefore reportsdiagnostic_sourceasimage.debug bundlewrites a sanitized debug bundle zip to the requested output path. The default output path ischannelwatch_debug_bundle.zipin the current working directory.rotate-encryption-keyrotates the local encryption key and re-encrypts stored DVR API keys plus protected webhook URLs and secrets in one transaction.reset-admin-passwordresets an RBAC admin password when secure login is active. Pass--passwordfor automation, or omit it to enter the new password through a hidden prompt.
Exit behavior:
- Commands return exit code
0on success. config-checkexits1when settings cannot be loaded or validated.diagnoseexits1when no DVRs are configured, settings cannot be loaded, connectivity fails,/statusfails, version compatibility fails, or required DVR auth fails.debug bundlereturns0when the bundle is written. Unhandled write or bundle creation exceptions propagate as process failures.- Running
channelwatch doctorwithout a subcommand prints help and exits1.
Sample output:
Config check passed: core loader accepted 2 DVR(s) and UI schema accepted 2 DVR(s).
Checking Living Room (192.0.2.10:8089)...
OK version: 2026.01.01
OK auth: Auth check passed using the configured DVR API key.
Diagnosis completed successfully for 1 DVR(s).
Debug bundle written to /config/channelwatch_debug_bundle.zip
Current scope notes:
doctor diagnosevalidates DVR reachability, DVR auth, and DVR version support. It does not query supervisor.doctor config-checkvalidates config loading. It does not perform a separate filesystem permission audit beyond the reads required by the loaders.- Supervisor health is visible through
GET /api/system-infoand the Diagnostics UI ascore_status, not throughdoctor diagnose.
Debug bundles are available from the admin only API endpoint and from the CLI:
curl -sS -H "X-API-Key: $API_KEY" -o channelwatch_debug.zip "$BASE_URL/api/v1/debug/bundle"
docker exec <container_name_or_id> channelwatch doctor debug bundle --output /config/channelwatch_debug_bundle.zipThe implemented API path is GET /api/v1/debug/bundle. It returns application/zip with a filename like channelwatch_debug_20260426T000000Z.zip.
The bundle is generated under a timestamped top level folder. It contains:
manifest.json, with bundle type, schema version, creation time, app version, CPU architecture, enabled DVR count, privacy note, and artifact list.settings_sanitized.json, a sanitized copy of/config/settings.json.logs/app.log, the last 500 lines of/config/channelwatch.logwith log redaction applied.health_snapshot.json, currently containing onlydvr_countfor enabled, non deleted DVRs.
Sanitization guarantees from the implementation:
- Top level
api_key, Apprise credential fields, anderror_reporting_dsnare replaced with****when populated. - DVR
host,port, andapi_keyfields are replaced with****. - Webhook
urlandsecretfields are replaced with****. - Empty sensitive fields stay empty.
encryption.keyis excluded entirely.channelwatch.dbis excluded entirely.- Raw session state files are excluded.
- Log lines replace IPv4 addresses with
[REDACTED_IP]and full HTTP(S) URL tokens with[REDACTED_URL].
Current bundle limits:
- The bundle does not include container environment variables, redacted or otherwise.
- It does not include a full system inventory. System details are limited to app version, CPU architecture, and enabled DVR count in the manifest and health snapshot.
- The API generates the zip in memory and returns it to the caller. The backend does not retain API generated bundles.
- The CLI writes the zip to the path supplied by
--output; retention for CLI bundles is whatever the operator keeps or deletes on disk.
The Diagnostics view is rendered by app/ui/components/diagnostics-panel.tsx. The app navigates to it with the diagnostics hash view, so users normally reach it from the sidebar or by opening /#diagnostics in the web UI.
The page shows:
- A debug bundle download button that calls
GET /api/v1/debug/bundle. - A Report a Problem button that opens the support report flow for sanitized issue previews, optional contact handles, screenshot attachments, and ChannelWatch debug-bundle ZIP validation.
- A diagnostics export button that downloads a local text report with system details, DVR status, health warnings, test results, and recent log lines.
- A live log terminal backed by
GET /api/logs, with line count selection, text filtering, level filters, pause and resume, copy, and log download throughGET /api/logs/download. - System information from
GET /api/system-info, including ChannelWatch version, timezone, core status from supervisor, uptime, log retention, active notification providers, aggregate storage, and per DVR connection and monitoring state. - Connectivity and notification test actions using
POST /api/run_test/{test_name_url}. - Health warnings for offline DVRs, degraded monitoring, missing DVR configuration, no notification providers, and no enabled alert types.
DVR Connection checks whether the DVR is reachable. DVR API checks the Channels DVR API endpoints. Tests use the first enabled DVR and show its name with the results.
Notification tests respect that DVR's effective alert settings, including per-DVR overrides. Disabled alerts show Skipped with a reason and are counted separately from passed and failed tests. They do not initialize notification providers or create sample events. For example, Balanced skips Channel Watching, VOD Watching and Recording Scheduled; Everything enables those tests.
Enabled notification tests send clearly labelled [TEST] samples through configured destinations. Samples stay out of Recent Activity, Watch History, timelines and saved monitoring state. Existing history is preserved. Run All Tests includes these notification checks; it does not change your alert settings. A destination that is not configured or cannot be reached remains a failed result even when monitoring is running.
The Report a Problem flow is intended for support cases where a normal issue body is not enough. It guides the operator through a sanitized report preview and keeps private attachments separate from the public issue text.
Current behavior:
- The public report preview includes the problem summary, expected behavior, safe contact handles, and a diagnostics summary.
- Optional screenshots and one ChannelWatch-generated debug bundle ZIP can be attached for maintainer troubleshooting.
- Private email addresses, attachment filenames, screenshots, debug bundle contents, raw logs, tokens, notification credentials, DVR API keys, and private config values are not placed in the public issue body.
- If direct submit is not available, the flow can provide a support code or offline package for the hosted upload portal.
- The in-app flow does not show a hosted bot-verification challenge; the public upload portal keeps its own verification and support-code gate.
app/ui/backend/main.py, probe routes,/api/health,/api/system-info, and debug bundle API handler.app/core/watchdog.py, watchdog snapshot loading and readiness summary logic.app/core/cli/doctor.py, doctor CLI commands and exit behavior.app/core/helpers/debug_bundle.py, bundle contents and sanitization.app/ui/components/diagnostics-panel.tsx, Diagnostics UI.app/ui/components/report-problem-dialog.tsx, report preview, attachment selection, support-code, and submit UI.app/ui/backend/support_report.py, support report validation, sanitization, offline package, and private attachment handling.app/ui/components/dashboard.tsx, hash based diagnostics navigation.app/ui/lib/api.ts, frontend calls for system info, tests, and debug bundle download.
docs/reference/api.md, endpoint catalog.docs/reference/logs-metrics.md, logs and metrics reference.docs/how-to/troubleshoot-notifications.md, notification troubleshooting.