blakeblackshear / frigate

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

[Support]: Home Assistant 2010.10.x Update, Frigate Broken #1960

Closed Normanras closed 3 years ago

Normanras commented 3 years ago

Describe the problem you are having

After updating my Home Assistant to 2010.10 (both .0 and .1), Frigate has stopped working. Someone else commented in HA Communities with the same issue. I've attached what shows up on my integrations page.

frigate_HA_Integration_Error

I've already tried a few different fixes, such as:

Note, during all those tests, I restarted my HA server after every change.

It seems like the HA updated broke something in where Frigate should be pointing to gather API information - such as my IP - but I'm not sure if HA is broken within itself, or if it pushed Frigate off course. I'm going to look through the code as best I can soon.

Version

2.0

Frigate config file

mqtt:
  host: IP_ADDR
  port: 1883
  client_id: "frigate"
  user: USER
  password: PASS

detectors:
  coral:
    type: edgetpu
    device: usb

birdseye:
  enabled: True
  quality: 8
  mode: objects

cameras:
  north:
    ffmpeg:
      inputs:
        - path:  rtsp://USER:PASS@IP_ADDR:554/h264Preview_01_main
          roles:
            - detect
            - rtmp
    detect:
      width: 2560
      height: 1920
      fps: 5

    zones:
      north1:    
        coordinates: 997,989,968,1920,2560,1920,2560,848,1736,611,1320,579
      north2:
        coordinates: 2531,472,2560,675,0,541,197,416
      north3:
        coordinates: 2560,476,2560,0,751,0,797,444

    record:
      enabled: False

    rtmp:
      enabled: True

    snapshots:
      enabled: True
      timestamp: True
      bounding_box: True
      retain:
        default: 10

    mqtt:
      enabled: True
      timestamp: True
      bounding_box: True

    objects:
      track:
        - person
        - dog
        - cat

  south:
    ffmpeg:
      inputs:
        - path: rtsp://USER:PASS@IP_ADDR:554/h264Preview_01_main
          roles:
            - detect
            - rtmp
    detect:
      width: 2560
      height: 1920
      fps: 5
    zones:
      south1:
        coordinates: 2560,1336,2560,645,2389,549,2102,1138,2247,1434,2560,1855
      south2:
        coordinates: 0,1920,0,1000,507,764,2018,649,2425,1920
      south3:
        coordinates: 1738,26,2121,383,2109,603,1044,621,42,766,0,0
      south4:
        coordinates: 2560,652,2560,0,1866,0,1766,82

    clips:
      enabled: False

    rtmp:
      enabled: True

    snapshots:
      enabled: True
      timestamp: True
      bounding_box: True
      retain:
        default: 10

    mqtt:
      enabled: True
      timestamp: True
      bounding_box: True

    objects:
      track:
        - person
        - dog
        - cat

Relevant log output

`2021-10-08 09:10:26 ERROR (MainThread) [custom_components.frigate.api] Error fetching information from http://ccab4aaf-frigate:5000/api/stats: Cannot connect to host ccab4aaf-frigate:5000 ssl:default [Connect call failed ('172.30.33.5', 5000)]`
`2021-10-08 09:11:46 ERROR (MainThread) [custom_components.frigate.api] Error fetching information from http://ccab4aaf-frigate:5000/api/stats: 502, message='Bad Gateway', url=URL('http://ccab4aaf-frigate:5000/api/stats')

Logger: custom_components.frigate.api
Source: custom_components/frigate/api.py:157
Integration: Frigate (documentation, issues)
First occurred: 9:01:26 AM (4 occurrences)
Last logged: 9:06:13 AM

Timeout error fetching information from http://ccab4aaf-frigate:5000/api/stats:

FFprobe output from your camera

Unavailable due to error

Frigate stats

Unavailable due to error

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Reolink 520

Any other information that may be helpful

No response

andye2801 commented 3 years ago

Without trying to be "that guy" have you looked at the release notes? https://github.com/blakeblackshear/frigate/releases/tag/v0.9.1

There are some breaking changes including "Due to regular confusion about which input the height/width/fps applied to, these settings have been moved under the detect section of the config. Here is an example of a simple config:"

Normanras commented 3 years ago

I mean you should be that guy, most people don't read. Although, I did and I do know my frigate.yml is quite messy. That being said. Frigate 0.9.x and 0.2.0 were working without issue when HomeAssistant was still in 2021.9.x. It was only the HA update that seemed to cause the issue, and the errors seem to be due to the API's URL.

Now that I'm typing that out, I'm wondering if HA inadvertently closed port 5000. I'll re-read their release notes as well.

EDIT: Just updated my config file and the problem has persisted. I've updated my file in the original support request.

Gahrlaag commented 3 years ago

I have the exact same issue. "[2021-10-08 18:25:06] frigate.app INFO : Starting Frigate (0.9.1-800f33e) Error parsing config: 12 validation errors for FrigateConfig mqtt -> password Password must be provided with username. (type=value_error) cameras -> huvudingangen -> ffmpeg -> inputs -> 0 -> roles -> 2 value is not a valid enumeration member; permitted: 'record', 'rtmp', 'detect' (type=type_error.enum; enum_values=[<CameraRoleEnum.record: 'record'>, <CameraRoleEnum.rtmp: 'rtmp'>, <CameraRoleEnum.detect: 'detect'>]) cameras -> huvudingangen -> clips extra fields not permitted (type=value_error.extra) cameras -> huvudingangen -> fps extra fields not permitted (type=value_error.extra) cameras -> huvudingangen -> height extra fields not permitted (type=value_error.extra) cameras -> huvudingangen -> width extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> ffmpeg -> inputs -> 0 -> roles -> 2 value is not a valid enumeration member; permitted: 'record', 'rtmp', 'detect' (type=type_error.enum; enum_values=[<CameraRoleEnum.record: 'record'>, <CameraRoleEnum.rtmp: 'rtmp'>, <CameraRoleEnum.detect: 'detect'>]) cameras -> uppfarten -> clips extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> fps extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> height extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> width extra fields not permitted (type=value_error.extra) clips extra fields not permitted (type=value_error.extra)"

From the log

lcnittl commented 3 years ago

I have the exact same issue. "[2021-10-08 18:25:06] frigate.app INFO : Starting Frigate (0.9.1-800f33e) Error parsing config: 12 validation errors for FrigateConfig mqtt -> password Password must be provided with username. (type=value_error) cameras -> huvudingangen -> ffmpeg -> inputs -> 0 -> roles -> 2 value is not a valid enumeration member; permitted: 'record', 'rtmp', 'detect' (type=type_error.enum; enum_values=[<CameraRoleEnum.record: 'record'>, <CameraRoleEnum.rtmp: 'rtmp'>, <CameraRoleEnum.detect: 'detect'>]) cameras -> huvudingangen -> clips extra fields not permitted (type=value_error.extra) cameras -> huvudingangen -> fps extra fields not permitted (type=value_error.extra) cameras -> huvudingangen -> height extra fields not permitted (type=value_error.extra) cameras -> huvudingangen -> width extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> ffmpeg -> inputs -> 0 -> roles -> 2 value is not a valid enumeration member; permitted: 'record', 'rtmp', 'detect' (type=type_error.enum; enum_values=[<CameraRoleEnum.record: 'record'>, <CameraRoleEnum.rtmp: 'rtmp'>, <CameraRoleEnum.detect: 'detect'>]) cameras -> uppfarten -> clips extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> fps extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> height extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> width extra fields not permitted (type=value_error.extra) clips extra fields not permitted (type=value_error.extra)"

From the log

Are you sure it is the same issue? your log reads e.g.:

cameras -> huvudingangen -> ffmpeg -> inputs -> 0 -> roles -> 2
value is not a valid enumeration member; permitted: 'record', 'rtmp', 'detect' (type=type_error.enum; enum_values=[<CameraRoleEnum.record: 'record'>, <CameraRoleEnum.rtmp: 'rtmp'>, <CameraRoleEnum.detect: 'detect'>])
cameras -> huvudingangen -> clips
extra fields not permitted (type=value_error.extra)

which hints that you updated to frigate add-on version 2.0 but are still using a 1.x config.

Cf. release notes for frigate v0.9.1 on how to fix this

Gahrlaag commented 3 years ago

I have the exact same issue. "[2021-10-08 18:25:06] frigate.app INFO : Starting Frigate (0.9.1-800f33e) Error parsing config: 12 validation errors for FrigateConfig mqtt -> password Password must be provided with username. (type=value_error) cameras -> huvudingangen -> ffmpeg -> inputs -> 0 -> roles -> 2 value is not a valid enumeration member; permitted: 'record', 'rtmp', 'detect' (type=type_error.enum; enum_values=[<CameraRoleEnum.record: 'record'>, <CameraRoleEnum.rtmp: 'rtmp'>, <CameraRoleEnum.detect: 'detect'>]) cameras -> huvudingangen -> clips extra fields not permitted (type=value_error.extra) cameras -> huvudingangen -> fps extra fields not permitted (type=value_error.extra) cameras -> huvudingangen -> height extra fields not permitted (type=value_error.extra) cameras -> huvudingangen -> width extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> ffmpeg -> inputs -> 0 -> roles -> 2 value is not a valid enumeration member; permitted: 'record', 'rtmp', 'detect' (type=type_error.enum; enum_values=[<CameraRoleEnum.record: 'record'>, <CameraRoleEnum.rtmp: 'rtmp'>, <CameraRoleEnum.detect: 'detect'>]) cameras -> uppfarten -> clips extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> fps extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> height extra fields not permitted (type=value_error.extra) cameras -> uppfarten -> width extra fields not permitted (type=value_error.extra) clips extra fields not permitted (type=value_error.extra)" From the log

Are you sure it is the same issue? your log reads e.g.:

cameras -> huvudingangen -> ffmpeg -> inputs -> 0 -> roles -> 2
value is not a valid enumeration member; permitted: 'record', 'rtmp', 'detect' (type=type_error.enum; enum_values=[<CameraRoleEnum.record: 'record'>, <CameraRoleEnum.rtmp: 'rtmp'>, <CameraRoleEnum.detect: 'detect'>])
cameras -> huvudingangen -> clips
extra fields not permitted (type=value_error.extra)

which hints that you updated to frigate add-on version 2.0 but are still using a 1.x config.

Cf. release notes for frigate v0.9.1 on how to fix this

Yes, you're right! I corrected the config after I posted this but the MQTT password error is still there unfortunately

Gahrlaag commented 3 years ago

OK! So I removed the "username" part of my config and suddenly it works..? but I don't have a PW on my MQTT server (seeing as it's an internal server) and I'm not able to use just a username without a password..?

blakeblackshear commented 3 years ago

@Normanras make sure the frigate addon is running and functional. I think this is an error in home assistant because it is trying to connect to the frigate addon when it isn't running.

Normanras commented 3 years ago

Sure - let me check in a few moments @blakeblackshear and I'll let you know.

I don't know enough about HA's code and how it handled add-ons. I'll take a peek over there but if you have any tips on where to start, that would be helpful

Normanras commented 3 years ago

Unfortunately, the situation is still the same. Feel free to close this if the problem is indeed with HA. I suspect you're right as it seems from their community forums that more than one integration isn't working with this latest update.

blakeblackshear commented 3 years ago

It's possible they changed the way the host names resolve for addons. I didn't see anything in the release notes.

EddyYama commented 3 years ago

I have the same issue after HA 2010.10 update. In Integration, input Host url "http://ccab4aaf-frigate:5000" and hit SUBMIT, then it returns "Unable to connect to Frigate."

Normanras commented 3 years ago

@EddyYama I ended up restoring to a backup that I believe was HA 9.7. I deleted Frigate, changed my frigate.yml to the new specifications, and then installed it again and updated it to the current version. I am getting no errors anywhere except when I go to my integrations and try to add the Frigate Integration. It has my URL the same as yours (http://ccab4aaf-frigate:5000) and it is unable to connect. So I'm not sure why it is all of a sudden not working.

Any thoughts, @blakeblackshear ?

lcnittl commented 3 years ago

I have the same issue after HA 2010.10 update. In Integration, input Host url "http://ccab4aaf-frigate:5000" and hit SUBMIT, then it returns "Unable to connect to Frigate."

Can you check the hostname on the add-on info page? Is it possible that you have the "full access" version installed? I had, and its hostname is suffixed with -fa: ccab4aaf-frigate-fa.

Are you able to ping any of the 2 hostnames in the Terminal & SSH add-on?

Normanras commented 3 years ago

@lcnittl good suggestions. I just checked and in the add-on, my hostname is indeed ccab4aaf-frigate. In the Terminal, I can ping the non-fa hostname, but ccab4aaf-frigate-fa returns ping: bad address ccab4aaf-frigate-fa.

I'm wondering if something is just blocking the port since the host is alive and well.

Side note: I just went the add-on store (to see if there was an nmap add-on for the port search), and now there are more Frigate hass.io addons.

If Full Access worked for you, I might try that next.

EDIT: Just got rid of the regular add-on and tried full access with the new hostname, but no dice. Still won't connect. Going to try a few more things and will try to come back here to report back.

blakeblackshear commented 3 years ago

Did you ever figure this out? I am able to curl http://ccab4aaf-frigate:5000/api/version from inside the home assistant container just fine in my supervised test environment with the latest changes.

EddyYama commented 3 years ago

Recently my raspberry pi 4 stopped working, so I had to install all integrations from scratch. At that time, there was no issue connecting to http://ccab4aaf-frigate:5000.

Normanras commented 3 years ago

@blakeblackshear It did start working, but I'm not 100% sure why yet. For some reason the log wasn't populating so I had no knowledge of what was going wrong. That being said, I must have messed with my yml at some point and therefore it was starting the add-on but not opening the port/connection. Either way, it is working now. If I figure it out and think it is a bug, I'll bring it up.