Bonjour à tous,
Je suis en train de migrer tout mon système de suivi de caméra de Synology Surveillance station vers Frigate.
Pour ce faire, j’ai installé Frigate dans un docker hébergé par un container LXC sous proxmox (cf procédure frigate on proxmox
Aussi, j’ai souhaité utiliser mon NAS synology tout de même pour stocker tous les média générés par frigate. J’ai donc créé un répertoire partagé en NFS coté NAS (volume1/frigate), que j’ai monté ensuite dans le container par la procédure utilisé dans https://forum.hacf.fr/t/probleme-de-partage-nfs-dans-conteneur-proxmox-lxc/16633/3, un peu remixé avec mounting NFS share in proxmox lxc
J’ai remixé car à chaque update de frigate, je perdais le montage vers le share, et les recordings ne se faisaient plus…
Et je ne suis pas sûr que ça fonctionne de manière très stable.
Je mettrais des détails sur la configuration de tout cela plus bas.
J’ai actuellement 3 problèmes.
Mon problème
Problème 1 : j’ai un paquet d’erreurs dans le log nginx de frigate. Et je ne vois pas d’où ça vient. Le NUC hébergeant le frigate n’a que ça qui tourne dessus. Il y a peut-être un lien avec le montage de drive des media…
Voici le log nginx
2024-02-21 19:58:43.926244192 [INFO] Starting NGINX...
2024-02-21 19:58:45.504665512 2024/02/21 19:58:45 [error] 137#137: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.199, server: , request: "GET /ws HTTP/1.1", upstream: "http://127.0.0.1:5002/", host: "192.168.1.199:8123"
2024-02-21 19:58:45.504720353 192.168.1.199 - - [21/Feb/2024:19:58:45 +0100] "GET /ws HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "192.168.1.3, 172.30.32.1, 172.30.32.2"
2024-02-21 19:58:47.471238938 2024/02/21 19:58:47 [error] 136#136: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.199, server: , request: "GET /api/stats HTTP/1.1", upstream: "http://127.0.0.1:5001stats", host: "192.168.1.211:5000"
2024-02-21 19:58:47.476032650 2024/02/21 19:58:47 [error] 135#135: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.3, server: , request: "GET /ws HTTP/1.1", upstream: "http://127.0.0.1:5002/", host: "192.168.1.211:5000"
2024-02-21 19:58:47.476141699 192.168.1.3 - - [21/Feb/2024:19:58:47 +0100] "GET /ws HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:58:48.870397161 2024/02/21 19:58:48 [error] 134#134: *7 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /api/version HTTP/1.1", upstream: "http://127.0.0.1:5001version", host: "127.0.0.1:5000"
2024-02-21 19:58:51.492986473 2024/02/21 19:58:51 [error] 137#137: *9 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.199, server: , request: "GET /ws HTTP/1.1", upstream: "http://127.0.0.1:5002/", host: "192.168.1.199:8123"
2024-02-21 19:58:51.493047749 192.168.1.199 - - [21/Feb/2024:19:58:51 +0100] "GET /ws HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "192.168.1.3, 172.30.32.1, 172.30.32.2"
2024-02-21 19:58:52.471124348 2024/02/21 19:58:52 [error] 136#136: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.199, server: , request: "GET /api/stats HTTP/1.1", upstream: "http://127.0.0.1:5001stats", host: "192.168.1.211:5000"
2024-02-21 19:58:53.467684918 2024/02/21 19:58:53 [error] 137#137: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.3, server: , request: "GET /ws HTTP/1.1", upstream: "http://127.0.0.1:5002/", host: "192.168.1.211:5000"
2024-02-21 19:58:53.467743626 192.168.1.3 - - [21/Feb/2024:19:58:53 +0100] "GET /ws HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:58:53.938512643 2024/02/21 19:58:53 [error] 137#137: *14 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /api/version HTTP/1.1", upstream: "http://127.0.0.1:5001version", host: "127.0.0.1:5000"
2024-02-21 19:59:19.674465513 192.168.1.3 - - [21/Feb/2024:19:59:19 +0100] "GET /api/events?in_progress=1&include_thumbnails=0 HTTP/1.1" 200 3 "http://192.168.1.211:5000/events" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:19.675186349 192.168.1.3 - - [21/Feb/2024:19:59:19 +0100] "GET /api/labels HTTP/1.1" 200 3 "http://192.168.1.211:5000/events" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:19.675665614 192.168.1.3 - - [21/Feb/2024:19:59:19 +0100] "GET /api/config HTTP/1.1" 200 27999 "http://192.168.1.211:5000/events" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:19.675861176 192.168.1.3 - - [21/Feb/2024:19:59:19 +0100] "GET /api/sub_labels?split_joined=1 HTTP/1.1" 200 3 "http://192.168.1.211:5000/events" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:19.676168459 192.168.1.3 - - [21/Feb/2024:19:59:19 +0100] "GET /api/events?cameras=all&labels=all&zones=all&sub_labels=all&time_range=00:00,24:00&timezone=Europe%2FParis&favorites=0&is_submitted=-1&in_progress=0&include_thumbnails=0&limit=25 HTTP/1.1" 200 3 "http://192.168.1.211:5000/events" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.509870793 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_allee/latest.jpg?h=100 HTTP/1.1" 200 2201 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.510594634 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_jardin/latest.jpg?h=100 HTTP/1.1" 200 3789 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.511711274 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_garage/latest.jpg?h=100 HTTP/1.1" 200 1740 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.513499524 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_abri/latest.jpg?h=100 HTTP/1.1" 200 2667 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.514237908 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_terrasse/latest.jpg?h=100 HTTP/1.1" 200 2462 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.528455790 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_allee/latest.jpg?h=436 HTTP/1.1" 200 17019 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.534738598 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_jardin/latest.jpg?h=299 HTTP/1.1" 200 19846 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.541853500 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_abri/latest.jpg?h=436 HTTP/1.1" 499 0 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.541858352 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_garage/latest.jpg?h=400 HTTP/1.1" 499 0 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.543270049 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_abri/latest.jpg?h=450 HTTP/1.1" 499 0 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.543608338 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_allee/latest.jpg?h=450 HTTP/1.1" 499 0 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.543611814 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_garage/latest.jpg?h=412 HTTP/1.1" 499 0 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.543841301 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_terrasse/latest.jpg?h=375 HTTP/1.1" 499 0 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.611457126 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_allee/latest.jpg?h=445 HTTP/1.1" 200 17312 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.611874380 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_abri/latest.jpg?h=445 HTTP/1.1" 200 19947 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.625550542 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_jardin/latest.jpg?h=306 HTTP/1.1" 200 20525 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.627434482 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_garage/latest.jpg?h=408 HTTP/1.1" 200 15184 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:21.631614458 192.168.1.3 - - [21/Feb/2024:19:59:21 +0100] "GET /api/cctv_terrasse/latest.jpg?h=371 HTTP/1.1" 200 13892 "http://192.168.1.211:5000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:22.862046901 192.168.1.3 - - [21/Feb/2024:19:59:22 +0100] "GET /api/logs/nginx HTTP/1.1" 200 1200 "http://192.168.1.211:5000/logs" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:22.862654087 192.168.1.3 - - [21/Feb/2024:19:59:22 +0100] "GET /api/logs/frigate HTTP/1.1" 200 581 "http://192.168.1.211:5000/logs" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:22.862921057 192.168.1.3 - - [21/Feb/2024:19:59:22 +0100] "GET /api/logs/go2rtc HTTP/1.1" 200 251 "http://192.168.1.211:5000/logs" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
2024-02-21 19:59:39.744319461 192.168.1.199 - - [21/Feb/2024:19:59:39 +0100] "GET / HTTP/1.1" 200 10672 "-" "HomeAssistantSupervisor/2024.02.0 aiohttp/3.9.3 Python/3.12" "172.30.32.2"
2024-02-21 20:01:39.749090966 192.168.1.199 - - [21/Feb/2024:20:01:39 +0100] "GET / HTTP/1.1" 200 10672 "-" "HomeAssistantSupervisor/2024.02.0 aiohttp/3.9.3 Python/3.12" "172.30.32.2"
2024-02-21 20:03:39.754196020 192.168.1.199 - - [21/Feb/2024:20:03:39 +0100] "GET / HTTP/1.1" 200 10672 "-" "HomeAssistantSupervisor/2024.02.0 aiohttp/3.9.3 Python/3.12" "172.30.32.2"
2024-02-21 20:05:39.759217170 192.168.1.199 - - [21/Feb/2024:20:05:39 +0100] "GET / HTTP/1.1" 200 10672 "-" "HomeAssistantSupervisor/2024.02.0 aiohttp/3.9.3 Python/3.12" "172.30.32.2"
2024-02-21 20:07:39.763355309 192.168.1.199 - - [21/Feb/2024:20:07:39 +0100] "GET / HTTP/1.1" 200 10672 "-" "HomeAssistantSupervisor/2024.02.0 aiohttp/3.9.3 Python/3.12" "172.30.32.2"
2024-02-21 20:09:39.768117720 192.168.1.199 - - [21/Feb/2024:20:09:39 +0100] "GET / HTTP/1.1" 200 10672 "-" "HomeAssistantSupervisor/2024.02.0 aiohttp/3.9.3 Python/3.12" "172.30.32.2"
pour guide, les IP 192.168.1.x sont :
x=3 : mon PC
x=199 : home-assistant
x=211 : lxc frigate
Problème 2 :
autant il y a des recordings+ clpis qui apparaissent dans Frigate et ils sont bien accessibles, mais à l’inverse, je vois un paquet de records sur le NAs qui n’apparaissent pas du tout coté Frigate Web UI.
Et c’est pour toutes les caméras, avec un recording chaque minute…
vu coté frigate:
et coté NAS, dans un des répertoire, mais c’est idem sur toutes les caméras :
Problème 3 : le montage NFS vers mon NAS pour le répertoire /media/frigate.
Ce montage n’a pas l’air persistent et je ne vois pas quoi faire.
J’ai essayé avec mount -t nfs 192.168.1.5:/volume1/frigate /mnt/frigate -o vers=4
et sur le coup ça a l’air de marcher… Mais est-ce que ça resiste à un update du container (version frigate?), à un restart? etc… j’ai pas eu l’impression.
et aussi avec un montage dans le container frigate via le /etc/fstab
mais j’atteins mes limites de linux…
Auriez vous une méthode « infaillible » pour monter de manière persistente un répertoire partagé NFS synology vers un docker hébergé dans un LXC proxmox, comme pour frigate?
Merci d’avance de votre aide… (quand j’aurais tout qui fonctionne, j’en ferai un tuto, au moins pour moi ! )
Ma configuration
Configuration du LXC proxmox
arch: amd64
cores: 2
features: mount=nfs;cifs,nesting=1
hostname: docker-frigate
memory: 8192
mp1: Gigastation:101/vm-101-disk-3.raw,mp=/volume1/frigate,backup=1,size=100G
net0: name=eth0,bridge=vmbr0,gw=192.168.1.1,hwaddr=BC:24:11:92:3A:AE,ip=192.168.1.211/24,type=veth
onboot: 1
ostype: debian
rootfs: local-zfs:subvol-101-disk-0,size=8G
swap: 1024
tags: proxmox-helper-scripts
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
lxc.apparmor.profile: unconfined
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.mount.auto: cgroup:rw
lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file 0, 0
lxc.mount.entry: /dev/bus/usb/004 dev/bus/usb/004 none bind,optional,create=dir 0, 0
Configuration du docker-compose
version: '3.9'
services:
frigate:
container_name: frigate
privileged: true
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "256mb" # update for your cameras based on calculation above
devices:
- /dev/bus/usb:/dev/bus/usb
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardwa>
volumes:
- /etc/localtime:/etc/localtime:ro
- /opt/frigate/config:/config
- /mnt/frigate:/media/frigate
# - /mnt/frigate/recordings:/media/frigate/recordings
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "1935:1935" # RTMP feeds
environment:
FRIGATE_RTSP_PASSWORD: "pwd"
et enfin mon config.yml pour Frigate
mqtt:
# enabled: false
host: 192.168.1.199
port: 1883
topic_prefix: frigate
client_id: frigate
user: maison
password: Fonsorbes31
stats_interval: 60
birdseye:
enabled: True
mode: motion
objects:
track:
- person
- bird
- cat
- dog
- car
- umbrella
- mouse
#
# filters:
# person:
# min_area: 5000
# max_area: 100000
ffmpeg:
hwaccel_args: preset-vaapi
# - -hwaccel
# - vaapi
# - -hwaccel_device
# - /dev/dri/renderD128
# - -hwaccel_output_format
# - yuv420p
detectors:
# cpu1:
# type: cpu
coral:
type: edgetpu
device: usb
record:
enabled: True
retain:
days: 7
mode: motion
events:
retain:
default: 15
mode: active_objects
pre_capture: 10
post_capture: 10
snapshots:
enabled: True
timestamp: True
bounding_box: True
retain:
default: 30
cameras:
#
cctv_garage: #D-Link DCS-2330
ffmpeg:
inputs:
#high resolution
- path: rtsp://admin:pwd@192.168.1.140:554/live1.sdp
roles:
- record
# - detect
# - rtmp
#low resolution
- path: rtsp://admin:pwd@192.168.1.140:554/live2.sdp
roles:
- detect
- rtmp
motion:
mask:
- 462,0,461,44,0,39,0,0