Home assistant repeatedly stopped running over night

Hello,

already three times in a row I could not turn on lights in the morning. Then I realized, HA is not accessible. Restarting router does not change it. Only plugging out and in my RPI 4 from power grid forced HA to restart. I use proper power source. Can this be caused by a bad sd card? I checked logs in supervisor and there is nothing suspicious.

Could be, got a backup SD card? Always handy for HA to have a backup that is a copy of prod.

I have snapshots. Are they enough in case of migrating to new sd? Can I check some logs to know why the HA is not accessible?

Cloned as card would mean much less down time.
A snapshot would require you going through the install process again

Which is not necessarily bad thing if all custom components and addons remain included, however, I guess snapshots do not contain third party addons such as hacs and its content.

Anybody some ideas what logs could I check to know what is happening?

i am also interested in a clone of my card, whats the best way to do this?

I use this.

Yes, Win23Diskmanager is probably the best, however, never do it over network as you will never get an image in one point of time.

Still, please folks, where do I check the logs? Do I miss some of them by looking only on those in supervisor? Thx.

Had similar issue some time ago, when recorder DB get out of control (30GB+). I had it configured to keep almost everything and up to 30 days of history. Then one day (30 days from recent installation… what a conincident :slight_smile: ) I started to have problems with HA hanging or barely responding. Events were not recorded, or recorded with several minutes delay, same with any actions. Turned out recorder started purge of DB process, that was so heavy operation for such large DB, that it virtually killed HA. If this is the case, it should start around 4AM, when HA performs purge by default.

My DB has 240MB. This is not my issue.

1 Like

Having the same issue, noticed it after upgrading from Home Assistant OS 5.8 -> 5.9. Randomly the RPi freezes and I must pull the power, UI is not accessible nor can I access it through SSH. This seem to happen more than once per 24 hours. Didn’t see anything like this on 5.8 so until this is solved, is there a way to downgrade to 5.8?

Ok looks we have the same problem. You sure downgrading the core will not cause more damage? Have you found an official/supported method how to do it to be sure we do what the developers count on?

I recently used a snapshot to move from an SD card to an SSD drive, as well as from a 32 bit install to a 64 bit install, and HACS was successfully restored along with the lone repository I’m using.

When using an SD card, I would occasionally (~monthly) create a clone of the card, which in addition to more current snapshots would make a restore from a card failure go quickly. Now that I’m using an SSD drive I will need to create a .img file using Win32DiskImager and save that to a different device since I don’t have a second SSD drive. That’s no more difficult than cloning an SD card. The only issue with either option is the downtime while you have the disk pulled in order to create the backup copy.

The next time it happens, and after you bring it back up, check the logs at:
Configuration - Logs

Also the logs at:
Supervisor - System - Supervisor
Supervisor - System - Core
Supervisor - System - Host

I would also check the Logbook to see if it recorded anything unusual near the time it ‘crashed’.

I wonder if as the OS grows in size it may also be consuming more power, and the issue is your power supply? I believe the Rpi4 needs a minimum of 3 amps. I haven’t checked mine since it’s running just fine, but I do have one of these I would use to see what it’s drawing:
https://tinyurl.com/ycemztur

Downgraded it to 5.8 using:
ha os update --version 5.8

I am curious to see if this will solve the problem, the downgrade itself worked just fine and HA is up and running as normal. Let’s see if it will hang again.

I don´t think so (cause I´m still on 5.8 having similar issues HASS OS becomes unresponsive / then almost unusable / and is finally dead - starting every ~ 10 hours after last HA start) but fingers crossed for you :frowning:

Can you please tell us more in detail how did you downgrade? Thanks

Make sure you have installed the addon called “Terminal & SSH”, then use either SSH from your computer or go to the addon and open the Web UI and then from the command prompt run the command:
ha os update --version 5.8

That will initiate the downgrade and restart your RPi.

BTW, I am running on a RPi 4 8Gb with a new SD Card if that is any information that might be needed.

1 Like

I have the same problem.

First I thought that the deconz applications was the problem.

At some point I couldn’t check my configfile because it was not accessible

But when I look at the log files it seems the problem is database access.

So I’m trying to setup an new SD-card and see how it goes