From 40b19c49f9e1f39217efe78c5a901c4360da2893 Mon Sep 17 00:00:00 2001 From: ginnoir Date: Thu, 8 Oct 2026 22:43:12 -0500 Subject: [PATCH] fix(cameras): self-healing healthcheck for neolink stalls neolink can wedge with a full message channel: RTSP stays up but serves no frames, so Frigate shows e1 offline indefinitely. Probe 30 RTP buffers off the sub stream each minute; after 3 straight failures SIGKILL neolink so the container exits and restart: unless-stopped brings it back. Co-Authored-By: Claude Opus 5.5 --- stacks/cameras/docker-compose.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/stacks/cameras/docker-compose.yml b/stacks/cameras/docker-compose.yml index 899ea9a..364090a 100644 --- a/stacks/cameras/docker-compose.yml +++ b/stacks/cameras/docker-compose.yml @@ -44,6 +44,25 @@ services: networks: [cameras] volumes: - /config/neolink/neolink.toml:/etc/neolink.toml:ro + # neolink can wedge without exiting ("Remaining: 0 of 100 message space"): RTSP stays + # up but serves no frames, so Frigate shows the stream offline forever (2026-10-08). + # Probe: pull 30 RTP buffers off the sub stream. After 3 straight failures, SIGKILL + # neolink; the image's sh PID 1 then exits and `restart: unless-stopped` brings it back. + healthcheck: + test: + - CMD-SHELL + - >- + f=/tmp/hc-fails; + if timeout 20 gst-launch-1.0 -q rtspsrc location=rtsp://127.0.0.1:8554/e1/subStream protocols=tcp + ! identity eos-after=30 ! fakesink >/dev/null 2>&1; then echo 0 > $$f; exit 0; fi; + n=$$(( $$(cat $$f 2>/dev/null || echo 0) + 1 )); echo $$n > $$f; + if [ $$n -ge 3 ]; then echo 0 > $$f; + for p in /proc/[0-9]*; do [ "$$(cat $$p/comm 2>/dev/null)" = neolink ] && kill -9 $${p#/proc/}; done; fi; + exit 1 + interval: 60s + timeout: 30s + start_period: 60s + retries: 3 frigate: image: ghcr.io/blakeblackshear/frigate:0.17.2