Frigate - missing clips sometimes, "no cache file for this event"

I have Frigate running on a Raspberry Pi 4 saving snapshots and clips to a network share. I’m running into an issue where clips are sometimes not saved. Only about 1 in 4 events that should have generated a video clip actually saves a video clip. So I’m only getting a snapshot for most events. I see it in the Frigate UI as a “No Clip Available” for a particular event, like this below.

When I look into the network share, I see it’s consistent. Most snapshots do not have an accompanying clip.

The issue seems to happen randomly. I’m not able to pin down a pattern to when there are clips and when there isn’t. It’s not related to the type of event (person detection has a mix of clips and missing clips). My network drive is available all the time, so I don’t think it’s something to do with hard drive spin down causing a timeout or anything like that.

In the log, I see error indicating unable to create clip:

frigate.video                  INFO    : driveway: ffmpeg process is not running. exiting capture thread...
ffmpeg.driveway.detect         ERROR   : [tcp @ 0xca8a70] Connection to tcp://192.168.1.92:81?timeout=5000000 failed: Connection timed out
ffmpeg.driveway.detect         ERROR   : rtsp://user:[email protected]:81/driveway&w=2688&h=1520: Connection timed out
frigate.video                  INFO    : driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : driveway: ffmpeg process is not running. exiting capture thread...
ffmpeg.driveway.detect         ERROR   : [tcp @ 0x23f4a70] Connection to tcp://192.168.1.92:81?timeout=5000000 failed: Connection timed out
ffmpeg.driveway.detect         ERROR   : rtsp://user:[email protected]:81/driveway&w=2688&h=1520: Connection timed out
frigate.video                  INFO    : driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : driveway: ffmpeg process is not running. exiting capture thread...
ffmpeg.driveway.detect         ERROR   : [tcp @ 0x12aba70] Connection to tcp://192.168.1.92:81?timeout=5000000 failed: Connection refused
ffmpeg.driveway.detect         ERROR   : rtsp://user:[email protected]:81/driveway&w=2688&h=1520: Connection refused
frigate.events                 WARNING : Unable to create clip for driveway and event 1626284480.62247-jdleld. There were no cache files for this event.
frigate.events                 WARNING : Unable to create clip for driveway and event 1626284477.63937-azmxhj. There were no cache files for this event.
frigate.events                 WARNING : Unable to create clip for driveway and event 1626284463.152846-y677qd. There were no cache files for this

What does “There were no cache files for this event” for this event mean?

Frigate writes clips to cache before (guessing this part) moving to HDD

I’d assume you running out of cache storage
Run “df” from command line and see if storage cache use is high

ALSO
The connection issues may also be problem if frigate cannot connect to stream. In this case event detected but no cache due to disconnect from video stream

Thanks for pointing that to me. It’s a bit confusing. When I do a df, I see one tmpfs entry that might be for Frigate:

The frigate wiki saids tmpfs_cache_size should not be configured in the frigate.yml if you mounted a tmpfs volume via docker. So I don’t have tmpfs_cache_size configured in the frigate.yml, but I have this in my docker compose for Frigate container’s volume:

Not sure if there’s more stuff that needs to be done aside from configuring the tmpfs in docker-compose.

Edit: from MQTT </frigate/stat>, I see:
"/tmp/cache": {"total": 1000.0, "used": 11.9, "free": 988.1, "mount_type": "tmpfs"},

Does that mean cache is OK?

I’m guessing this is related to the unstable connection to your camera.

1 Like

I have this same problem plaguing my setup. Probably about 50% of the time I get the Unable to create clip for … and There were no cache files for this event errors. Frigate doesn’t seem to deliver any useful messaging in the docker logs and I’ve increased the amount of logging to debug. The only way that I’ve found to get more reliable videos from trigger events is to restart the container. Doing that seems to get the videos working reliably again for about a day or two then I start getting video drops regularly again.