blakeblackshear / blakeshome-charts

Repo for helm charts
41 stars 52 forks source link

Doesnt work with frigate 0.14.0 #69

Open potchin opened 1 month ago

potchin commented 1 month ago

It looks as though having the frigate config.yml stored inside a configmap causes a problem for frigate 0.14.0-beta1 since it tries to make changes to the config file. This fails since its readonly..

2024-05-25T20:22:17.380638849+01:00 2024-05-25 19:22:17.380577333  [2024-05-25 19:22:17] frigate.util.config            INFO    : Checking if frigate config needs migration...
2024-05-25T20:22:17.380707349+01:00 2024-05-25 19:22:17.380667550  [2024-05-25 19:22:17] frigate.util.config            INFO    : copying config as backup...
2024-05-25T20:22:17.410153416+01:00 2024-05-25 19:22:17.410004617  *************************************************************
2024-05-25T20:22:17.410175446+01:00 2024-05-25 19:22:17.410018071  *************************************************************
2024-05-25T20:22:17.410180980+01:00 2024-05-25 19:22:17.410022344  ***    Your config file is not valid!                     ***
2024-05-25T20:22:17.410184687+01:00 2024-05-25 19:22:17.410024262  ***    Please check the docs at                           ***
2024-05-25T20:22:17.410187752+01:00 2024-05-25 19:22:17.410025687  ***    https://docs.frigate.video/configuration/index     ***
2024-05-25T20:22:17.410190580+01:00 2024-05-25 19:22:17.410049073  *************************************************************
2024-05-25T20:22:17.410193046+01:00 2024-05-25 19:22:17.410107658  *************************************************************
2024-05-25T20:22:17.410196222+01:00 2024-05-25 19:22:17.410109785  ***    Config Validation Errors                           ***
2024-05-25T20:22:17.410198890+01:00 2024-05-25 19:22:17.410111387  *************************************************************
2024-05-25T20:22:17.410211920+01:00 2024-05-25 19:22:17.410124420  [Errno 30] Read-only file system: '/config/config.yml'
2024-05-25T20:22:17.410662979+01:00 2024-05-25 19:22:17.410290075  [2024-05-25 19:22:17] frigate.util.config            INFO    : Migrating frigate config from 0.13 to 0.14...
2024-05-25T20:22:17.410869788+01:00 2024-05-25 19:22:17.410820697  Traceback (most recent call last):
2024-05-25T20:22:17.410878941+01:00 2024-05-25 19:22:17.410822739    File "/opt/frigate/frigate/app.py", line 644, in start
2024-05-25T20:22:17.410882248+01:00 2024-05-25 19:22:17.410823774      self.init_config()
2024-05-25T20:22:17.410884860+01:00 2024-05-25 19:22:17.410824945    File "/opt/frigate/frigate/app.py", line 137, in init_config
2024-05-25T20:22:17.410887340+01:00 2024-05-25 19:22:17.410825990      migrate_frigate_config(config_file)
2024-05-25T20:22:17.410889892+01:00 2024-05-25 19:22:17.410827221    File "/opt/frigate/frigate/util/config.py", line 46, in migrate_frigate_config
2024-05-25T20:22:17.410892350+01:00 2024-05-25 19:22:17.410828291      with open(config_file, "w") as f:
2024-05-25T20:22:17.410894749+01:00 2024-05-25 19:22:17.410829405  OSError: [Errno 30] Read-only file system: '/config/config.yml'
2024-05-25T20:22:17.410897380+01:00 2024-05-25 19:22:17.410831953  
2024-05-25T20:22:17.410899985+01:00 2024-05-25 19:22:17.410833096  *************************************************************
2024-05-25T20:22:17.410902425+01:00 2024-05-25 19:22:17.410842147  ***    End Config Validation Errors                       ***
2024-05-25T20:22:17.410904911+01:00 2024-05-25 19:22:17.410843449  *************************************************************
2024-05-25T20:22:18.776405371+01:00 2024-05-25 19:22:18.776269198  [INFO] Service Frigate exited with code 1 (by signal 0)

I've tried running frigate separately to generate an updated config file (which is no different)

potchin commented 1 month ago

Not ideal but I managed to get around it by running the migration in a separate container and then copying all the new files back to the pvc inside k8s. There are some hidden files which the app uses to determine the version of the config.

newbenji commented 1 month ago

Can you post those files here? and the diff

potchin commented 1 month ago

there was no diff between the config files, that's what was confusing me. Theres a .version file which needs to contain 0.14 for the migration to be skipped. Not sure what the other files are needed for but I copied them over from another container and it works..

# ls -lrthA
total 1.6M
drwxr-xr-x. 2 root root 4.0K May 25 20:33 model_cache
-rw-r--r--. 1 root root    0 May 25 20:37 backup_config.yaml
-rw-r--r--. 1 root root 8.0K May 25 20:39 backup.db
-rw-r--r--. 1 root root 140K May 25 20:39 frigate.db
-rw-r--r--. 1 root root   17 May 25 20:40 .vacuum
-rw-r--r--. 1 root root   16 May 25 20:40 .timeline
-rw-r--r--. 1 root root  128 May 25 20:40 .jwt_secret
-rw-r--r--. 1 root root   17 May 25 20:40 .exports
-rw-r--r--. 1 root root    4 May 25 20:40 .version
-rwxr-xr-x. 1 root root    0 May 25 20:40 config.yml
-rw-r--r--. 1 root root  32K May 25 20:57 frigate.db-shm
-rw-r--r--. 1 root root 1.4M May 25 20:57 frigate.db-wal

# cat .version 
0.14
newbenji commented 1 month ago

yeah i can see i dont have version file in mine and it can write all files in /config beside config.yml :-D

newbenji commented 1 month ago

so basicly could be solved by adding to values. versionsfile: enabled: true version: 0.14

that makes that file?

newbenji commented 1 month ago

ah reading hes changes, i can see he have changes to mask coordinates etc. so i will be hit by it