blakeblackshear / frigate-hass-integration

Frigate integration for Home Assistant
MIT License
660 stars 110 forks source link

Upgrade from 4 to 5.0.1 ends up with a broken Home Assistant integration - no live video #630

Closed theDontKnowGuy closed 2 months ago

theDontKnowGuy commented 5 months ago

My setup includes Frigate runs on one server (V13, docker, TPU device), and the latest HA runs on its own server (latest version, now 2024.2.1).

Using cameras live views on different Lovecase dashboards using the FE integration V5.2.0.

When upgrading to 5.0.1 of the integration, these cards stopped working and display "Camera unavailable " along with the card's configuration (attached below). Functionality of the cards seems to be working except of live view.

Rolled back Home Assistant from backup (hence V4.x of the Frigate integration) all works again.

Card configuration:

Camera unavailable
{
  "hide": false,
  "dependencies": {
    "all_cameras": false,
    "cameras": []
  },
  "triggers": {
    "motion": false,
    "occupancy": true,
    "entities": [
      "binary_sensor.front_door_all_occupancy"
    ]
  },
  "engine": "auto",
  "frigate": {
    "client_id": "frigate",
    "camera_name": "Front_Door"
  },
  "motioneye": {
    "images": {
      "directory_pattern": "%Y-%m-%d",
      "file_pattern": "%H-%M-%S"
    },
    "movies": {
      "directory_pattern": "%Y-%m-%d",
      "file_pattern": "%H-%M-%S"
    }
  },
  "live_provider": "auto",
  "image": {
    "refresh_seconds": 1
  },
  "camera_entity": "camera.front_door"
}

Testing http://frigate_server_ip:5000/api/stats:

{
"Back_Yard": {
"camera_fps": 1,
"capture_pid": 284,
"detection_enabled": 1,
"detection_fps": 1.3,
"ffmpeg_pid": 298,
"pid": 245,
"process_fps": 1,
"skipped_fps": 0
},
"Clinic_Entrance": {
"camera_fps": 1,
"capture_pid": 283,
"detection_enabled": 1,
"detection_fps": 0.4,
"ffmpeg_pid": 295,
"pid": 243,
"process_fps": 1,
"skipped_fps": 0
},
"Front_Door": {
"camera_fps": 2,
"capture_pid": 278,
"detection_enabled": 1,
"detection_fps": 0.6,
"ffmpeg_pid": 291,
"pid": 241,
"process_fps": 2,
"skipped_fps": 0
},
"HIK": {
"camera_fps": 0,
"capture_pid": 309,
"detection_enabled": 1,
"detection_fps": 0,
"ffmpeg_pid": 5109,
"pid": 258,
"process_fps": 0,
"skipped_fps": 0
},
"Living_Room": {
"camera_fps": 1.1,
"capture_pid": 299,
"detection_enabled": 1,
"detection_fps": 1.1,
"ffmpeg_pid": 304,
"pid": 246,
"process_fps": 1.1,
"skipped_fps": 0
},
"PeepHole": {
"camera_fps": 1.1,
"capture_pid": 303,
"detection_enabled": 1,
"detection_fps": 2.1,
"ffmpeg_pid": 310,
"pid": 251,
"process_fps": 1.1,
"skipped_fps": 0
},
"Storage": {
"camera_fps": 1,
"capture_pid": 305,
"detection_enabled": 1,
"detection_fps": 0.7,
"ffmpeg_pid": 314,
"pid": 252,
"process_fps": 1,
"skipped_fps": 0
},
"camera2": {
"camera_fps": 0,
"capture_pid": 274,
"detection_enabled": 1,
"detection_fps": 0,
"ffmpeg_pid": 5107,
"pid": 240,
"process_fps": 0,
"skipped_fps": 0
},
"cpu_usages": {
"1": {
"cmdline": "[/package/admin/s6/command/s6-svscan -d4 -- /run/service](http://192.168.1.244:5000/package/admin/s6/command/s6-svscan%20-d4%20--%20/run/service)",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"14": {
"cmdline": "s6-supervise s6-linux-init-shutdownd",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"15": {
"cmdline": "[/package/admin/s6-linux-init/command/s6-linux-init-shutdownd -c /run/s6/basedir -g 3000 -C -B](http://192.168.1.244:5000/package/admin/s6-linux-init/command/s6-linux-init-shutdownd%20-c%20/run/s6/basedir%20-g%203000%20-C%20-B)",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"23": {
"cmdline": "s6-supervise nginx",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"24": {
"cmdline": "s6-supervise go2rtc",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"25": {
"cmdline": "s6-supervise go2rtc-log",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"26": {
"cmdline": "s6-supervise nginx-log",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"27": {
"cmdline": "s6-supervise frigate",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"28": {
"cmdline": "s6-supervise frigate-log",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"29": {
"cmdline": "s6-supervise s6rc-oneshot-runner",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"30": {
"cmdline": "s6-supervise go2rtc-healthcheck",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"31": {
"cmdline": "s6-supervise s6rc-fdholder",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"40": {
"cmdline": "[/package/admin/s6-2.11.3.2/command/s6-fdholderd -1 -i data/rules](http://192.168.1.244:5000/package/admin/s6-2.11.3.2/command/s6-fdholderd%20-1%20-i%20data/rules)",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"41": {
"cmdline": "[/package/admin/s6/command/s6-ipcserverd -1 -- /package/admin/s6/command/s6-ipcserver-access -v0 -E -l0 -i data/rules -- /package/admin/s6/command/s6-sudod -t 30000 -- /package/admin/s6-rc/command/s6-rc-oneshot-run -l ../.. --](http://192.168.1.244:5000/package/admin/s6/command/s6-ipcserverd%20-1%20--%20/package/admin/s6/command/s6-ipcserver-access%20-v0%20-E%20-l0%20-i%20data/rules%20--%20/package/admin/s6/command/s6-sudod%20-t%2030000%20--%20/package/admin/s6-rc/command/s6-rc-oneshot-run%20-l%20../..%20--)",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"79": {
"cmdline": "s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/nginx",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"80": {
"cmdline": "s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/frigate",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"81": {
"cmdline": "s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/go2rtc",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
},
"100": {
"cmdline": "[/config/go2rtc -config=/dev/shm/go2rtc.yaml](http://192.168.1.244:5000/config/go2rtc%20-config=/dev/shm/go2rtc.yaml)",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.4"
},
"108": {
"cmdline": "python3 -u -m frigate",
"cpu": "1.8",
"cpu_average": "2",
"mem": "13.8"
},
"109": {
"cmdline": "bash ./run.user go2rtc-healthcheck",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.1"
},
"121": {
"cmdline": "nginx: master process nginx",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.4"
},
"139": {
"cmdline": "nginx: worker process",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.2"
},
"140": {
"cmdline": "nginx: worker process",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.2"
},
"219": {
"cmdline": "frigate.logger       ",
"cpu": "0.0",
"cpu_average": "0",
"mem": "2.7"
},
"223": {
"cmdline": "frigate.recording_manager",
"cpu": "0.5",
"cpu_average": "1",
"mem": "3.2"
},
"232": {
"cmdline": "[/usr/bin/python3 -c from multiprocessing.resource_tracker import main;main(53)](http://192.168.1.244:5000/usr/bin/python3%20-c%20from%20multiprocessing.resource_tracker%20import%20main;main(53))",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.3"
},
"233": {
"cmdline": "frigate.detector.coral",
"cpu": "17.0",
"cpu_average": "23",
"mem": "3.5"
},
"234": {
"cmdline": "frigate.output       ",
"cpu": "0.5",
"cpu_average": "0",
"mem": "3.2"
},
"239": {
"cmdline": "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x720 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.5"
},
"240": {
"cmdline": "frigate.process:camera2",
"cpu": "0.0",
"cpu_average": "0",
"mem": "3.1"
},
"241": {
"cmdline": "frigate.process:Front_Door",
"cpu": "0.5",
"cpu_average": "0",
"mem": "3.3"
},
"242": {
"cmdline": "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1080x960 -i pipe: -f mpegts -s 810x720 -codec:v mpeg1video -q 8 -bf 0 pipe:",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.4"
},
"243": {
"cmdline": "frigate.process:Clinic_Entrance",
"cpu": "0.2",
"cpu_average": "0",
"mem": "3.3"
},
"244": {
"cmdline": "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1080x960 -i pipe: -f mpegts -s 810x720 -codec:v mpeg1video -q 8 -bf 0 pipe:",
"cpu": "0.0",
"cpu_average": "0",
"mem": "1.0"
},
"245": {
"cmdline": "frigate.process:Back_Yard",
"cpu": "0.5",
"cpu_average": "1",
"mem": "3.3"
},
"246": {
"cmdline": "frigate.process:Living_Room",
"cpu": "0.2",
"cpu_average": "0",
"mem": "3.3"
},
"249": {
"cmdline": "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1080x960 -i pipe: -f mpegts -s 810x720 -codec:v mpeg1video -q 8 -bf 0 pipe:",
"cpu": "0.0",
"cpu_average": "0",
"mem": "1.0"
},
"251": {
"cmdline": "frigate.process:PeepHole",
"cpu": "0.7",
"cpu_average": "0",
"mem": "3.3"
},
"252": {
"cmdline": "frigate.process:Storage",
"cpu": "0.2",
"cpu_average": "0",
"mem": "3.4"
},
"254": {
"cmdline": "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1080x960 -i pipe: -f mpegts -s 810x720 -codec:v mpeg1video -q 8 -bf 0 pipe:",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.4"
},
"255": {
"cmdline": "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1080x960 -i pipe: -f mpegts -s 810x720 -codec:v mpeg1video -q 8 -bf 0 pipe:",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.5"
},
"258": {
"cmdline": "frigate.process:HIK  ",
"cpu": "0.0",
"cpu_average": "0",
"mem": "3.0"
},
"261": {
"cmdline": "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.5"
},
"263": {
"cmdline": "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.4"
},
"264": {
"cmdline": "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x720 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.4"
},
"274": {
"cmdline": "frigate.capture:camera2",
"cpu": "0.0",
"cpu_average": "0",
"mem": "3.0"
},
"278": {
"cmdline": "frigate.capture:Front_Door",
"cpu": "0.9",
"cpu_average": "0",
"mem": "3.1"
},
"283": {
"cmdline": "frigate.capture:Clinic_Entrance",
"cpu": "0.5",
"cpu_average": "0",
"mem": "3.1"
},
"284": {
"cmdline": "frigate.capture:Back_Yard",
"cpu": "0.2",
"cpu_average": "0",
"mem": "3.1"
},
"291": {
"cmdline": "ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-cfd04d1 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://admin:bitachon124@192.168.1.38/ucast/1 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Front_Door-%Y%m%d%H%M%S.mp4 -r 2 -vf fps=2,scale=1080:960 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:",
"cpu": "2.1",
"cpu_average": "1",
"mem": "1.1"
},
"295": {
"cmdline": "ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-cfd04d1 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://admin:bitachon124@192.168.1.38/ucast/2 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Clinic_Entrance-%Y%m%d%H%M%S.mp4 -r 1 -vf fps=1,scale=1080:960 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:",
"cpu": "1.8",
"cpu_average": "1",
"mem": "0.9"
},
"298": {
"cmdline": "ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-cfd04d1 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://admin:bitachon124@192.168.1.38/ucast/3 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Back_Yard-%Y%m%d%H%M%S.mp4 -r 1 -vf fps=1,scale=1080:960 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:",
"cpu": "2.8",
"cpu_average": "2",
"mem": "1.1"
},
"299": {
"cmdline": "frigate.capture:Living_Room",
"cpu": "0.2",
"cpu_average": "0",
"mem": "3.1"
},
"303": {
"cmdline": "frigate.capture:PeepHole",
"cpu": "0.5",
"cpu_average": "0",
"mem": "3.1"
},
"304": {
"cmdline": "ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-cfd04d1 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://admin:bitachon124@192.168.1.38/ucast/4 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Living_Room-%Y%m%d%H%M%S.mp4 -r 1 -vf fps=1,scale=1080:960 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:",
"cpu": "1.8",
"cpu_average": "1",
"mem": "0.9"
},
"305": {
"cmdline": "frigate.capture:Storage",
"cpu": "0.7",
"cpu_average": "0",
"mem": "3.1"
},
"309": {
"cmdline": "frigate.capture:HIK  ",
"cpu": "0.0",
"cpu_average": "0",
"mem": "3.0"
},
"310": {
"cmdline": "ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-cfd04d1 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://admin:bitachon124@192.168.1.39/user=admin&password=bitachon124&channel=1&stream=0.sdp?real_stream--rtp-caching=100?video=copy&audio=aac -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/PeepHole-%Y%m%d%H%M%S.mp4 -r 1 -vf fps=1,scale=1080:960 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:",
"cpu": "5.3",
"cpu_average": "5",
"mem": "1.0"
},
"314": {
"cmdline": "ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-cfd04d1 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://admin:bitachon124@192.168.1.38/ucast/7 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Storage-%Y%m%d%H%M%S.mp4 -r 1 -vf fps=1,scale=1920:1080 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:",
"cpu": "1.6",
"cpu_average": "1",
"mem": "1.4"
},
"5075": {
"cmdline": "sleep 30s",
"cpu": "0.0",
"cpu_average": "0",
"mem": "0.0"
}
},
"detection_fps": 6.2,
"detectors": {
"coral": {
"detection_start": 1707666790.497204,
"inference_speed": 24.99,
"pid": 233
}
},
"gpu_usages": {
"error-gpu": {
"gpu": -1,
"mem": -1
}
},
"processes": {
"go2rtc": {
"pid": 100
},
"logger": {
"pid": 219
},
"recording": {
"pid": 223
}
},
"service": {
"last_updated": 1707666790,
"latest_version": "0.13.1",
"storage": {
"/dev/shm": {
"free": 23007.8,
"mount_type": "ext4",
"total": 31114.8,
"used": 6501.5
},
"/media/frigate/clips": {
"free": 546342.3,
"mount_type": "cifs",
"total": 937796.7,
"used": 391454.4
},
"/media/frigate/recordings": {
"free": 546342.3,
"mount_type": "cifs",
"total": 937796.7,
"used": 391454.4
},
"/tmp/cache": {
"free": 23007.8,
"mount_type": "overlay",
"total": 31114.8,
"used": 6501.5
}
},
"temperatures": {},
"uptime": 1480,
"version": "0.13.0-cfd04d1"
}
}

No Frigate related errors in the HA log.

dermotduffy commented 5 months ago

Hard to tell, but you must be using the most recent version of both Frigate and the integration.

Are you running this version of Frigate?

IamMattM commented 5 months ago

@theDontKnowGuy @dermotduffy

I had the same issue and it seems to have reolved by reloading the HomeAssistant Frigate Integration...

Running the latest Frigate 0.13.1 image: "ghcr.io/blakeblackshear/frigate:stable"

Running the latest HomeAssistant 2024.2.1 Running the HomeAssistant HACS Frigate Integration v5.0.1: https://github.com/blakeblackshear/frigate-hass-integration The Lovelace card is HomeAssistant HACS FrontEnd frigate-hass-card v5.2.0: https://github.com/dermotduffy/frigate-hass-card

The Frigate HACS Integration failed to load but after reloading the HACS integration seemed to now work and streams get displayed in HACS card correctly.

runegang commented 5 months ago

Experienced the same thing. Got it working by upgrading the docker image for my seperate Frigate server. Was on version 0.12..something, upgraded to 0.13.1-34...

Fr3n3z1 commented 5 months ago

@runegang Hi guy, thanks for this information. But sorry i'm noob with docker, how to update frigate stack?

my stack image : ghcr.io/blakeblackshear/frigate:stable Can i change this image, beacause last updated is a year ago?

thanks you in advance.

runegang commented 5 months ago

@Fr3n3z1 I'm no expert at this. I use portainer and recreated the docker image there while also pulling the latest image.

kovlo commented 5 months ago

I have a same issue after ~8s when viewing the frigate card in home assistant.

The frigate card was working perfectly for one year, except in the last two weeks, probably since the last update.

I reinstalled both addons and the frigate docker image, these did not help. It is strange, that the issue arises only on 2 type of cameras, the other 2 are working normally. In the error log of HA I se these:

2024-02-15 21:16:09.745 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:20:32.085 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:20:47.987 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:21:37.870 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:25:51.848 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:29:04.267 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:29:04.876 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:29:46.323 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0: 

image

Fr3n3z1 commented 5 months ago

@runegang Thk you for fast reply. I solved it and find solution.

to share the solution to everyone:

First of all, make a backup of the docker or stack, or portainer... it's very important.

In portainer go to image section --> at the top of the page in the "pull image" section copy this link:

ghcr.io/blakeblackshear/frigate:0.13.0

and click on “pull image”

Next go on "Stack" section and select the frigate stack

Click on "Editor"

and change the value : image: ghcr.io/blakeblackshear/frigate:stable by image: ghcr.io/blakeblackshear/frigate:0.13.0

do not forget to add in "Volumes" section : - ./config:/config

In my case, it's my stack :

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:0.13.0
    shm_size: "79mb" # update for your cameras based on calculation above
    devices:
      - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
      - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
      - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime
      - /frigate/config.yml:/config/config.yml
      - ./config:/config
#      - /path/to/your/storage:/media/frigate
      - /NVR:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "password"

And click on "Update the stack"

And now you can update "Frigate hacs addon" on Home Assistant.

It's work fine for me. Depend of your configuration

Enjoy!!! :-)

Joe13183 commented 4 months ago

Thankyou for posting solution 😀

Mio3000 commented 4 months ago

hi @Fr3n3z1 , had same issue, thx for the guide, this fixed my broken frigate docker, now i can see it again in my HA

michaelbaldy commented 4 months ago

First of all, make a backup of the docker or stack, or portainer... it's very important.

In portainer go to image section --> at the top of the page in the "pull image" section copy this link:

Are there any suggestions for someone who isn't using docker? I'm running HA OS and frigate is loaded via HACS. Everything was working good until I upgraded to the latest Frigate and Home Assistant Core. I can get things working by restoring a backup, but that is only a temporary solution.

michaelbaldy commented 4 months ago

Ok, I've been playing around with this. My error was "Error fetching information from http://ccab4aaf-frigate:5000/api/stats: Cannot connect to host ccab4aaf-frigate:5000 ssl:default". Google searches led me here, but my problem was actually not the same as the original post.

What I've discovered is that when I upgraded Frigate / HAOS / HACore the result disabled my frigate add-on. I realized this when looking at my Frigate add-on and noticed it's not running. I hit "start" and my problems went away. This was strange behavior because I've upgraded HAOS / HA Core / Frigate many times, and this has never happened until now. Frigate has been running so flawlessly for the past couple of years, I didn't even remember there was a "start" button.

I thought I'd share, since other people may have the same problem and need a solution.

baylanger commented 4 months ago

This was strange behavior because I've upgraded HAOS / HA Core / Frigate many times, and this has never happened until now. Fri

Just to make sure, is the Watchdog enable? Otherwise a crash would have kept the add-on in stop state.

michaelbaldy commented 4 months ago

Yes, the watch dog is enabled. Also "start on boot" is enabled. I'm tempted to restore an old backup and repeat the upgrade process to try to understand this bug.

michaelbaldy commented 4 months ago

I repeated the upgrade process and found the issue. My frigate config file had some errors that v0.12.1 tolerated, but V.0.13.2 does not. The errors caused Frigate to stop. After I corrected the errors, I rebooted the system with the expectation that Frigate would start on boot (that's what "start on boot" and "watchdog" should do). But this is not the case, I needed to manually start Frigate.

baylanger commented 4 months ago

It's very likely the watchdog gave up after a specific count of failures.

baylanger commented 4 months ago

Pre this issue:

Watchdog attempt to restart the service 10 times within 4 mins. This resulting the limit reached.

Aside the above, couldn't find a good reference that clearly state what triggers the Watchdog to give up. I'm just not using the proper keywords in the Search engine ;)

hhkk47 commented 4 months ago

I have a same issue after ~8s when viewing the frigate card in home assistant.

* frigate 0.13.1-34fb1c2 (in docker) from frigate:stable

* HA 2024.2.1

* Frigate integration in HACS v5.0.1

* Frigate Card in HACS v5.2.0

The frigate card was working perfectly for one year, except in the last two weeks, probably since the last update.

I reinstalled both addons and the frigate docker image, these did not help. It is strange, that the issue arises only on 2 type of cameras, the other 2 are working normally. In the error log of HA I se these:

2024-02-15 21:16:09.745 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:20:32.085 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:20:47.987 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:21:37.870 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:25:51.848 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:29:04.267 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:29:04.876 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0:
2024-02-15 21:29:46.323 ERROR (MainThread) [custom_components.frigate.api] Timeout error fetching information from http://192.168.10.63:5000/api/events?cameras=doorbell&limit=50&include_thumbnails=0: 

image

I am having the same issue, except that it's happening on all my cameras. I'm running Frigate and HA on separate Docker containers:

* frigate 0.13.2-6476f8a

* HA 2024.3.1

* Frigate integration in HACS v5.0.1

* Frigate Card in HACS v5.2.0

These errors also appear to cause a gradual increase in the memory usage for the HA container, until it eventually results in the container being restarted after anywhere from 4 to 8 hours. The host system has a Ryzen 5 Pro 4650G (6C/12T) , 32GB RAM, and a Google Coral stick for Frigate among other things.

EDIT: I managed to fix the timeout errors on my end by moving frigate.db to an SSD, instead of having it on the same hard drive where the recordings are stored. However, the memory leaks and eventual restarts of the HA container still happens.

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

marleyjaffe commented 2 months ago

I am also experiencing this issue. It is happening across all my cameras. In two different HA/Frigate installs. Any troubleshooting tips to get this working? Everything is up-to-date...

michaelbaldy commented 2 months ago

I am also experiencing this issue. It is happening across all my cameras. In two different HA/Frigate installs. Any troubleshooting tips to get this working? Everything is up-to-date...

It has been a little while, and I have forgotten most of the details. I remember finding bad syntax or structure in my "frigate.yml" file. The errors had been either accepted or ignored in the older version, but the new version rejected the errors and crashed. I suggest two things for you: a) check the frigate error log carefully. For me there were errors about the config file that led to the line or lines with errors. b) go thru your YML file and make sure it follows the official structure

michaelbaldy commented 2 months ago

Another option for troubleshooting would be to delete or comment out large sections of your YML file until frigate works. Then start inserting sections of YML until it breaks.