blakeblackshear / frigate

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

[Support]: Restart not working from HA sidebar #4079

Closed Frankenberrypi closed 2 years ago

Frankenberrypi commented 2 years ago

Describe the problem you are having

I have a seemingly stable instance of Frigate running via the Home Assistant addon for a supervised installation. Restarting Frigate via HA settings -> Add-ons -> Frigate -> red RESTART button works fine. I see camera processors starting, an epoll message, the TPU starting, then the log usually stops.
Restarting Frigate via the HA Frigate sidebar -> three dots in the top right -> Restart Frigate does not work. Logs below.
After a failed restart, going into the Add-ons and clicking the red START works fine.

Version

0.11.1 Full Access

Frigate config file

mqtt:
  host: 192.168.1.xxx
  user: user
  password: password

#ffmpeg:
#  hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p

birdseye:
  enabled: False

database:
  path: /config/frigate.db

detectors:
  coral:
    type: edgetpu
    device: usb
#  cpu:
#    type: cpu
#    num_threads: 2

#Global Object Settings
objects:
  track:
    - person
    - dog
  filters:
    person:
      min_area: 500
      max_area: 70000
    dog:
      min_area: 300
      max_area: 20000
    car:
      min_area: 300

cameras:
  Front_Door_Camera:
    ffmpeg:
      inputs:
        # Low resolution stream
        - path: rtsp://user:password@192.168.3.xxx:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - rtmp
            - detect
        # High Resolution Stream
        - path: rtsp://user:password@192.168.3.xxx:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - record
    detect:
      width: 704
      height: 480
    snapshots:
      enabled: True
    record:
      enabled: True
      retain:
        days: 1
      events:
        retain:
          default: 10

  Patio_Camera:
    ffmpeg:
      inputs:
        # Low resolution stream
        - path: rtsp://user:password@192.168.3.xxx:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - rtmp
            - detect
        # High Resolution Stream
        - path: rtsp://user:password@192.168.3.xxx:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - record
    detect:
      width: 704
      height: 480
    snapshots:
      enabled: True
    record:
      enabled: True
      retain:
        days: 1
      events:
        retain:
          default: 10
    motion:
      threshold: 20
      contour_area: 20
      frame_height: 100
      mask:
        - 0,0,704,0,704,480,0,480,0,412,328,307,588,307,628,125,297,79,0,190

  Driveway_Camera:
    ffmpeg:
      inputs:
        # Low resolution stream
        - path: rtsp://user:password@192.168.3.xxx:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - rtmp
            - detect
        # High Resolution Stream
        - path: rtsp://user:password@192.168.3.xxx:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - record
    detect:
      width: 704
      height: 480
    objects:
      track:
        - car
        - person
        - dog
    snapshots:
      enabled: True
    record:
      enabled: True
      retain:
        days: 1
      events:
        retain:
          default: 10

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-10-13 12:07:41] frigate.app                    INFO    : Starting Frigate (0.11.1-2eada21)
[2022-10-13 12:07:41] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2022-10-13 12:07:41] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-10-13 12:07:41] peewee_migrate                 INFO    : There is nothing to migrate
[2022-10-13 12:07:41] detector.coral                 INFO    : Starting detection process: 216
[2022-10-13 12:07:41] frigate.app                    INFO    : Output process started: 218
[2022-10-13 12:07:41] ws4py                          INFO    : Using epoll
[2022-10-13 12:07:41] frigate.app                    INFO    : Camera processor started for Front_Door_Camera: 227
[2022-10-13 12:07:41] frigate.app                    INFO    : Camera processor started for Patio_Camera: 228
[2022-10-13 12:07:41] frigate.app                    INFO    : Camera processor started for Driveway_Camera: 229
[2022-10-13 12:07:41] frigate.app                    INFO    : Capture process started for Front_Door_Camera: 231
[2022-10-13 12:07:41] frigate.app                    INFO    : Capture process started for Patio_Camera: 235
[2022-10-13 12:07:41] frigate.app                    INFO    : Capture process started for Driveway_Camera: 237
[2022-10-13 12:07:42] ws4py                          INFO    : Using epoll
[2022-10-13 12:07:41] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2022-10-13 12:07:44] frigate.edgetpu                INFO    : TPU found
[2022-10-13 12:08:00] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:48866]
[2022-10-13 12:09:52] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:48866]
[2022-10-13 12:14:16] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:58856]
[2022-10-13 12:15:00] frigate.app                    INFO    : Stopping...
[2022-10-13 12:15:00] ws4py                          INFO    : Closing all websockets with [1001] 'Server is shutting down'
[2022-10-13 12:15:00] frigate.record                 INFO    : Exiting recording maintenance...
[2022-10-13 12:15:00] frigate.watchdog               INFO    : Exiting watchdog...
[2022-10-13 12:15:00] frigate.object_processing      INFO    : Exiting object processor...
[2022-10-13 12:15:00] frigate.stats                  INFO    : Exiting watchdog...
[2022-10-13 12:15:00] frigate.record                 INFO    : Exiting recording cleanup...
[2022-10-13 12:15:00] frigate.events                 INFO    : Exiting event cleanup...
[2022-10-13 12:15:09] frigate.events                 INFO    : Exiting event processor...
[2022-10-13 12:15:09] peewee.sqliteq                 INFO    : writer received shutdown request, exiting.
[2022-10-13 12:15:09] root                           INFO    : Waiting for detection process to exit gracefully...
/usr/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 9 leaked shared_memory objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
[cmd] python3 exited 0
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

FFprobe output from your camera

Doesn't seem to be related to camera streams.

Frigate stats

No response

Operating system

Debian

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Amcrest IP5M-T1179EW and IP8M-T2599EW

Any other information that may be helpful

No response

NickM-27 commented 2 years ago

I think this is a duplicate of https://github.com/blakeblackshear/frigate/issues/3880

Frankenberrypi commented 2 years ago

Yes, appears to be a duplicate. Sorry my search wasn't thorough enough.

NickM-27 commented 2 years ago

No problem, feel free to leave comments there.