[Bug]: embeddings_maintainer crashes on GenAI review description when image_source: preview due to missing preview frame file #22357
-
Checklist
Describe the problem you are havingEnvironment: Frigate version: 0.17.0-f0d69f7 Describe the bug: Configure review.genai.enabled: true with image_source: preview Expected behavior: Exception in thread embeddings_maintainer: Steps to reproduce1.As stated there is a race occurring whenever genai is set to preview but the tradeoff is slower response with recordings Version0.17.0-f0d69f7 In which browser(s) are you experiencing the issue with?Google Chrome Version 145.0.7632.160 Frigate config filemqtt:
enabled: true
host: 192.168.0.215
port: 1883
user: nasnvr
password: nasnvr
topic_prefix: frigate
client_id: frigate
genai:
provider: openai
api_key: '{FRIGATE_OPENAI_API_KEY}'
model: gpt-4o-mini
review:
genai:
enabled: true
image_source: recordings
preferred_language: English
additional_concerns:
- packages on porch
- unknown person lingering near door
- person checking vehicles
- vehicle parked unusually long
- animals in the yard
activity_context_prompt: |
Cameras:
- doorbell: front door and porch area
- driveway: vehicles, approach to home
- backyard: private yard, fence line, rear access (restricted area)
Recognized Family Members:
- Any person with a confirmed face recognition match to a stored resident profile is considered a household member.
Normal (threat level 0):
- Recognized family members in any camera view at any time.
- Recognized family retrieving mail or packages.
- Delivery drivers dropping packages and leaving promptly from the front door.
- Brief door visits where a person approaches, knocks/rings, and leaves within a short time.
- Household pets or known animals in the backyard.
Suspicious (threat level 1):
- Unknown person approaching the front door without a recognized face match.
- Unknown person lingering near porch, windows, or driveway.
- Person scanning the property or looking into vehicles.
- Person near vehicles who is not recognized as family.
- Vehicle creeping, stopping, or making repeated passes.
- ANY unknown person entering or present in the backyard.
- ANY movement along the backyard fence line by an unknown individual.
- Unknown person on property during late-night hours.
Critical (threat level 2):
- Attempted forced entry at doors, windows, garage, shed, or vehicles.
- Theft in progress (packages, vehicles, tools, or property).
- Person attempting to open car doors or access vehicles.
- Jumping fences, breaking gates, or attempting backyard access.
- Multiple unknown individuals entering backyard.
- Visible weapons, aggressive behavior, or vandalism.
ffmpeg:
hwaccel_args: preset-nvidia-h264
go2rtc:
streams:
driveway_main:
- rtsp://admin:pBap0tmNoH@192.168.0.83:554/h264Preview_01_main
driveway_sub:
- rtsp://admin:pBap0tmNoH@192.168.0.83:554/h264Preview_01_sub
backyard_main:
- rtsp://admin:Testfeed@192.168.0.216:554/h264Preview_01_main
backyard_sub:
- rtsp://admin:Testfeed@192.168.0.216:554/h264Preview_01_sub
doorbell_main:
- rtsp://admin:dbtestfeed1@192.168.0.246:554/h264Preview_01_main
doorbell_sub:
- rtsp://admin:dbtestfeed1@192.168.0.246:554/h264Preview_01_sub
model:
path: plus://9a097956d8c458207e883d7f3a7d4e61
detectors:
nvidia_gpu:
type: onnx
device: gpu
objects:
track:
- person
- car
- dog
- cat
- face
filters:
person:
min_area: 2000
threshold: 0.65
car:
min_area: 9000
threshold: 0.65
dog:
min_area: 2500
threshold: 0.6
cat:
min_area: 4000
threshold: 0.6
record:
enabled: true
continuous:
days: 7
motion:
days: 0
alerts:
retain:
days: 10
mode: all
detections:
retain:
days: 10
mode: all
cameras:
driveway:
enabled: true
face_recognition:
enabled: true
min_area: 1200
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/driveway_main
roles: [record]
# input_args: -hwaccel cuda -hwaccel_output_format cuda
- path: rtsp://127.0.0.1:8554/driveway_sub
roles: [detect]
detect:
enabled: true
width: 1920
height: 576
fps: 5
# record:
# enabled: true
zones:
fyard:
coordinates: 0.444,0.025,0.346,1,0.833,1,0.89,0.701,0.674,0.115
loitering_time: 0
friendly_name: FYard
inertia: 3
Driveway_Parking:
coordinates: 0.442,0.022,0.343,1,0.133,1,0.051,0.748,0.23,0.159
loitering_time: 0
friendly_name: Driveway
inertia: 3
mail_box:
coordinates: 0.614,0,0.645,0.016,0.645,0.09,0.607,0.07
loitering_time: 2
objects:
- car
- person
friendly_name: Mail Box
inertia: 3
review:
alerts:
labels:
- person
detections:
labels:
- car
- dog
- cat
notifications:
enabled: true
objects:
filters:
car: {}
motion: {}
backyard:
enabled: true
face_recognition:
enabled: false
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/backyard_main
roles: [record]
# input_args: -hwaccel cuda -hwaccel_output_format cuda
- path: rtsp://127.0.0.1:8554/backyard_sub
roles: [detect]
detect:
enabled: true
width: 640
height: 360
fps: 5
# record:
# enabled: true
zones:
BYard:
coordinates:
0.37,0.44,0.182,0.522,0.006,0.801,0.003,0.99,0.837,0.997,0.87,0.89
review:
alerts:
labels:
- person
detections:
labels:
- dog
- cat
notifications:
enabled: true
doorbell:
enabled: true
face_recognition:
enabled: true
min_area: 2000
review:
alerts:
labels:
- person
detections:
labels:
- dog
- cat
objects:
track:
- person
- car
- face
- cat
- dog
filters:
car: {}
ffmpeg:
input_args:
- -rtsp_transport
- tcp
- -fflags
- +discardcorrupt+genpts
inputs:
- path: rtsp://127.0.0.1:8554/doorbell_main
roles: [record]
- path: rtsp://127.0.0.1:8554/doorbell_sub
roles: [detect]
detect:
enabled: true
width: 640
height: 480
fps: 5
# record:
# enabled: true
zones:
db_parking:
coordinates: 0.428,0.603,0.003,0.561,0.003,0.994,0.197,0.99
inertia: 3
loitering_time: 0
friendly_name: db parking
db_front_yard:
coordinates: 0.439,0.6,0.794,0.583,0.999,0.609,0.995,0.994,0.208,0.992
inertia: 3
loitering_time: 0
objects:
- cat
- dog
- person
friendly_name: db front yard
db_mailbox:
coordinates: 0.688,0.552,0.693,0.586,0.746,0.585,0.74,0.547
loitering_time: 5
objects: car
friendly_name: db mailbox
snapshots:
enabled: true
clean_copy: true
quality: 95
semantic_search:
enabled: true
model_size: small
face_recognition:
enabled: true
model_size: small
detection_threshold: 0.70
recognition_threshold: 0.78
unknown_score: 0.80
min_area: 1500
min_faces: 1
save_attempts: 100
blur_confidence_filter: false
lpr:
enabled: false
classification:
bird:
enabled: false
custom:
Vehicles:
enabled: true
name: Vehicles
threshold: 0.8
object_config:
objects:
- car
classification_type: sub_label
Animal:
enabled: true
name: Animal
threshold: 0.8
object_config:
objects:
- cat
classification_type: sub_label
People:
enabled: true
name: People
threshold: 0.8
object_config:
objects:
- person
classification_type: attribute
version: 0.17-0
notifications:
enabled: true
email: chrisweatherington@gmail.comdocker-compose file or Docker CLI commandRepository:
ghcr.io/blakeblackshear/frigate:0.17.0
Registry URL:
https://github.com/blakeblackshear/frigate/pkgs/container/frigate
Icon URL:
https://raw.githubusercontent.com/yayitazale/unraid-templates/main/frigate.png
WebUI:
http://[IP]:[PORT:8971]
Extra Parameters:
--runtime=nvidia --shm-size=512m --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 --restart unless-stopped
Post Arguments:
CPU Pinning:
CPU:
HT:
Network Type:
Host
Use Tailscale:
Option disabled as Network type is not bridge or custom
Console shell command:
Shell
Privileged:
Off
Config Path:
/mnt/user/appdata/frigate
Edit
Remove
Container Path: /config
Media path:
/mnt/user/media/frigate
Edit
Remove
Container Path: /media/frigate
Authenticated UI and API access without TLS. Reverse proxies should use this port:
8971
Edit
Remove
Container Port: 8971
RTSP restreaming port:
8554
Edit
Remove
Container Port: 8554
By default, these streams are unauthenticated. Authentication can be configured in go2rtc section of config
Frigate RTSP Password:
enterpassword
Edit
Remove
Container Variable: FRIGATE_RTSP_PASSWORD
Frigate+ API key:
5533f0fd-88c9-4115-a175-7350e1c7e256:829e480c0e3ca005f50eb0cecee65e0f3d5a443a
Edit
Remove
Container Variable: PLUS_API_KEY
Optional: Enter the frigate+ API key or remove this if you are not using it
Nvidia Visible Devices:
GPU-d015b18e-fe3b-2aed-c333-7841587cb551
Edit
Remove
Container Variable: NVIDIA_VISIBLE_DEVICES
This info can be found in the NVidia driver plugin.. Only for Nvidia GPU decoding and/or detection. Remove this if you are not using it
Nvidia Driver Capabilities:
compute,utility,video
Edit
Remove
Container Variable: NVIDIA_DRIVER_CAPABILITIES
Only for Nvidia GPU decoding and/or detection. Remove this if you are not using it
FRIGATE_OPENAI_API_KEY:
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
Edit
Remove
Container Variable: FRIGATE_OPENAI_API_KEYRelevant Frigate log outputinfo | 2026-03-09 10:36:33 | frigate.camera.maintainer | Camera processor started for doorbell: 1096
info | 2026-03-09 10:36:33 | frigate.api.fastapi_app | Starting FastAPI app
info | 2026-03-09 10:36:33 | frigate.camera.maintainer | Capture process started for doorbell: 1158
info | 2026-03-09 10:36:33 | frigate.api.fastapi_app | FastAPI started
info | 2026-03-09 10:36:42 | frigate.detectors.plugins.onnx | ONNX: /config/model_cache/9a097956d8c458207e883d7f3a7d4e61 loaded
unknown | 2026-03-09 12:00:02 | unknown | loading data from : /config/model_cache/facedet/landmarkdet.yaml
unknown | 2026-03-09 12:00:02 | unknown | [ WARN:0@5011.150] global loadsave.cpp:268 findDecoder imread_('/tmp/cache/preview_frames/preview_driveway-1773075553.37779.webp'): can't open/read file: check file path/integrity
unknown | 2026-03-09 12:00:03 | unknown | Exception in thread embeddings_maintainer:
unknown | 2026-03-09 12:00:03 | unknown | Traceback (most recent call last):
unknown | 2026-03-09 12:00:03 | unknown | File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
unknown | 2026-03-09 12:00:03 | unknown | self.run()
unknown | 2026-03-09 12:00:03 | unknown | File "/opt/frigate/frigate/embeddings/maintainer.py", line 276, in run
unknown | 2026-03-09 12:00:03 | unknown | self._process_review_updates()
unknown | 2026-03-09 12:00:03 | unknown | File "/opt/frigate/frigate/embeddings/maintainer.py", line 604, in _process_review_updates
unknown | 2026-03-09 12:00:03 | unknown | processor.process_data(review_updates, PostProcessDataEnum.review)
unknown | 2026-03-09 12:00:03 | unknown | File "/opt/frigate/frigate/data_processing/post/review_descriptions.py", line 179, in process_data
unknown | 2026-03-09 12:00:03 | unknown | thumbs = self.get_preview_frames_as_bytes(
unknown | 2026-03-09 12:00:03 | unknown | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unknown | 2026-03-09 12:00:03 | unknown | File "/opt/frigate/frigate/data_processing/post/review_descriptions.py", line 466, in get_preview_frames_as_bytes
unknown | 2026-03-09 12:00:03 | unknown | ret, jpg = cv2.imencode(
unknown | 2026-03-09 12:00:03 | unknown | ^^^^^^^^^^^^^
unknown | 2026-03-09 12:00:03 | unknown | cv2.error: OpenCV(4.11.0) /io/opencv/modules/imgcodecs/src/loadsave.cpp:1308: error: (-215:Assertion failed) !_img.empty() in function 'imencode'
unknown | 2026-03-09 20:34:51 | unknown | 26-03-09 12:00:03.142907495Relevant go2rtc log outputnoneOperating systemUNRAID Install methodDocker CLI Network connectionWireless Camera make and modelreolink (multiple) elite duo one of the primary Screenshots of the Frigate UI's System metrics pagesAny other information that may be helpfulNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Based on the available sources, this appears to be a race condition issue where the embeddings_maintainer thread attempts to read preview frames before they're fully written to disk(1)(2). The error occurs when Similar crashes in the embeddings_maintainer thread have been documented when files are missing or not ready(1)(2). In one case, a FileNotFoundError occurred when the thread attempted to retrieve an event that wasn't in the database yet(1). Another instance involved face detection where files were deleted before being read(2). Your workaround of using review:
genai:
image_source: preview # or "recordings"When set to The frame count is automatically calculated based on context window size, aspect ratio, and image source, with a cap at 20 frames(3). This issue should be reported as a bug to the Frigate development team, as the code should include proper file existence and readability checks before attempting to read preview frames. 📚 Sources:
Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, fixed in #22376 |
Beta Was this translation helpful? Give feedback.

Thanks, fixed in #22376