[Support]: Frigate partly crashes after around 24 hours of uptime #19859
-
Checklist
Describe the problem you are havingAfter having Frigate running, after around 24 hours, I login to frigate to checkup on the camera, from the main screen I can see the "No frames have been received, check error logs" image instead of camera snapshot. Additionally, live view works perfectly well, showing that there is no issue with the camera or WebRTC. The recordings also stop the moment this "crash" happens. This also happens with an error: 2025-09-01 06:01:35.216773317 Exception in thread Thread-9:
2025-09-01 06:01:35.216775950 Traceback (most recent call last):
2025-09-01 06:01:35.216777173 File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
2025-09-01 06:01:35.216778008 self.run()
2025-09-01 06:01:35.216779023 File "/opt/frigate/frigate/video.py", line 244, in run
2025-09-01 06:01:35.216782003 while not self.stop_event.wait(self.sleeptime):
2025-09-01 06:01:35.216783866 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-01 06:01:35.216785454 File "/usr/lib/python3.11/multiprocessing/synchronize.py", line 349, in wait
2025-09-01 06:01:35.216811250 self._cond.wait(timeout)
2025-09-01 06:01:35.216812798 File "/usr/lib/python3.11/multiprocessing/synchronize.py", line 252, in wait
2025-09-01 06:01:35.216813975 self._sleeping_count.release()
2025-09-01 06:01:35.216815139 ValueError: semaphore or lock released too many times This is followed by an infinite spam of: 2025-09-01 06:02:54.725964321 [2025-09-01 06:02:54] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for camera_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest... Since I experienced this issue 4 times already, I already had debug enabled, the following was printed all the time until the thread crash and was never printed again since: 2025-09-01 05:59:04.749399789 [2025-09-01 05:59:04] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2025-09-01/05/cam/58.51.mp4 in 0.019021987915039062 seconds. obviously sometime around 100ms every time, not this exact number every time So, my storage is more than fast enough to keep up with my recordings. Steps to reproduce
(I am assuming it is not that simple since obviously there are thousands of people already running frigate with no issues, but I have no idea what triggers this). Version0.16.0-c2f8de9 In which browser(s) are you experiencing the issue with?Google Chrome Frigate config file# MQTT Configuration (Disabled)
mqtt:
enabled: false
go2rtc:
streams:
cam_name:
- rtsp://admin:[email protected]:554/h264_stream#timeout=2s
ffmpeg:
hwaccel_args: preset-vaapi
cameras:
ezviz_cam:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/cam_name?video&audio
roles:
- detect
- record
- audio
output_args:
record:
- -f
- segment
- -segment_time
- '10'
- -segment_format
- mp4
- -reset_timestamps
- '1'
#- -use_wallclock_as_timestamps
#- '1'
- -fflags
- '+discardcorrupt'
- -avoid_negative_ts
- make_zero
- -strftime
- '1'
- -c:v
- h264_vaapi
- -c:a
- aac
hwaccel_args: preset-vaapi
input_args: preset-rtsp-restream-low-latency
retry_interval: 0
record:
enabled: true
retain:
days: 7
mode: all
alerts:
retain:
days: 90
pre_capture: 10
post_capture: 10
detections:
retain:
days: 30
pre_capture: 10
post_capture: 10
snapshots:
enabled: true
timestamp: false
retain:
default: 365
audio:
enabled: true
motion:
mask: 0.043,0.938,0.332,0.943,0.332,0.994,0.043,0.987
threshold: 20
contour_area: 10
improve_contrast: false
objects:
filters:
person: {}
version: 0.16-0
semantic_search:
enabled: false
reindex: false
model_size: large
detectors:
ov:
type: openvino
device: GPU
model:
model_type: yolonas
width: 640
height: 640
input_tensor: nchw
input_pixel_format: bgr
path: /config/yolo_nas_s.onnx
labelmap_path: /labelmap/coco-80.txt
detect:
enabled: true
face_recognition:
enabled: false
model_size: large
detection_threshold: 0.4
min_area: 200
lpr:
enabled: false
classification:
bird:
enabled: false
tls:
enabled: true
auth:
enabled: false
notifications:
enabled: true
email: [email protected]
cooldown: 10
proxy:
default_role: admin
logger:
logs:
frigate.record.maintainer: debug docker-compose file or Docker CLI commandservices:
frigate:
image: ghcr.io/blakeblackshear/frigate:stable
container_name: frigate
shm_size: 256MB
restart: unless-stopped
devices:
- /dev/dri:/dev/dri # Intel GPU access for QSV decoding
ports:
- "5000:8971" # Frigate Web UI
volumes:
- ./config:/config # Config files
- ./media:/media # Recorded clips & snapshots
- ../certs/pem:/etc/letsencrypt/live/frigate:ro
- type: tmpfs
target: /tmp/cache
tmpfs:
size: 1073741824
environment:
- LIBVA_DRIVER_NAME=iHD
cap_add:
- CAP_PERFMON Relevant Frigate log output2025-09-01 06:00:14.780538306 [2025-09-01 06:00:14] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2025-09-01/06/cam_name/00.01.mp4 in 0.03493905067443848 seconds.
2025-09-01 06:00:24.773933440 [2025-09-01 06:00:24] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2025-09-01/06/cam_name/00.11.mp4 in 0.029528141021728516 seconds.
2025-09-01 06:00:34.780749291 [2025-09-01 06:00:34] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2025-09-01/06/cam_name/00.21.mp4 in 0.03063201904296875 seconds.
2025-09-01 06:00:44.779752064 [2025-09-01 06:00:44] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2025-09-01/06/cam_name/00.31.mp4 in 0.03251314163208008 seconds.
2025-09-01 06:00:54.777190689 [2025-09-01 06:00:54] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2025-09-01/06/cam_name/00.41.mp4 in 0.0318760871887207 seconds.
2025-09-01 06:01:04.760257884 [2025-09-01 06:01:04] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2025-09-01/06/cam_name/00.51.mp4 in 0.022778987884521484 seconds.
2025-09-01 06:01:14.772363143 [2025-09-01 06:01:14] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2025-09-01/06/cam_name/01.01.mp4 in 0.029525041580200195 seconds.
2025-09-01 06:01:24.779865312 [2025-09-01 06:01:24] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2025-09-01/06/cam_name/01.11.mp4 in 0.030640840530395508 seconds.
2025-09-01 06:01:34.776361954 [2025-09-01 06:01:34] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2025-09-01/06/cam_name/01.21.mp4 in 0.033660888671875 seconds.
2025-09-01 06:01:35.216773317 Exception in thread Thread-9:
2025-09-01 06:01:35.216775950 Traceback (most recent call last):
2025-09-01 06:01:35.216777173 File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
2025-09-01 06:01:35.216778008 self.run()
2025-09-01 06:01:35.216779023 File "/opt/frigate/frigate/video.py", line 244, in run
2025-09-01 06:01:35.216782003 while not self.stop_event.wait(self.sleeptime):
2025-09-01 06:01:35.216783866 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-01 06:01:35.216785454 File "/usr/lib/python3.11/multiprocessing/synchronize.py", line 349, in wait
2025-09-01 06:01:35.216811250 self._cond.wait(timeout)
2025-09-01 06:01:35.216812798 File "/usr/lib/python3.11/multiprocessing/synchronize.py", line 252, in wait
2025-09-01 06:01:35.216813975 self._sleeping_count.release()
2025-09-01 06:01:35.216815139 ValueError: semaphore or lock released too many times
2025-09-01 06:02:54.725964321 [2025-09-01 06:02:54] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest...
2025-09-01 06:03:04.729809705 [2025-09-01 06:03:04] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest...
2025-09-01 06:03:14.732399379 [2025-09-01 06:03:14] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest...
2025-09-01 06:03:24.725923800 [2025-09-01 06:03:24] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest...
2025-09-01 06:03:34.730981129 [2025-09-01 06:03:34] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest...
2025-09-01 06:03:44.733319613 [2025-09-01 06:03:44] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest...
2025-09-01 06:03:54.731079744 [2025-09-01 06:03:54] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest...
2025-09-01 06:04:04.731180983 [2025-09-01 06:04:04] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest...
2025-09-01 06:04:14.734161797 [2025-09-01 06:04:14] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest...
2025-09-01 06:04:24.734367307 [2025-09-01 06:04:24] frigate.record.maintainer WARNING : Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest... Relevant go2rtc log output2025-08-27 00:58:39.214016518 [INFO] Preparing new go2rtc config...
2025-08-27 00:58:39.606446176 [INFO] Starting go2rtc...
2025-08-27 00:58:39.676338164 00:58:39.676 INF go2rtc platform=linux/amd64 revision=fa580c5 version=1.9.9
2025-08-27 00:58:39.676353104 00:58:39.676 INF config path=/dev/shm/go2rtc.yaml
2025-08-27 00:58:39.676658432 00:58:39.676 INF [api] listen addr=:1984
2025-08-27 00:58:39.676661324 00:58:39.676 INF [rtsp] listen addr=:8554
2025-08-27 00:58:39.676957099 00:58:39.676 INF [webrtc] listen addr=:8555
2025-08-27 00:58:48.863835202 [INFO] Starting go2rtc healthcheck service...
2025-08-27 13:17:31.766325718 13:17:31.766 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:170 > error="read tcp 172.20.0.2:60044->192.168.1.2:554: i/o timeout" url=rtsp://admin:[email protected]:554/h264_stream#timeout=2s
2025-08-27 13:17:43.950119613 13:17:43.950 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:170 > error="read tcp 172.20.0.2:54584->192.168.1.2:554: i/o timeout" url=rtsp://admin:[email protected]:554/h264_stream#timeout=2s
2025-08-27 13:17:55.890987030 13:17:55.890 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:170 > error="read tcp 172.20.0.2:60354->192.168.1.2:554: i/o timeout" url=rtsp://admin:[email protected]:554/h264_stream#timeout=2s Operating systemOther Install methodDocker Compose Network connectionWireless Camera make and modelEzviz CS-TY1-R101-1G2WF Screenshots of the Frigate UI's System metrics pagesI already restarted Frigate to make recording continue, I didn't know I was going to be asked this. Any other information that may be helpfulWhile my camera is cloud based, it offers an RTSP stream which is what made me consider using this project, since the Ezviz app is really bad at detection. The attached go2rtc logged was downloaded a few days ago when the issue happened earlier, not when it just happened which is the one frigate's logs are from. I know wireless is not recommended but I do not have the option currently. You will also notice my configuration has its own record parameters for ffmpeg. This is because I've been trying to fix an issue where clips attached video starts very late sometimes, like the event ended 10 seconds ago and the video is just 10 seconds of nothing after that. The custom flags helped a little bit, reduced the likelyhood of this issue and also reduced how often the camera's output printed time (which is very accurate btw, I checked) to somehow be ahead or behind the actual time frigate shows in history viewer. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Based on the information you provided and the available documentation, the warning "Too many unprocessed recording segments in cache for cam_name. This likely indicates an issue with the detect stream, keeping the 6 most recent segments out of 7 and discarding the rest..." is triggered when Frigate's recording process cannot keep up with writing segments from RAM cache to disk(1). Normally, this is due to slow storage performance; however, your debug logs show that segments are being copied in under 100ms, so disk speed is not the issue. The documentation suggests reviewing system resources such as CPU, RAM, disk throughput, and I/O bus utilization if you see this warning repeatedly(1). It also recommends monitoring with tools like The "Exception in thread" and "semaphore or lock released too many times" error is not explicitly documented, but it suggests a threading or synchronization problem—potentially a bug in Frigate's video processing thread. This is not a typical configuration or resource issue described in the docs. Actions you can take based on the docs:
Check out these potentially useful sources: Would you like a general answer based on my knowledge instead? 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
I think your problem is the retry_interval of 0, it needs to be a number > 0 |
Beta Was this translation helpful? Give feedback.
I think your problem is the retry_interval of 0, it needs to be a number > 0