Home Assistant Continuously Restarting ~ every 5 minutes

Hardware

  • RaspberryPi 4
  • Official raspberry Pi 4 power adapter (changed within the last year or so due to a power issue)
  • Argon One case
  • NVMe drive (from a Steam deck) in a UGREEN enclosure. When this problem started a few days ago, I was running from an Integral SSD

Usual Culprits Tried with No Success

  • Deleting the home_assistant_v2.db file (using the file editor)
  • The power supply has been changed relatively recently, but can’t be ruled out
  • 2 different storage devices have been used (SSD and NVMe drive with enclosure). This included restoring an old backup from a few days before (28th Jan). Interestingly the problem wasn’t fixed by this, even though it should have been a few days before the issue started

What it Looks Like

The supervisor logs show the message:

Watchdog found Home Assistant failed, restarting...

So perhaps the supervisor is fine, and I should be looking in home assistant core, but nothing is jumping out.

Supervisor logs

Home Assistant Core logs

Apologies for the short logs - I’m not really sure how to get the full logs. Currently grabbing them through the (settings → system → logs) page

Note this is an installation I’ve had for years. Just under a year ago I had a similar issue that was fixed by replacing the power adapter with this, but otherwise everything has run fine since. This problem then started on 31st Jan. First there was also an issue with the add-ons not showing as running (even when the logs showed they were), but one of the subsequent restores/db deletes seems to have fixed that. Now the addons show as running, but don’t run for very long before restarting again.

Anyone have any idea what it could be?

The power supply could be overloaded if you have anything plugged into the USB ports that draws enough power to exceed its limits (like an SSD). Note: the recommended RP4 PSU is 3.0A. If you are using the SSD with this power supply, it will cause problems - you should have the SSD plugged into an independently powered USB hub and then the hub plugged into your RP4.

Thanks for the suggestion Mark. I’ll try loading a fresh install onto the now spare SSD and running it for a few hours. If it does the same thing, then it’s likely to be a power issue

Ok I’ve tried running a fresh install for the most part of the day, and it hasn’t rebooted itself in the 8+ hours it’s been running. That means it’s unlikely to be a power issue (unless it only occurs under the heavy load of a long running installation).

Will try a partial backup restore…

Partial Restore Attempted

Still no luck. Will try removing add-ons gradually to see if that helps

Did you resolve this, I seem to have the same problem but I cant get into logs, or restore a backup or pretty much anything else?

HI
If you state a bit more info somebody might be able to suggest something. Start with what hardware you’re using.

Yes sorry

Raspberry Pi 4 model B 4gb with 120gb ssd

This has only started since I installed 2024.8.3

Can sometimes get to backups but when you try to restore it says cannot restore when booting

I would try booting in Safe Mode. And I would attach a monitor and keyboard to the RPi to do the troubleshooting.

Mysteriously it is stable now, I do have the power management checker which appears ok, I am using the official RPi power supply but not separate hub.

This setup has been running for a couple of years without issue so don’t think it is power but I will monitor and implement a hub if necessary.,

Thanks

1 Like

It may or may not be a power issue; so, do not ignore the other possibilities.

Hope and speculation is a poor substitute for action and proof.

Managed to get back in and restore 2024.7 which was stable, then I updated to 2024.8.0 and problem is back

Have you been able to examine

  • Home-assistant.log
  • home-assistant.log.1

Have you tried removing integrations to see if an integration is causing the stability issue?

I cant get in long enough to do anything, I am trying now to restore again but every time I try it comes up with lost connection. I also tried booting to safe mode.
I did manage to do a download of the log, there isnt much in there and I am no expert, this line does look suspect though

2024-08-28 13:20:20.293 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly

What integrations are you using?

local tuya
Alexa Media Player
Android debug bridge
google nest
Hacs
mqtt
octopus energy
sonos
pi power supply checker
sqy q
Sony Bravia TV
Synology DSM
Tasmota
Wyoming Protocal
WLED
Denon AVR Network Receiver

The clue in this thread appears to be an integration issue.

Help needed: 2024.8 Core update unstable on RPi4, connection lost and crashes host, no issue on 2024.7 - #7 by donaldtrump.

I would start disabling integrations to see if there is a specific integration that is causing the problem.

If only I could, just cant get in long enough to do anything, been trying all afternoon. As soon as I click for a page it goes blank and I get the message lost connection, reconnecting

You should try running it off a new SSD. I had an issue once where the SSD became un-reliable after multiple years causing crash issues. You should also check and see if something is leaking memory. So from the command prompt use top to monitor amount of free space, and look for a processes eating memory (process growing memory). I run a supervised installed and had an integration with memory leak once. Because swap space was enabled it would hit a point where the OS was stuck swapping memory pages and you couldn’t do anything until it finally crashed a while later. I turned off the swap space, which then meant the system would immediately crash once all memory was consumed, followed by a reboot. This was actually a lot better than being stuck in the a page swapping state.

For the time being I have reverted to 2024.7.4 and its working fine. I will leave it for now as I am waiting for a Pi5 with NVME drive so will be reinstalling anyway.

Good point about swap space, I was using that as well, but until 2024.8.0 its been running fine.

Thanks all for pointers