Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Support]: Frigate causes my system to crash and reboot #6469

Closed
Inrego opened this issue May 12, 2023 · 41 comments
Closed

[Support]: Frigate causes my system to crash and reboot #6469

Inrego opened this issue May 12, 2023 · 41 comments

Comments

@Inrego
Copy link

Inrego commented May 12, 2023

Describe the problem you are having

When running frigate, my system will frequently crash and reboot.
I've recently built a new server, and copied the config from my old server to the new. I'm using a Coral TPU on USB.
There's not really anything in logs to indicate the issue as far as I can see (I've check syslog and many other places before I figured out it was related to Frigate).

Version

latest tag on Docker

Frigate config file

mqtt:
  host: xxx
  user: xxx
  password: xxx
detectors:
  coral:
    type: edgetpu
    device: usb
database:
  path: /db/frigate.db
objects:
  track:
    - person
    - cat
    - dog
    - horse
    - car
ffmpeg:
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000
  output_args:
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy
go2rtc:
  streams:
    carport: ffmpeg:http://192.168.20.50/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=xxx
    carport_sub: ffmpeg:http://192.168.20.50/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=xxx
    port_2: ffmpeg:http://192.168.20.71/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=xxx
    port_2_sub: ffmpeg:http://192.168.20.71/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=xxx
cameras:
  carport:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/carport?video=copy&audio=aac
          input_args: preset-rtsp-restream
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/carport_sub?video=copy
          input_args: preset-rtsp-restream
          roles:
            - detect
    detect:
      width: 896
      height: 512
      fps: 7
    zones:
      indkørsel_2:
        coordinates: 666,144,596,336,444,491,108,379,292,140
        objects:
          - car
  port_2:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/port_2?video=copy&audio=aac
          input_args: preset-rtsp-restream
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/port_2_sub?video=copy
          input_args: preset-rtsp-restream
          roles:
            - detect
    detect:
      width: 896
      height: 512
      fps: 7

snapshots:
  enabled: True
  bounding_box: True

Relevant log output

2023-05-10T12:40:48.457690792Z 2023-05-10 14:40:48.457538893  [2023-05-10 14:40:48] frigate.app                    INFO    : Starting Frigate (0.12.0-da3e197)
2023-05-10T12:40:48.465742856Z 2023-05-10 14:40:48.465622950  [2023-05-10 14:40:48] peewee_migrate                 INFO    : Starting migrations
2023-05-10T12:40:48.467134387Z 2023-05-10 14:40:48.467005445  [2023-05-10 14:40:48] peewee_migrate                 INFO    : There is nothing to migrate
2023-05-10T12:40:48.472282327Z 2023-05-10 14:40:48.472141986  [2023-05-10 14:40:48] detector.coral                 INFO    : Starting detection process: 1297
2023-05-10T12:40:51.108836111Z 2023-05-10 14:40:51.108660164  [2023-05-10 14:40:48] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-05-10T12:40:51.110713388Z 2023-05-10 14:40:51.110579703  [2023-05-10 14:40:51] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-05-10T12:40:51.110848556Z 2023-05-10 14:40:51.110698609  [2023-05-10 14:40:48] frigate.app                    INFO    : Output process started: 1298
2023-05-10T12:40:51.110854376Z 2023-05-10 14:40:51.110699980  [2023-05-10 14:40:48] frigate.app                    INFO    : Camera processor started for carport: 1305
2023-05-10T12:40:51.110860169Z 2023-05-10 14:40:51.110707230  [2023-05-10 14:40:48] frigate.app                    INFO    : Camera processor started for port_2: 1307
2023-05-10T12:40:51.110950721Z 2023-05-10 14:40:51.110827136  [2023-05-10 14:40:48] frigate.app                    INFO    : Capture process started for carport: 1309
2023-05-10T12:40:51.110956476Z 2023-05-10 14:40:51.110828531  [2023-05-10 14:40:48] frigate.app                    INFO    : Capture process started for port_2: 1312
2023-05-10T12:40:57.953726505Z 2023-05-10 14:40:57.953461821  [INFO] Starting go2rtc healthcheck service...
2023-05-10T12:47:38.497654478Z 2023-05-10 14:47:38.497478545  [2023-05-10 14:47:38] watchdog.carport               INFO    : No frames received from carport in 20 seconds. Exiting ffmpeg...
2023-05-10T12:47:38.497671155Z 2023-05-10 14:47:38.497480774  [2023-05-10 14:47:38] watchdog.carport               INFO    : Waiting for ffmpeg to exit gracefully...
2023-05-10T12:47:38.522694884Z 2023-05-10 14:47:38.522623418  [2023-05-10 14:47:38] frigate.video                  ERROR   : carport: Unable to read frames from ffmpeg process.
2023-05-10T12:47:38.522704642Z 2023-05-10 14:47:38.522630711  [2023-05-10 14:47:38] frigate.video                  ERROR   : carport: ffmpeg process is not running. exiting capture thread...
2023-05-10T12:47:48.525644945Z 2023-05-10 14:47:48.525504625  [2023-05-10 14:47:48] watchdog.carport               ERROR   : Ffmpeg process crashed unexpectedly for carport.
2023-05-10T12:47:48.525677261Z 2023-05-10 14:47:48.525506968  [2023-05-10 14:47:48] watchdog.carport               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-10T12:47:48.525679712Z 2023-05-10 14:47:48.525518226  [2023-05-10 14:47:48] ffmpeg.carport.detect          ERROR   : rtsp://127.0.0.1:8554/carport_sub?video=copy: Connection timed out
2023-05-10T13:18:48.499677690Z s6-rc: info: service s6rc-fdholder: starting
2023-05-10T13:18:48.499780105Z s6-rc: info: service s6rc-oneshot-runner: starting
2023-05-10T13:18:48.502407933Z s6-rc: info: service s6rc-oneshot-runner successfully started
2023-05-10T13:18:48.502592704Z s6-rc: info: service fix-attrs: starting
2023-05-10T13:18:48.502663289Z s6-rc: info: service s6rc-fdholder successfully started
2023-05-10T13:18:48.505408870Z s6-rc: info: service fix-attrs successfully started
2023-05-10T13:18:48.505433585Z s6-rc: info: service legacy-cont-init: starting
2023-05-10T13:18:48.506959771Z s6-rc: info: service legacy-cont-init successfully started
2023-05-10T13:18:48.507011690Z s6-rc: info: service log-prepare: starting
2023-05-10T13:18:48.518726214Z s6-rc: info: service log-prepare successfully started
2023-05-10T13:18:48.518763388Z s6-rc: info: service nginx-log: starting
2023-05-10T13:18:48.518807467Z s6-rc: info: service go2rtc-log: starting
2023-05-10T13:18:48.518871181Z s6-rc: info: service frigate-log: starting
2023-05-10T13:18:48.519448701Z s6-rc: info: service nginx-log successfully started
2023-05-10T13:18:48.519545821Z s6-rc: info: service go2rtc-log successfully started
2023-05-10T13:18:48.519601581Z s6-rc: info: service go2rtc: starting

FFprobe output from your camera

N/A

Frigate stats

No response

Operating system

Other Linux

Install method

Docker CLI

Coral version

USB

Network connection

Wired

Camera make and model

Reolink RLC-810A

Any other information that may be helpful

The crash happened at 13:18 in the logs. As you can see, not really much to go from.
I'm unsure if the issue is due to the CPU BIG.little architecture with small (E) and big (P) cores. The CPU is an Intel Core i9-13900K
I know some other software like Sonarr had issues with this, but it just ran very unstable, it didn't crash the whole system.
But, I've seen people mention on reddit using Frigate with 12th gen CPU's without issue, and these also use P and E cores.
For now, I've shut down Frigate and now the server is running fine without reboots. I've also done some stress-testing of my CPU to check for issues under heavy load. But it just runs without issues.
I also have netdata monitoring on the server, and from there I can tell that it doesn't look like an overheating issue.

@stevenbrown1862
Copy link

I don't know whether we have the same issue but I also get lots of system crashes with version 0.12 but only when I connect to cameras that are restreamed through go2rtc. I have to use restream because I have a couple of Nest cameras that change their url every 5 mins. I'm now running 2 frigate instances, my direct connection cameras running 0.12 and the restreamed nest cameras running on 0.11. Not ideal because I really like 0.12 but I've gone almost 2 weeks without a system crash like this. It doesn't appear to be the go2rtc part because I'm using the inbuilt go2rtc in 0.12 to do the restreaming for the 0.11 instance. Bit of a ramble but I hope it makes sense.

@xbmcnut
Copy link

xbmcnut commented May 12, 2023

@Inrego I too am having issues recently since v11 but my system is running HA Core on firstly an Intel NUC Core i7 5th Gen and now a Beelink SEi12 with a 12th Gen Intel Core i5. Full story here https://community.home-assistant.io/t/catastrophic-core-failure-after-add-on-crash-advice-needed-for-logging-and-debug/568668.

My problem is, HA doesn't reboot it dies completely which is maddening. It's happened 3 times in the last week. For now, I've disabled the HA Frigate add-on while I await guidance from someone on how to configure logs that are relevant and persistent, because like you, the logs I can access have nothing relevant.

@HAuser1234
Copy link

Same Problem here. Since updating to v0.12 Homeassistant crashes and does not reboot. All system ressources seem to be OK, so no memory leak.
Reverting back to v0.11 solves the crashing!

I am having this issue since the release of V0.12 and have so far not found any solution.

I hope there is a solution because V0.12 behaves much better in every other regard

@stevenbrown1862
Copy link

Same Problem here. Since updating to v0.12 Homeassistant crashes and does not reboot. All system ressources seem to be OK, so no memory leak. Reverting back to v0.11 solves the crashing!

I am having this issue since the release of V0.12 and have so far not found any solution.

I hope there is a solution because V0.12 behaves much better in every other regard

Are you consuming the restream of any cameras? If so have you tried connecting directly?

@HAuser1234
Copy link

HAuser1234 commented May 13, 2023

I use the home assistant frigate Integration to restream the camera feeds directly from frigate I think 🤔.
The cameras are directly streaming to frigate.

Would be great to keep using that since it allows for a pretty low delay stream display in Homeassistant
@blakeblackshear maybe do you have any ideas on where the problem is or how to debug it?

Another interesting side effect ist that since reverting to V0.11 no clips are recorded anymore!

@blakeblackshear
Copy link
Owner

blakeblackshear commented May 13, 2023

I would suggest using 0.12 without any go2rtc configuration to see if things still crash.

As is mentioned in the release notes, you can't simply downgrade because the database has been upgraded and is not compatible with 0.11.

@HAuser1234
Copy link

HAuser1234 commented May 13, 2023

I would suggest using 0.12 without any go2rtc configuration to see if things still crash.

As is mentioned in the release notes, you can't simply downgrade because the database has been upgraded and is not compatible with 0.11.

Actually there is no go2rtc in my config as it is not needed in my case for a pretty good experience with Homeassistant.
And it crashes without it every 1-2 days sometimes even faster.

Ok I understand for now it will have to stay at v0.11 because of it crashing the whole Server

@blakeblackshear
Copy link
Owner

@HAuser1234 I'm just stabbing into the dark here since this isn't your issue and you haven't provided any of the information we ask for in a support request. I would recommend opening your own issue so I can suggest some things to try.

@xbmcnut
Copy link

xbmcnut commented May 13, 2023

Can you please offer some advice for the recommended log configuration that would remain persistent if the hardware is restarted? That way we can all open our own issue and provide the most helpful logs?

@NickM-27
Copy link
Collaborator

The default logs from frigate will suffice if there are errors and well most likely need system logs, htop, etc to understand why the system is hanging.

@blakeblackshear
Copy link
Owner

@Inrego I would suggest removing this from your config since it's no longer doing anything:

ffmpeg:
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000
  output_args:
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy

We will start by backing things out to see what is causing the issues. I would recommend trying the following and seeing if it still crashes.

  1. Disable detect in your config:
    detect:
      enabled: False
  2. Remove the go2rtc section from your config and configure frigate to connect directly to the camera streams like you had in 0.11. Don't forget to use the new preset preset-http-reolink.

@blakeblackshear
Copy link
Owner

Can you please offer some advice for the recommended log configuration that would remain persistent if the hardware is restarted? That way we can all open our own issue and provide the most helpful logs?

Frigate's logs are written to stdout and captured by the standard docker logging mechanisms. You don't need the files stored inside the container. https://stackoverflow.com/questions/36666246/docker-look-at-the-log-of-an-exited-container

@blakeblackshear
Copy link
Owner

You could try adding a volume mount of - ./host-log-folder:/dev/shm/logs to get the files to write to disk.

@HAuser1234
Copy link

@HAuser1234 I'm just stabbing into the dark here since this isn't your issue and you haven't provided any of the information we ask for in a support request. I would recommend opening your own issue so I can suggest some things to try.

@blakeblackshear in #6477 I have opened a new issue on this

@my-umd
Copy link
Contributor

my-umd commented May 16, 2023

Mind sharing your docker run command to create the container? I have been fighting with a similar issue (#5976) without any success. I understand that the cause of my issue could be completely different from yours.

Maybe you can try this. It did not fix mine, instead it makes the issue happening much sooner. But looks it fixed for that user.

My guess now is that go2rtc is somehow killed by the host system by some reason.

@Inrego
Copy link
Author

Inrego commented May 17, 2023

@Inrego I would suggest removing this from your config since it's no longer doing anything:

ffmpeg:
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000
  output_args:
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy

We will start by backing things out to see what is causing the issues. I would recommend trying the following and seeing if it still crashes.

  1. Disable detect in your config:
    detect:
      enabled: False
  2. Remove the go2rtc section from your config and configure frigate to connect directly to the camera streams like you had in 0.11. Don't forget to use the new preset preset-http-reolink.

I've done as asked. The server rebooted within a minute after starting Frigate. Here's my new config which also crashed:

mqtt:
  host: xxx
  user: xxx
  password: xxx
detectors:
  coral:
    type: edgetpu
    device: usb
database:
  path: /db/frigate.db
objects:
  track:
    - person
    - cat
    - dog
    - horse
    - car
detect:
  enabled: False
cameras:
  carport:
    ffmpeg:
      inputs:
        - path: http://192.168.20.39/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=xxx
          input_args: preset-http-reolink
          roles:
            - record
        - path: http://192.168.20.39/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=xxx
          input_args: preset-http-reolink
          roles:
            - detect
    detect:
      width: 896
      height: 512
      fps: 7
    zones:
      indkørsel_2:
        coordinates: 666,144,596,336,444,491,108,379,292,140
        objects:
          - car
  port_2:
    ffmpeg:
      inputs:
        - path: http://192.168.20.71/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=xxx
          input_args: preset-http-reolink
          roles:
            - record
        - path: http://192.168.20.71/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=xxx
          input_args: preset-http-reolink
          roles:
            - detect
    detect:
      width: 896
      height: 512
      fps: 7

snapshots:
  enabled: True
  bounding_box: True

@blakeblackshear
Copy link
Owner

What do the logs say?

@Inrego
Copy link
Author

Inrego commented May 18, 2023

Not much:

2023-05-17T20:11:51.399827212Z 2023-05-17 22:11:51.399741325  [2023-05-17 22:11:51] frigate.app                    INFO    : Camera processor started for port_2: 1305
2023-05-17T20:11:51.399852906Z 2023-05-17 22:11:51.399778084  [2023-05-17 22:11:51] frigate.app                    INFO    : Capture process started for carport: 1307
2023-05-17T20:11:51.402048375Z 2023-05-17 22:11:51.401999803  [2023-05-17 22:11:51] frigate.app                    INFO    : Capture process started for port_2: 1315
2023-05-17T20:11:53.076287713Z 2023-05-17 22:11:53.076173986  172.20.0.4 - - [17/May/2023:22:11:53 +0200] "GET /api/logs/frigate HTTP/1.1" 200 336 "https://frigate.renescott.dk/logs" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:11:53.077730955Z 2023-05-17 22:11:53.077650384  172.20.0.4 - - [17/May/2023:22:11:53 +0200] "GET /api/logs/go2rtc HTTP/1.1" 200 232 "https://frigate.renescott.dk/logs" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:11:53.077875482Z 2023-05-17 22:11:53.077812577  172.20.0.4 - - [17/May/2023:22:11:53 +0200] "GET /api/config HTTP/1.1" 200 8387 "https://frigate.renescott.dk/logs" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:11:53.078236649Z 2023-05-17 22:11:53.078126038  172.20.0.4 - - [17/May/2023:22:11:53 +0200] "GET /api/logs/nginx HTTP/1.1" 200 342 "https://frigate.renescott.dk/logs" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:11:54.031777970Z 2023-05-17 22:11:54.031573463  [2023-05-17 22:11:51] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-05-17T20:11:54.040685590Z 2023-05-17 22:11:54.040501842  [2023-05-17 22:11:54] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-05-17T20:11:54.573271213Z 2023-05-17 22:11:54.573212498  172.20.0.4 - - [17/May/2023:22:11:54 +0200] "GET //api/carport/latest.jpg?h=594 HTTP/1.1" 200 53433 "https://frigate.renescott.dk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:11:54.588344505Z 2023-05-17 22:11:54.588278263  172.20.0.4 - - [17/May/2023:22:11:54 +0200] "GET //api/port_2/latest.jpg?h=594 HTTP/1.1" 200 20355 "https://frigate.renescott.dk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:11:56.364205657Z 2023-05-17 22:11:56.364058115  172.20.0.4 - - [17/May/2023:22:11:56 +0200] "GET / HTTP/1.1" 200 6641 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:11:56.407096023Z 2023-05-17 22:11:56.407040714  172.20.0.4 - - [17/May/2023:22:11:56 +0200] "GET /api/config HTTP/1.1" 200 8387 "https://frigate.renescott.dk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:11:56.471462482Z 2023-05-17 22:11:56.471298523  172.20.0.4 - - [17/May/2023:22:11:56 +0200] "GET //api/port_2/latest.jpg?h=594 HTTP/1.1" 200 59979 "https://frigate.renescott.dk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:11:56.471682352Z 2023-05-17 22:11:56.471569517  172.20.0.4 - - [17/May/2023:22:11:56 +0200] "GET //api/carport/latest.jpg?h=594 HTTP/1.1" 200 53364 "https://frigate.renescott.dk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:12:00.970249143Z 2023-05-17 22:12:00.970083493  [INFO] Starting go2rtc healthcheck service...
2023-05-17T20:12:07.704406594Z 2023-05-17 22:12:07.704240393  172.20.0.4 - - [17/May/2023:22:12:07 +0200] "GET /api/config HTTP/1.1" 200 8387 "https://frigate.renescott.dk/cameras/carport" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:12:07.707594165Z 2023-05-17 22:12:07.707504965  172.20.0.4 - - [17/May/2023:22:12:07 +0200] "GET //api/carport/dog/thumbnail.jpg HTTP/1.1" 200 1111 "https://frigate.renescott.dk/cameras/carport" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:12:07.707774436Z 2023-05-17 22:12:07.707758817  172.20.0.4 - - [17/May/2023:22:12:07 +0200] "GET //api/carport/horse/thumbnail.jpg HTTP/1.1" 200 1111 "https://frigate.renescott.dk/cameras/carport" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42" "192.168.20.80"
2023-05-17T20:12:56.899903059Z s6-rc: info: service s6rc-fdholder: starting
2023-05-17T20:12:56.900448360Z s6-rc: info: service s6rc-oneshot-runner: starting
2023-05-17T20:12:56.901630558Z s6-rc: info: service s6rc-oneshot-runner successfully started
2023-05-17T20:12:56.902137814Z s6-rc: info: service fix-attrs: starting

Worth noting: the crashes started as I am setting Frigate up on a completely new machine. I tried starting Frigate again on my old server (same version, same config), and it doesn't reboot.
So I'm again leaning towards the BIG.little configuration of my CPU.
I will try limiting the Docker container to only big cores, as I've done with other containers that have problems with this CPU type.

@Inrego
Copy link
Author

Inrego commented May 18, 2023

Just had a reboot again after about 30 minutes, so that didn't work either.

@blakeblackshear
Copy link
Owner

So strange. With your current config, Frigate is doing basically nothing. Let's try running with the smallest possible config using a dummy camera only. I think this should work.

mqtt:
  enabled: False
database:
  path: /db/dummy.db
cameras:
  dummy:
    ffmpeg:
      inputs:
        - path: /dev/zero
          input_args: -re -s 640x480 -f rawvideo -pix_fmt rgb24 -r 1
          roles:
            - detect
    detect:
      enabled: False
      height: 480
      width: 640
      fps: 1

@Inrego
Copy link
Author

Inrego commented May 18, 2023

It's started with this config now. Hoping to solve it, I've more than 20 other docker containers running on this machine which are disrupted by these reboots. With 10-20 more containers yet to be migrated.

@Inrego
Copy link
Author

Inrego commented May 19, 2023

So far that config has been running without issues.

@blakeblackshear
Copy link
Owner

Now let's start adding things back part by part to see what the issue is. Let's just add the detector back so the Coral initializes, but we will leave detect disabled so it doesn't do anything yet.

detectors:
  coral:
    type: edgetpu
    device: usb
mqtt:
  enabled: False
database:
  path: /db/dummy.db
cameras:
  dummy:
    ffmpeg:
      inputs:
        - path: /dev/zero
          input_args: -re -s 640x480 -f rawvideo -pix_fmt rgb24 -r 1
          roles:
            - detect
    detect:
      enabled: False
      height: 480
      width: 640
      fps: 1

@Inrego
Copy link
Author

Inrego commented May 20, 2023

That's been running about an hour now. It isn't necessarily an indication that it's running, because prior to posting this issue, it would sometimes run for a few hours before rebooting.
But let's say it's not crashing with this config, what do you suggest to add back in next?

@Inrego
Copy link
Author

Inrego commented May 20, 2023

Nevermind. Just had a reboot.

@blakeblackshear
Copy link
Owner

Let's go back to the config without the detector to be sure it wasn't a fluke before adding other stuff back in.

@Inrego
Copy link
Author

Inrego commented May 20, 2023

Been running fine so far. I'm just gonna try my original config with the Coral in another USB port and see what happens. If reboot, I'll go back to basic config and await further instructions

@Inrego
Copy link
Author

Inrego commented May 21, 2023

20 hours so far. I'm inclined to chuck it up as a faulty USB port. I'll give it a few days and then close the issue if no more reboots.

@Inrego
Copy link
Author

Inrego commented May 23, 2023

Damn, I just had another reboot. I was so sure it was fixed

@blakeblackshear
Copy link
Owner

Can you try running with CPU detectors to see if it's a USB issue?

@Inrego
Copy link
Author

Inrego commented May 24, 2023

Just had a reboot again, with the most basic config. Now I'm starting to doubt if it's even caused by Frigate at all. It just seems like too much of a coincidence that the reboots happened shortly after starting Frigate at the beginning, so maybe it accelerated an underlying issue. I'm gonna try stopping the Frigate container and unplug the Coral for a while to see if any reboots still happen.

@Inrego
Copy link
Author

Inrego commented May 24, 2023

Reboot again now, without Frigate running. Sorry for wasting your time.

@Nisbo
Copy link

Nisbo commented Nov 28, 2024

Was this issue fixed ?
I am also having this issue with HA and Coral TPU so that I disabled Frigate some months ago. Today I was trying again with the latest version (0.14) and the problem is still there.
There is nothing related in the log.

mqtt:
  host: 192.168.178.27
  port: 1884

detectors:
  coral:
    type: edgetpu
    device: usb

cameras:
  ArbeitszimmerFrigate:
    ffmpeg:
      inputs:
        - path: rtsps://192.168.178.1:7441/XwfeZL2iCgGixkQ0
          roles:
            - detect
    detect:
      width: 640
      height: 360
    objects:
      track:
        - person
        - cat
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 10
        objects:
          person: 1
          cat: 7

  Strasse:
    ffmpeg:
      inputs:
        - path: rtsps://192.168.178.1:7441/L91wDlwRXyKP2VLm
          roles:
            - detect
    detect:
      max_disappeared: 10
      width: 640
      height: 360
    objects:
      track:
        - bus
        - car
      filters:
        bus:
          mask: 0.08,0.382,0.843,0.366,0.825,0.945,0.133,0.951,0.082,0.48
        car:
          mask: 0.083,0.39,0.848,0.374,0.841,0.925,0.132,0.967,0.084,0.533
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 10
        #mode: active_objects
        objects:
          car: 1
          bus: 7
    motion:
      mask: 1,0.354,0.077,0.381,0.078,0.533,0.127,1,0,1,0,0,0.912,0,1,0
version: 0.14

@Inrego
Copy link
Author

Inrego commented Nov 28, 2024

@Nisbo Which CPU are you running? My troubleshooting back then led me to realizing it was due to intels new little.BIG core design where some tasks would be off-loaded to a smaller CPU core.
I don't remember exactly which commands I ran to figure out which cores were the little (efficiency) ones, but I ended up excluding them on some docker containers with this in my docker-compose:

cpuset: 1,2,3,5,7,9,11,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31

My CPU is a i9-13900K, so if you by coincidence have the same CPU, you can try the same cpuset.

Note that this issue was not particularly related to Frigate, as you can see this issue is closed because the system crash also happened while Frigate wasn't running. I also added the same cpuset to sonarr and radarr containers.

@Nisbo
Copy link

Nisbo commented Nov 28, 2024

@Inrego
For me it happens only if I enable Frigate (Addon, not the integration) in HA.
I am running an older INTEL-NUC (NUC5PPYH)
https://www.intel.com/content/www/us/en/products/sku/87740/intel-nuc-kit-nuc5ppyh/specifications.html

@Inrego
Copy link
Author

Inrego commented Nov 28, 2024

Then I suppose your issue is unrelated to mine.

@NikoGrub
Copy link

NikoGrub commented Dec 6, 2024

I have the same problem.
Home Assistant crashes sporadically and I found nothing helpful in the logs.

Raspberry Pi 4 with SSD, Coral TPU.

@Nisbo
Copy link

Nisbo commented Dec 6, 2024

Meanwhile I changed from my Intel NUC (with HA installed) to a Raspberry Pi 5. (Standalone, Runing in Portainer)
After some trouble with the power supply at the beginning, now its running since 1 day with the original PI power supply.
1 try was with a normal power supply (and modified firmware.bin to allow more current), Pi started but crashed after around a minute.
2 try was with a powered USB hub (on the same power supply than before), this was running longer but after some hours it also stopped working

@NikoGrub maybe you can also try a different power supply / hub or try to separate Frigate from HA (if you have enough hardware) because Coral and SSD should take a lot of power

@NikoGrub
Copy link

NikoGrub commented Dec 6, 2024

@Nisbo Thank you for the fast reply and information.
I use the original power supply from the Raspberry Pi.
Home Assistant OS is installed, so I have no possibility to use Frigate separately I think.

I'll watch the problem for a while and think about it.

@TinoBertram
Copy link

Same Problem. I have a Home Assistant OS version running on Intel NUk. I installed Frigate initially and after 3 days it crashed the first time - completely frozen the whole server. After restart it crashes now every 5 to 50 mins. I use a Coral TPU. Frustrating - no info in the logs.

@Inrego
Copy link
Author

Inrego commented Dec 18, 2024

Same Problem. I have a Home Assistant OS version running on Intel NUk. I installed Frigate initially and after 3 days it crashed the first time - completely frozen the whole server. After restart it crashes now every 5 to 50 mins. I use a Coral TPU. Frustrating - no info in the logs.

No need to report about it. If it is indeed the same issue, then you can apply the fix I provided in this thread. If it's not the same, you should start a new thread. Commenting on a closed thread is very unlikely to get the attention of the devs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants