blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.45k stars 1.68k forks source link

[Config Support]: #3577

Closed VictorProgene closed 2 years ago

VictorProgene commented 2 years ago

Describe the problem you are having

Frigate doesn't run, it simply doesn't open the interface on home assistant, and sometimes it show a message "The add on is not runnig, please, start it", so I go to the add on and start it again, but it stops it self right after. I don't know what to do.

Version

3.1

Frigate config file

I didn't know where to find it.

Relevant log output

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-08-02 22:03:41] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
*************************************************************
*************************************************************
***    Your config file is not valid!                     ***
***    Please check the docs at                           ***
***    https://docs.frigate.video/configuration/index     ***
*************************************************************
*************************************************************
***    Config Validation Errors                           ***
*************************************************************
4 validation errors for FrigateConfig
cameras -> EVA -> objects
  value is not a valid dict (type=type_error.dict)
cameras -> EVA -> fps
  extra fields not permitted (type=value_error.extra)
cameras -> EVA -> height
  extra fields not permitted (type=value_error.extra)
cameras -> EVA -> width
  extra fields not permitted (type=value_error.extra)
Traceback (most recent call last):
  File "/opt/frigate/frigate/app.py", line 312, in start
    self.init_config()
  File "/opt/frigate/frigate/app.py", line 77, in init_config
    user_config = FrigateConfig.parse_file(config_file)
  File "/opt/frigate/frigate/config.py", line 904, in parse_file
    return cls.parse_obj(config)
  File "pydantic/main.py", line 511, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 331, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 4 validation errors for FrigateConfig
cameras -> EVA -> objects
  value is not a valid dict (type=type_error.dict)
cameras -> EVA -> fps
  extra fields not permitted (type=value_error.extra)
cameras -> EVA -> height
  extra fields not permitted (type=value_error.extra)
cameras -> EVA -> width
  extra fields not permitted (type=value_error.extra)
*************************************************************
***    End Config Validation Errors                       ***
*************************************************************
[cmd] python3 exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

CPU (no coral)

Any other information that may be helpful

No response

NickM-27 commented 2 years ago

The logs say it all

index     ***
*************************************************************
*************************************************************
***    Config Validation Errors                           ***
*************************************************************
4 validation errors for FrigateConfig
cameras -> EVA -> objects
  value is not a valid dict (type=type_error.dict)
cameras -> EVA -> fps
  extra fields not permitted (type=value_error.extra)
cameras -> EVA -> height
  extra fields not permitted (type=value_error.extra)
cameras -> EVA -> width
  extra fields not permitted (type=value_error.extra)
Traceback (most recent call last):
  File "/opt/frigate/frigate/app.py", line 312, in start
    self.init_config()
  File "/opt/frigate/frigate/app.py", line 77, in init_config
    user_config = FrigateConfig.parse_file(config_file)
  File "/opt/frigate/frigate/config.py", line 904, in parse_file
    return cls.parse_obj(config)
  File "pydantic/main.py", line 511, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 331, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 4 validation errors for FrigateConfig
cameras -> EVA -> objects
  value is not a valid dict (type=type_error.dict)
cameras -> EVA -> fps
  extra fields not permitted (type=value_error.extra)
cameras -> EVA -> height
  extra fields not permitted (type=value_error.extra)
cameras -> EVA -> width
  extra fields not permitted (type=value_error.extra)
*************************************************************
***    End Config Validation Errors                       ***
*************************************************************

Since you're running the addon, the config file is /config/frigate.yml

The logs point to you missing a detect header and maybe some bad spacing. If you paste the contents of the file here (using backticks) like:

``` Copy all this and replace this text ```

Then I can say for sure

VictorProgene commented 2 years ago

The logs point to you missing a detect header and maybe some bad spacing. If you paste the contents of the file here (using backticks) like:

My config file is here:

''' mqtt: host: My Ip is here port: 1883 topic_prefix: frigate client_id: frigate user: Calis password: My password is here

cameras: EVA: width: 1920 height: 1080 ffmpeg: inputs:

detectors: cpu1: type: cpu cpu2: type: cpu cpu3: type: cpu '''

NickM-27 commented 2 years ago

As I said you need to use backticks, without that all spacing is removed and I can't see what the file looks like

But yes you are for sure missing detect, since width and height are a property of detect.

See the docs for how it's supposed to look https://docs.frigate.video/guides/getting_started#step-3-add-a-minimal-camera-configuration

VictorProgene commented 2 years ago

As I said you need to use backticks, without that all spacing is removed and I can't see what the file looks like

But yes you are for sure missing detect, since width and height are a property of detect.

See the docs for how it's supposed to look https://docs.frigate.video/guides/getting_started#step-3-add-a-minimal-camera-configuration

Is that correct? I'm using as you said, but it doesn't work with these backticks

''' mqtt: host: My Ip is here port: 1883 topic_prefix: frigate client_id: frigate user: Calis password: My password is here

cameras: EVA: width: 1920 height: 1080 ffmpeg: inputs:

detectors: cpu1: type: cpu cpu2: type: cpu cpu3: type: cpu '''

VictorProgene commented 2 years ago

As I said you need to use backticks, without that all spacing is removed and I can't see what the file looks like

But yes you are for sure missing detect, since width and height are a property of detect.

See the docs for how it's supposed to look https://docs.frigate.video/guides/getting_started#step-3-add-a-minimal-camera-configuration

I tryed to make another code with what I saw on the link you sent me:

''' mqtt: host: My IP port: My port user: My user password: My pasword

detectors: cpu: type: cpu

cameras: EVA: # <------ Name the camera ffmpeg: inputs:

but it still doesn´t work, the log file is here:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] done. [services.d] starting services [services.d] done. [2022-08-02 22:59:25] frigate.app INFO : Starting Frigate (0.10.1-83481af)



Your config file is not valid! Please check the docs at https://docs.frigate.video/configuration/index



Config Validation Errors


3 validation errors for FrigateConfig mqtt -> cameras extra fields not permitted (type=value_error.extra) mqtt -> detectors extra fields not permitted (type=value_error.extra) cameras field required (type=value_error.missing) Traceback (most recent call last): File "/opt/frigate/frigate/app.py", line 312, in start self.init_config() File "/opt/frigate/frigate/app.py", line 77, in init_config user_config = FrigateConfig.parse_file(config_file) File "/opt/frigate/frigate/config.py", line 904, in parse_file return cls.parse_obj(config) File "pydantic/main.py", line 511, in pydantic.main.BaseModel.parse_obj File "pydantic/main.py", line 331, in pydantic.main.BaseModel.init pydantic.error_wrappers.ValidationError: 3 validation errors for FrigateConfig mqtt -> cameras extra fields not permitted (type=value_error.extra) mqtt -> detectors extra fields not permitted (type=value_error.extra) cameras field required (type=value_error.missing)


End Config Validation Errors


[cmd] python3 exited 1 [cont-finish.d] executing container finish scripts... [cont-finish.d] done. [s6-finish] waiting for services. [s6-finish] sending all processes the TERM signal.

NickM-27 commented 2 years ago

Your spacing looks off then. Yaml is organized by spacing, please adjust accordingly to the docs (including the indents via spacing)

VictorProgene commented 2 years ago

Your spacing looks off then. Yaml is organized by spacing, please adjust accordingly to the docs (including the indents via spacing)

Accualy, i'm using the spaces just like the docs, but when I copy and past here it gets without spaces, I wish you could see it, i'm trying using ''' ''', but it doesn´t get the spaces:

''' mqtt: host: 192.169.1.167 cameras: EVA: ffmpeg: inputs:

I tryed this code above now, my frigate started, the log flie is diferent now: But it stil stops later and the web interface doesn´t open

[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] done. [services.d] starting services [services.d] done. [2022-08-02 23:11:25] frigate.app INFO : Starting Frigate (0.10.1-83481af) [2022-08-02 23:11:25] frigate.app INFO : Creating directory: /media/frigate/recordings [2022-08-02 23:11:25] frigate.app INFO : Creating directory: /media/frigate/clips [2022-08-02 23:11:25] frigate.app INFO : Creating directory: /tmp/cache Starting migrations [2022-08-02 23:11:25] peewee_migrate INFO : Starting migrations Migrate "001_create_events_table" [2022-08-02 23:11:25] peewee_migrate INFO : Migrate "001_create_events_table" sql ('CREATE TABLE IF NOT EXISTS "event" ("id" VARCHAR(30) NOT NULL PRIMARY KEY, "label" VARCHAR(20) NOT NULL, "camera" VARCHAR(20) NOT NULL, "start_time" DATETIME NOT NULL, "end_time" DATETIME NOT NULL, "top_score" REAL NOT NULL, "false_positive" INTEGER NOT NULL, "zones" JSON NOT NULL, "thumbnail" TEXT NOT NULL)',) [2022-08-02 23:11:25] peewee_migrate INFO : sql ('CREATE TABLE IF NOT EXISTS "event" ("id" VARCHAR(30) NOT NULL PRIMARY KEY, "label" VARCHAR(20) NOT NULL, "camera" VARCHAR(20) NOT NULL, "start_time" DATETIME NOT NULL, "end_time" DATETIME NOT NULL, "top_score" REAL NOT NULL, "false_positive" INTEGER NOT NULL, "zones" JSON NOT NULL, "thumbnail" TEXT NOT NULL)',) sql ('CREATE INDEX IF NOT EXISTS "event_label" ON "event" ("label")',) [2022-08-02 23:11:25] peewee_migrate INFO : sql ('CREATE INDEX IF NOT EXISTS "event_label" ON "event" ("label")',) sql ('CREATE INDEX IF NOT EXISTS "event_camera" ON "event" ("camera")',) [2022-08-02 23:11:25] peewee_migrate INFO : sql ('CREATE INDEX IF NOT EXISTS "event_camera" ON "event" ("camera")',) Done 001_create_events_table [2022-08-02 23:11:25] peewee_migrate INFO : Done 001_create_events_table Migrate "002_add_clip_snapshot" [2022-08-02 23:11:25] peewee_migrate INFO : Migrate "002_add_clip_snapshot" add_column ('event', 'has_clip', ) [2022-08-02 23:11:25] peewee_migrate INFO : add_column ('event', 'has_clip', ) add_column ('event', 'has_snapshot', ) [2022-08-02 23:11:25] peewee_migrate INFO : add_column ('event', 'has_snapshot', ) Done 002_add_clip_snapshot [2022-08-02 23:11:25] peewee_migrate INFO : Done 002_add_clip_snapshot Migrate "003_create_recordings_table" [2022-08-02 23:11:25] peewee_migrate INFO : Migrate "003_create_recordings_table" sql ('CREATE TABLE IF NOT EXISTS "recordings" ("id" VARCHAR(30) NOT NULL PRIMARY KEY, "camera" VARCHAR(20) NOT NULL, "path" VARCHAR(255) NOT NULL, "start_time" DATETIME NOT NULL, "end_time" DATETIME NOT NULL, "duration" REAL NOT NULL)',) [2022-08-02 23:11:25] peewee_migrate INFO : sql ('CREATE TABLE IF NOT EXISTS "recordings" ("id" VARCHAR(30) NOT NULL PRIMARY KEY, "camera" VARCHAR(20) NOT NULL, "path" VARCHAR(255) NOT NULL, "start_time" DATETIME NOT NULL, "end_time" DATETIME NOT NULL, "duration" REAL NOT NULL)',) sql ('CREATE INDEX IF NOT EXISTS "recordings_camera" ON "recordings" ("camera")',) [2022-08-02 23:11:25] peewee_migrate INFO : sql ('CREATE INDEX IF NOT EXISTS "recordings_camera" ON "recordings" ("camera")',) sql ('CREATE UNIQUE INDEX IF NOT EXISTS "recordings_path" ON "recordings" ("path")',) [2022-08-02 23:11:25] peewee_migrate INFO : sql ('CREATE UNIQUE INDEX IF NOT EXISTS "recordings_path" ON "recordings" ("path")',) sql ('CREATE INDEX IF NOT EXISTS "recordings_start_time_end_time" ON "recordings" (start_time, end_time)',) [2022-08-02 23:11:25] peewee_migrate INFO : sql ('CREATE INDEX IF NOT EXISTS "recordings_start_time_end_time" ON "recordings" (start_time, end_time)',) Done 003_create_recordings_table [2022-08-02 23:11:25] peewee_migrate INFO : Done 003_create_recordings_table Migrate "004_add_bbox_region_area" [2022-08-02 23:11:25] peewee_migrate INFO : Migrate "004_add_bbox_region_area" add_column ('event', 'region', ) [2022-08-02 23:11:25] peewee_migrate INFO : add_column ('event', 'region', ) add_column ('event', 'box', ) [2022-08-02 23:11:25] peewee_migrate INFO : add_column ('event', 'box', ) add_column ('event', 'area', ) [2022-08-02 23:11:25] peewee_migrate INFO : add_column ('event', 'area', ) Done 004_add_bbox_region_area [2022-08-02 23:11:25] peewee_migrate INFO : Done 004_add_bbox_region_area Migrate "005_make_end_time_nullable" [2022-08-02 23:11:25] peewee_migrate INFO : Migrate "005_make_end_time_nullable" drop_not_null ('event', 'end_time') [2022-08-02 23:11:25] peewee_migrate INFO : drop_not_null ('event', 'end_time') Done 005_make_end_time_nullable [2022-08-02 23:11:25] peewee_migrate INFO : Done 005_make_end_time_nullable Migrate "006_add_motion_active_objects" [2022-08-02 23:11:25] peewee_migrate INFO : Migrate "006_add_motion_active_objects" add_column ('recordings', 'objects', ) [2022-08-02 23:11:25] peewee_migrate INFO : add_column ('recordings', 'objects', ) add_column ('recordings', 'motion', ) [2022-08-02 23:11:25] peewee_migrate INFO : add_column ('recordings', 'motion', ) Done 006_add_motion_active_objects [2022-08-02 23:11:25] peewee_migrate INFO : Done 006_add_motion_active_objects timed out [cmd] python3 exited 1 [cont-finish.d] executing container finish scripts... [cont-finish.d] done. [s6-finish] waiting for services. [s6-finish] sending all processes the TERM signal.

NickM-27 commented 2 years ago

Okay, maybe try using pastebin then

VictorProgene commented 2 years ago

https://user-images.githubusercontent.com/95300162/182512294-74c2d578-ab86-4c21-8672-73e76bd9592d.png

Here, a screenshoot!

NickM-27 commented 2 years ago

And what is the logs with that config?

VictorProgene commented 2 years ago

[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] done. [services.d] starting services [services.d] done. [2022-08-03 08:02:30] frigate.app INFO : Starting Frigate (0.10.1-83481af) [2022-08-03 08:02:30] frigate.app INFO : Creating directory: /tmp/cache Starting migrations [2022-08-03 08:02:30] peewee_migrate INFO : Starting migrations There is nothing to migrate [2022-08-03 08:02:30] peewee_migrate INFO : There is nothing to migrate [Errno -2] Name or service not known [cmd] python3 exited 1 [cont-finish.d] executing container finish scripts... [cont-finish.d] done. [s6-finish] waiting for services. [s6-finish] sending all processes the TERM signal.

NickM-27 commented 2 years ago

That error means it's unable to find your MQTT server, which is required for frigate to run

VictorProgene commented 2 years ago

Man I did it, It worked!

I restored a backup of my home assistant from before start config frigate, and started since the beguining again, and this time it worked. Maybe there was a bug, and restoring the backup it fixed, idk.

When I configured frigate again i used the link you sent me, thank you so much, really!

VictorProgene commented 2 years ago

Good to know

NickM-27 commented 2 years ago

Glad it's working, you can close this then and if anything comes up feel free to make a new issue 👍

VictorProgene commented 2 years ago

Glad it's working, you can close this then and if anything comes up feel free to make a new issue 👍

Ok, thank you 👍

stale[bot] commented 2 years 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.