frigate: [Support]: Error with Frigate Addon and SMB storage on OS 11.3
Describe the problem you are having
I always keep HA, the HACS integrations and HA add-ons up to date. Recently there have been Frigate updates as well as HA updates, so I am unsure what caused the problem.
I apologize in advance for the information overload š¦
The problem started with the Frigate lovelace card reporting:
{
"request": {
"type": "frigate/events/get",
"instance_id": "frigate",
"cameras": [
"camera_1"
],
"limit": 50,
"id": 46
},
"response": {
"code": "not_found",
"message": "Unable to find Frigate instance with ID: frigate"
}
}
Using:
- HACS Frigate version is v4.0.1
- HACS Frigate Lovelace Card v5.2.0
- HA addon: Frigate (Full Access) version 0.12.1
HA logs:
2024-01-05 13:29:45.435 ERROR (MainThread) [custom_components.frigate.api] Error fetching information from http://ccab4aaf-frigate-fa:5000/api/stats: 500, message='INTERNAL SERVER ERROR', url=URL('http://ccab4aaf-frigate-fa:5000/api/stats')
While checking everything for related problems, I saw the Frigate integration āneeds attentionā.
I tried configuring the integration again with these settings but it says could not connect: I tried these settings with the Frigate integration:
http://ccab4aaf-frigate-fa:5000 and
rtsp://ccab4aaf-frigate-fa:8554
I have double-checked and the settings of the Frigate add-on correspond to these ports.
If I visit HA dashboard => Frigate I see my live camera working just fine. If I click on āeventsā and ārecordingsā I see past events and recordings and can play them BUT going to Frigate => Logs there is a problem:
2024-01-05 11:49:13.005769404 [INFO] Starting Frigate...
2024-01-05 11:49:15.715862323 [2024-01-05 13:49:15] frigate.app INFO : Starting Frigate (0.12.1-367d724)
2024-01-05 11:49:15.744532558 [2024-01-05 13:49:15] frigate.app INFO : Creating directory: /tmp/cache
2024-01-05 11:49:15.747085544 [2024-01-05 13:49:15] peewee_migrate INFO : Starting migrations
2024-01-05 11:49:15.758893603 [2024-01-05 13:49:15] peewee_migrate INFO : There is nothing to migrate
2024-01-05 11:49:15.796172286 [2024-01-05 13:49:15] frigate.app INFO : Output process started: 227
2024-01-05 11:49:15.824339629 [2024-01-05 13:49:15] frigate.app INFO : Camera processor started for cam01: 230
2024-01-05 11:49:15.846534417 [2024-01-05 13:49:15] detector.cp INFO : Starting detection process: 226
2024-01-05 11:49:15.846541844 [2024-01-05 13:49:15] frigate.detectors WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2024-01-05 11:49:15.856689386 [2024-01-05 13:49:15] frigate.app INFO : Capture process started for cam01: 232
2024-01-05 11:49:24.300362899 [2024-01-05 13:49:24] frigate.http ERROR : Exception on /stats [GET]
2024-01-05 11:49:24.300365055 Traceback (most recent call last):
2024-01-05 11:49:24.300366248 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2529, in wsgi_app
2024-01-05 11:49:24.300367183 response = self.full_dispatch_request()
2024-01-05 11:49:24.300368873 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1825, in full_dispatch_request
2024-01-05 11:49:24.300370981 rv = self.handle_user_exception(e)
2024-01-05 11:49:24.300371925 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1823, in full_dispatch_request
2024-01-05 11:49:24.300380645 rv = self.dispatch_request()
2024-01-05 11:49:24.300381570 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1799, in dispatch_request
2024-01-05 11:49:24.300394076 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2024-01-05 11:49:24.300394931 File "/opt/frigate/frigate/http.py", line 827, in stats
2024-01-05 11:49:24.300395667 stats = stats_snapshot(
2024-01-05 11:49:24.300396442 File "/opt/frigate/frigate/stats.py", line 253, in stats_snapshot
2024-01-05 11:49:24.300406125 storage_stats = shutil.disk_usage(path)
2024-01-05 11:49:24.300407398 File "/usr/lib/python3.9/shutil.py", line 1262, in disk_usage
2024-01-05 11:49:24.300408491 st = os.statvfs(path)
2024-01-05 11:49:24.300409714 BlockingIOError: [Errno 11] Resource temporarily unavailable: '/media/frigate/recordings'
This error keeps repeating every minute:
BlockingIOError: [Errno 11] Resource temporarily unavailable: '/media/frigate/recordings'
Not sure what is the problem since Frigate can actually view events and recordings and play them for me.
When setting up Frigate initially I followed this guide: https://docs.frigate.video/guides/ha_network_storage/ and made Frigate use the mounted SMB share.
On the terminal the folder does exist and is accessible and Frigate can indeed access it as shown above.:
Btw. when visiting HA Dashboard => Frigate I can only access the initial page via https://mydomain.tld/ccab4aaf_frigate-fa/ingress and the birdseye, events, config and log page. The system and storage pages are resulting in server error 500.
This last bit of info might be unrelated but it looks confusing.
Version
UnknownToMe
Frigate config file
# full config https://docs.frigate.video/configuration/index/#full-configuration-reference
# further clarification:
# https://docs.frigate.video/configuration/masks/#further-clarification
# https://docs.frigate.video/configuration/record/
# below is for saving frigate data to SMB share
# https://docs.frigate.video/guides/ha_network_storage/
database:
path: /config/frigate.db
mqtt:
host: core-mosquitto
user: mosquitto
password: secret
detectors:
cp:
type: cpu
ffmpeg:
output_args:
# replaced by preset
# record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
# record: preset-record-generic-audio-copy
record: preset-record-generic # record without audio
# https://github.com/AlexxIT/go2rtc
# Format: ffmpeg:{input}#{param1}#{param2}#{param3}
# i.e. #video=h264 #video=copy #audio=opus #backchannel=0
# these can be added to any type of stream, not necessarily to ffmpeg streams.
go2rtc:
streams:
cam01:
- rtsp://frigate:secret@192.168.95.2:554/Streaming/channels/101?transportmode=unicast&profile=Profile_1
# - "ffmpeg:cam01#audio=opus" # <- copy of the stream which transcodes audio to the missing codec (usually will be opus)
cam01_sub:
- rtsp://frigate:secret@192.168.95.2:554/Streaming/channels/102?transportmode=unicast&profile=Profile_2
# - "ffmpeg:cam01_sub#audio=opus" # <- copy of the stream which transcodes audio to the missing codec (usually will be opus)
webrtc:
candidates:
- 192.168.96.2:8555
- stun:8555
# sample logging levels and their order ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF
log:
level: info # default level
api: info
exec: info
ngrok: info
rtsp: info
streams: info
webrtc: info
cameras:
# cam01 from Cartisoara
cam01: # <------ Name the camera
ffmpeg:
input_args: preset-rtsp-restream
inputs:
- path: rtsp://127.0.0.1:8554/cam01
roles:
- record
- path: rtsp://127.0.0.1:8554/cam01_sub
roles:
- detect
detect:
enabled: true
fps: 6
width: 1280 # <---- update for your camera's resolution
height: 720 # <---- update for your camera's resolution
live:
quality: 6
# height: 720
# this configures the snapshots sent over mqtt
mqtt:
enabled: true
bounding_box: true
timestamp: false
crop: false
height: 480
quality: 95
objects:
track:
- person
- dog
filters:
person:
threshold: 0.7
min_area: 60000
dog:
threshold: 0.7
min_area: 15000
# read more about zones at https://docs.frigate.video/configuration/zones
# combine zones with motion masks https://docs.frigate.video/configuration/masks/
zones:
door:
coordinates: 933,592,1231,0,621,0,646,207,664,395
window:
coordinates: 118,67,235,0,380,0,460,241,293,379
kitchen:
coordinates: 1213,246,1055,720,859,720
bedroom:
coordinates: 328,720,496,720,107,288
# each event gets one snapshot. try to keep retain in sync with events
# this is the global section
snapshots:
enabled: true
bounding_box: true
timestamp: false
retain:
default: 7
objects:
dog: 10
person: 10
record:
enabled: true
# save recordings with all / motion / active_objects for XX days
retain:
days: 7
mode: motion
# save recordings overlapping with events with all / motion / active_objects for xx days
events:
pre_capture: 10
post_capture: 20
# add more objects from https://docs.frigate.video/configuration/objects
# this limits the types of objects recorded
objects:
- person
- dog
retain:
default: 7
mode: active_objects
objects:
dog: 3
person: 14
motion:
threshold: 25
contour_area: 35
#timestamp_style:
# position: "br"
# format: "%d.%m.%Y %H:%M:%S"
# thickness: 3
birdseye:
enabled: true
# https://docs.frigate.video/configuration/birdseye
mode: motion
Relevant log output
2024-01-05 13:29:45.435 ERROR (MainThread) [custom_components.frigate.api] Error fetching information from http://ccab4aaf-frigate-fa:5000/api/stats: 500, message='INTERNAL SERVER ERROR', url=URL('http://ccab4aaf-frigate-fa:5000/api/stats')
FFprobe output from your camera
seems unnecessary for this issue
Frigate stats
not sure how to get this
Operating system
HassOS
Install method
HassOS Addon
Coral version
CPU (no coral)
Network connection
Wired
Camera make and model
Hikvision but the problem is unrelated to the camera
Any other information that may be helpful
I am accessing my HA instance behind traefik as a reverse proxy in case it matters.
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Reactions: 4
- Comments: 24 (2 by maintainers)
In terminal
ha os update --version 11.2
HA OS 11.4 is out, I confirm it solves the issue.
Although this was a HA issue, I think frigate should tolerate
shutil.disk_usage
exceptions here, since theyāre not that important (it already toleratesFileNotFoundError
) and itās at least the second time users report such exceptions breaking their system.Confirming same issue here on OS 11.3. Reverting to 11.2 (SSH >
os update --version 11.2
) resolves this for me.https://github.com/blakeblackshear/frigate/discussions/9196 is related as well, seems HA OS 11.3 broke something
Yes I am
For me this is related to the OS 11.3 after updating I get the exact same errors.
Rolling back to OS 11.2 and itās working again.