Home assistant crashing, how to find what's causing it?

Hi,

Since a month or so, my home-assistant is crashing about once a day, complete at random times.
I can’t recall any specific change or something like this which can be the source, so, I tried to look at the logs but that’s quite a puzzle.
How can I see what is the root cause of the crash ? (or is someone willing to help me with that ?)

That’t about a raspberry PI, I’m not using an RPI, HA is running on an intel NUC I5

How are we supposed to know, if you don’t tell in your question ?

How is HA installed ? HA OS on bare metal, HA OS in VM (what VM), HA Container (docker), HA Core (venv)

Do you have logs to share ?

It’s HA OS on bare metal , I can share logs , sure, but please tell me which one you need and how to get them (need a bit of help here)

First make sure you are on the latest and greatest HA versions !, Both OS, Core n Supervisor
A reboot will flush/rotate your logs, so you can “begin” troubleshooting on a “fresh” ( Logs/Version )

This way you can check the booting part, and eventually after a crash.

in your /config(homeassistant) folder you find your logfiles home-assistant.log + home-assistant.log_1 ( latest is the “old” after a reboot/restart & and after a crash !)(use file-editor, samba-share, or similar)
PS: so after a crash, the x.log.1, is the one to look in, if you restart again, it will be lost/rotated, and the timeline you wish to look at is “gone”
So a log/time-line, where you can identify/knows it crashed, occurred, is obviously what you want to look into

In UI /Setting/System/Logs you find “core-log” in the top-right corner, you can click “core-log” and find additional logs
Please do look into both core & host etc. even after a crash/reboot , to see how it’s “doing/feeling”

You can look for i.e extensive/repeatedly “errors” and/or " timeout/connection Errors"

It Not a Puzzle, it’s a “sequence” scenario :wink:
i.e , After A comes B, B comes prior to C(rash) , so with fresh updated system, you get a more useful timeline to follow

1 Like

@boheme61 , I have the log file (+1 version) , would you be willing to have a look ? (maybe better to not share it here in full ?)

Please have a look for your self, try to understand it, look for Errors/timeouts/connection-failure, and then only post relevant parts from the log, prior to the crash (. log.1) but also at startup( if there is lots of related errors etc) ( . log)

PS: Just for the cause of it, always check the ( . log.fault ) also ( if it’s larger than 0b )

Do you have camera’s working on HA? in other words… The Hikvison intergration was my “crasher”

or:

Found this on this community:

I had exactly that problem.

Turned out that it was the NUC power supply.

Replaced it with one with high wattage - no more problems.

Well, I looked at the .1 log after a crash but could not find anything in there, not even multiple times.
However, I noticed a trend and that is that HA is crashing every night at 2:00 am exactly.
So, that sounds like some “cleanup/maintenance” thing and I suspected the “Ubiquity Unifi add-on” (because it’s doing DB maintenance) so, I disabled that one and now HA already stable for two days.
Have to investigate on what exactly is going on with that add-on but happy I can pin-point this now.
Thanks for the help.

1 Like

If you have any custom components installed, you might have one that does unsafe thread operations.

You could turn on asyncio debug and watch the log to see if anything shows up

2 Likes

I reported the issue to the dev of the add-on, will also investigate a bite more and report here : Add-on seems to cause HA crash · Issue #503 · hassio-addons/addon-unifi (github.com)