blakeblackshear / frigate

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

Crash service and eventually seems to kill hassio (raspberry pi 4 with TPU) #1778

Closed MrLuis closed 3 years ago

MrLuis commented 3 years ago

Describe the bug At least once a day, Frigate becomes unresponsive... If I restart it within a certain time, it works fine... If I don't, then HASSIO becomes unresponsive too... when this happens, I end up doing a hard restart (unplug the power).

If I stop the Frigate service, HASSIO runs fine for days.

Be aware that I have NodeRed doing notifications that request snapshots (to be displayed in notifications). The configuration is at the bottom.

Thanks, Luis

Version of frigate Output from /api/version 0.8.4-5043040

Config file

mqtt:
  host: 192.168.1.232
  user: frigate_mqtt
  password: frigate_mqtt_pass

cameras:
  door_cam:
    motion:
      mask: 319,34,640,30,640,0,325,3
    ffmpeg:
      hwaccel_args:
        - -c:v
        - h264_v4l2m2m
      inputs:
        - path: rtsp://admin:Sealamadre12@192.168.1.94:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp
        - path: rtsp://admin:Sealamadre12@192.168.1.94:554
          roles: 
            - clips
    width: 640
    height: 480
    fps: 5
    objects:
      track:
        - motorcycle
        - bicycle
        - dog
        - cat
        - bird
        - person
        - car
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 2
    rtmp:
      enabled: true
    record:
      enabled: false
      retain_days: 2
    clips:
      enabled: true
      retain:
        default: 2

  garage_cam:
    motion:
      mask: 404,41,640,40,640,0,404,0
    ffmpeg:
      hwaccel_args:
        - -c:v
        - h264_v4l2m2m
      inputs:
        - path: rtsp://a9testuser:a9testpassword@192.168.1.90:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp
        - path: rtsp://a9testuser:a9testpassword@192.168.1.90:554
          roles:
            - clips
    width: 640
    height: 480
    fps: 5
    objects:
      track:
        - motorcycle
        - bicycle
        - dog
        - cat
        - bird
        - person
        - car      
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 2
    rtmp:
      enabled: true
    record:
      enabled: false
      retain_days: 2
    clips:
      enabled: true
      retain:
        default: 2

  front_cam:
    motion:
      mask: 
        -  0,480,640,480,640,272,564,343,371,294,0,368
        - 404,41,640,40,640,0,404,0
        - 0,123,0,0,97,0,96,42
    ffmpeg:
      hwaccel_args:
        - -c:v
        - h264_v4l2m2m 
      inputs:
        - path: rtsp://a9testuser:a9testpassword@192.168.1.75:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp
        - path: rtsp://a9testuser:a9testpassword@192.168.1.75:554
          roles:
            - clips
    width: 640
    height: 480
    fps: 5
    zones:
      driveway:
        coordinates: 569,342,640,341,640,265,440,238,269,276
      walkway:
        coordinates: 461,247,597,229,640,237,518,254,371,297,0,394,0,361
    objects:
      track:
        - motorcycle
        - bicycle
        - dog
        - cat
        - bird
        - person
        - car
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 2
    rtmp:
      enabled: true
    record:
      enabled: false
      retain_days: 2
    clips:
      enabled: true
      retain:
        default: 2

detectors:
  coral:
    # Required: type of the detector
    # Valid values are 'edgetpu' (requires device property below) and 'cpu'.
    type: edgetpu
    # Optional: device name as defined here: https://coral.ai/docs/edgetpu/multiple-edgetpu/#using-the-tensorflow-lite-python-api
    device: usb

Frigate container logs

watchdog.door_cam              INFO    : Terminating the existing ffmpeg process...
watchdog.door_cam              INFO    : Waiting for ffmpeg to exit gracefully...
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 40, in __call__
    handler, values = adapter.match()
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/routing.py", line 1945, in match
    raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 999, in handle_one_response
    self.run_application()
  File "/usr/local/lib/python3.8/dist-packages/geventwebsocket/handler.py", line 87, in run_application
    return super(WebSocketHandler, self).run_application()
  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 945, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 48, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1948, in full_dispatch_request
    rv = self.preprocess_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2242, in preprocess_request
    rv = func()
  File "/opt/frigate/frigate/http.py", line 89, in _db_connect
    database.connect()
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3061, in connect
    raise OperationalError('Connection already opened.')
peewee.OperationalError: Connection already opened.
2021-09-14T13:06:13Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '45354', 'HTTP_HOST': 'ccab4aaf-frigate', (hidden keys: 24)} failed with OperationalError
frigate.video                  INFO    : door_cam: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : door_cam: ffmpeg process is not running. exiting capture thread...
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 40, in __call__
    handler, values = adapter.match()
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/routing.py", line 1945, in match
    raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 999, in handle_one_response
    self.run_application()
  File "/usr/local/lib/python3.8/dist-packages/geventwebsocket/handler.py", line 87, in run_application
    return super(WebSocketHandler, self).run_application()
  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 945, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 48, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1948, in full_dispatch_request
    rv = self.preprocess_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2242, in preprocess_request
    rv = func()
  File "/opt/frigate/frigate/http.py", line 89, in _db_connect
    database.connect()
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3061, in connect
    raise OperationalError('Connection already opened.')
peewee.OperationalError: Connection already opened.
2021-09-14T13:06:18Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '45362', 'HTTP_HOST': 'ccab4aaf-frigate', (hidden keys: 24)} failed with OperationalError
ffmpeg.door_cam.detect         ERROR   : [tcp @ 0x55b6182b90] Connection to tcp://192.168.1.94:554?timeout=5000000 failed: Connection timed out
ffmpeg.door_cam.detect         ERROR   : rtsp://admin:Sealamadre12@192.168.1.94:554/cam/realmonitor?channel=1&subtype=1: Connection timed out
ffmpeg.door_cam.clips          ERROR   : [tcp @ 0x55a3ee8c60] Connection to tcp://192.168.1.94:554?timeout=5000000 failed: Connection timed out
ffmpeg.door_cam.clips          ERROR   : rtsp://admin:Sealamadre12@192.168.1.94:554: Connection timed out
watchdog.door_cam              INFO    : Terminating the existing ffmpeg process...
watchdog.door_cam              INFO    : Waiting for ffmpeg to exit gracefully...

Frigate stats Internal Server Error (when crash).... after I restarted it was...

{
  "detection_fps": 0.0, 
  "detectors": {
    "coral": {
      "detection_start": 0.0, 
      "inference_speed": 16.8, 
      "pid": 37
    }
  }, 
  "door_cam": {
    "camera_fps": 0.0, 
    "capture_pid": 44, 
    "detection_fps": 0.0, 
    "pid": 40, 
    "process_fps": 0.0, 
    "skipped_fps": 0.0
  }, 
  "front_cam": {
    "camera_fps": 6.7, 
    "capture_pid": 53, 
    "detection_fps": 0.0, 
    "pid": 43, 
    "process_fps": 6.7, 
    "skipped_fps": 0.0
  }, 
  "garage_cam": {
    "camera_fps": 0.8, 
    "capture_pid": 48, 
    "detection_fps": 0.0, 
    "pid": 41, 
    "process_fps": 0.8, 
    "skipped_fps": 0.0
  }, 
  "service": {
    "storage": {
      "/dev/shm": {
        "free": 4093.1, 
        "mount_type": "tmpfs", 
        "total": 4095.2, 
        "used": 2.0
      }, 
      "/media/frigate/clips": {
        "free": 436680.2, 
        "mount_type": "ext4", 
        "total": 471815.1, 
        "used": 15932.9
      }, 
      "/media/frigate/recordings": {
        "free": 436680.2, 
        "mount_type": "ext4", 
        "total": 471815.1, 
        "used": 15932.9
      }, 
      "/tmp/cache": {
        "free": 4055.5, 
        "mount_type": "tmpfs", 
        "total": 4095.2, 
        "used": 39.7
      }
    }, 
    "uptime": 493, 
    "version": "0.8.4-5043040"
  }
}

FFprobe from your camera

Run the following command and paste output below

ffprobe <stream_url>

Screenshots If applicable, add screenshots to help explain your problem.

Computer Hardware

Additional context Add any other context about the problem here. I have a few NodeRed flows that sends me notification and that makes URL reference to the API for snapshot.jpg


{
   "message":  $eval(payload).label  & " detected: " & $eval( payload).after.camera &  $eval(payload).zone_description,
   "title":"Image notification",
   "data":{
       "image":"https://myurl.duckdns.org/api/frigate/notifications/" & $eval(payload).after.id & "/snapshot.jpg",
       "clickAction": "lovelace/cameras",
       "url": "ccab4aaf_frigate/"
   }
}

//zone_description is populated on a NodeRed function prior to the notification

let pld = JSON.parse(msg.payload);
pld.label = pld.after.label.charAt(0).toUpperCase() + pld.after.label.slice(1) 
if (pld.before.current_zones.length > 0){
    pld.zone_description = ' (' + pld.before.current_zones.join(', ') + ')';
}
else {
    pld.zone_description = '';
}

msg.payload = JSON.stringify(pld);
return msg;
blakeblackshear commented 3 years ago

Are you using an external USB hub with it's own power supply?

MrLuis commented 3 years ago

It's own power supply... I forgot to mention that Raspberry is booting from USB (Sata) drive... So I have 2 USB connection, one for the boot, one for the Coral TPU.

blakeblackshear commented 3 years ago

See unreleased docs update here: https://github.com/blakeblackshear/frigate/blob/release-0.9.0/docs/docs/installation.md#raspberry-pi-34

MrLuis commented 3 years ago

Oh Snap!!! I'll order the USB hub tonite!

One quick question, the link on the documentation points to a USB Hub that connects to the Host with a USB-C connection. Will that power my Raspberry too? Or should I order the one that connects to the host thru a USB-3.0)?

https://www.amazon.com/dp/B08TT1ZK8G/ref=sspa_dk_detail_3?psc=1&pd_rd_i=B08TT1ZK8G&pd_rd_w=smfw6&pf_rd_p=887084a2-5c34-4113-a4f8-b7947847c308&pd_rd_wg=gMLOx&pf_rd_r=QCXEWTN1AH3QM37VWMGS&pd_rd_r=6ac50dba-034a-4779-adef-d79be5dd892d&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyTDVCTDE0TTZOWTlGJmVuY3J5cHRlZElkPUEwODkxMTgyWUdGQlREQ1dJVzJBJmVuY3J5cHRlZEFkSWQ9QTA0MTQ1NTExRjVCQ0tDOThFRVAmd2lkZ2V0TmFtZT1zcF9kZXRhaWwmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl

or

https://www.amazon.com/dp/B07HMZSRS7/ref=sspa_dk_detail_1?psc=1&pd_rd_i=B07HMZSRS7&pd_rd_w=JLoEc&pf_rd_p=5d846283-ed3e-4512-a744-a30f97c5d738&pd_rd_wg=O723b&pf_rd_r=5RNG8HAY7E43YWRZCE9G&pd_rd_r=b4d855e4-49b3-4c2b-838a-47319ea7bfa3&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExTzFYWEpLTjBIRlVKJmVuY3J5cHRlZElkPUEwMDA4NTgyQzFZTU1HRzNLTDhGJmVuY3J5cHRlZEFkSWQ9QTAxOTA3MzEyM1pVV09UNDMxMERPJndpZGdldE5hbWU9c3BfZGV0YWlsX3RoZW1hdGljJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==

MrLuis commented 3 years ago

Any suggestion on the USB connection? (previous post)

blakeblackshear commented 3 years ago

You will connect to the USB3 port on the Pi and plug the power in separately. I would keep powering the Pi with it's own power supply.

MrLuis commented 3 years ago

I finally got around to place the order. Should we close this issue, or wait until I test with the USB Hub? I'm open to either one!

MrLuis commented 3 years ago

Just set up the USB Hub, and reboot without a problem. Boot fine (from external USB-SATA drive, and TPU found with no modifications need it... now it's a matter of waiting...

 * Starting nginx nginx
   ...done.
frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
peewee_migrate                 INFO    : There is nothing to migrate
frigate.mqtt                   INFO    : MQTT connected
detector.coral                 INFO    : Starting detection process: 37
frigate.edgetpu                INFO    : Attempting to load TPU as usb
frigate.app                    INFO    : Camera processor started for door_cam: 40
frigate.app                    INFO    : Camera processor started for garage_cam: 42
frigate.app                    INFO    : Camera processor started for front_cam: 43
frigate.app                    INFO    : Capture process started for door_cam: 44
frigate.app                    INFO    : Capture process started for garage_cam: 47
frigate.app                    INFO    : Capture process started for front_cam: 48
frigate.edgetpu                INFO    : TPU found

Just for reference, this is the hub I got.

https://www.amazon.com/gp/product/B0838STJDJ/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

MrLuis commented 3 years ago

Unfortunately, it happened again... This time I couldn't get the log, since the full system was unresponsive. I checked the CPU history, and this seems to happened w around 5 am (eastern time). But since I had to restart the system the log on Frigate was reset. :(

MrLuis commented 3 years ago

Be aware that I couldn't make the memory modification because Hassio does not provide direct access to the config file... I'm considering to change home assistant to a Supervise version. But not sure if it will have any impact on this issue. It will suc$s if I go thru that process to end up in the same place.

blakeblackshear commented 3 years ago

You can take the sd card out and modify it with a card reader.

MrLuis commented 3 years ago

Got it again. This time I was able to get the log...

rv = self.preprocess_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2242, in preprocess_request
    rv = func()
  File "/opt/frigate/frigate/http.py", line 89, in _db_connect
    database.connect()
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3061, in connect
    raise OperationalError('Connection already opened.')
peewee.OperationalError: Connection already opened.
2021-09-18T00:05:44Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '45646', 'HTTP_HOST': 'ccab4aaf-frigate', (hidden keys: 24)} failed with OperationalError
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 40, in __call__
    handler, values = adapter.match()
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/routing.py", line 1945, in match
    raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 999, in handle_one_response
    self.run_application()
  File "/usr/local/lib/python3.8/dist-packages/geventwebsocket/handler.py", line 87, in run_application
    return super(WebSocketHandler, self).run_application()
  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 945, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 48, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1948, in full_dispatch_request
    rv = self.preprocess_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2242, in preprocess_request
    rv = func()
  File "/opt/frigate/frigate/http.py", line 89, in _db_connect
    database.connect()
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3061, in connect
    raise OperationalError('Connection already opened.')
peewee.OperationalError: Connection already opened.
2021-09-18T00:05:49Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '45678', 'HTTP_HOST': 'ccab4aaf-frigate', (hidden keys: 24)} failed with OperationalError
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 40, in __call__
    handler, values = adapter.match()
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/routing.py", line 1945, in match
    raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 999, in handle_one_response
    self.run_application()
  File "/usr/local/lib/python3.8/dist-packages/geventwebsocket/handler.py", line 87, in run_application
    return super(WebSocketHandler, self).run_application()
  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 945, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 48, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1948, in full_dispatch_request
    rv = self.preprocess_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2242, in preprocess_request
    rv = func()
  File "/opt/frigate/frigate/http.py", line 89, in _db_connect
    database.connect()
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3061, in connect
    raise OperationalError('Connection already opened.')
peewee.OperationalError: Connection already opened.
2021-09-18T00:05:54Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '45690', 'HTTP_HOST': 'ccab4aaf-frigate', (hidden keys: 24)} failed with OperationalError
blakeblackshear commented 3 years ago

This is fixed in the upcoming 0.9.0 release.

MrLuis commented 3 years ago

Update. Since I added the hub, Hassio no longer crashes... Frigate still gives me the error, but stability definitely improved. I'm planning to move to a Supeised version of hassio sometime next week. I feel (personal opinion) it's easy to update OS setting, plus I can use the hardware a bit more. Right now, the CPU usage is around 25%, Memory is 20%, and disk usage around 5%... I'm planning to setup nextcloud around it later on (after moving to Supervised).

Luis

MrLuis commented 3 years ago

Update... After the update for 2.0 HassIO has not frozen. I had to restart the Frigate service a few times, but I was messing with the configuration (learning the changes on the config). Once everything is set up, it seems stable.

Note: I was able to finally change the gpu_mem by using an alternate sd card temporarily, and once is done, the CPU average usage goes down from 35 to around 22%.

Thanks!