HA restarts between 1 and 6 times per day

Hi,

I am running Home Assistant as a Docker container on a Raspberry Pi 3B+ (running off an SSD, no SD card).
For a few weeks now, I am seeing Home Assistant restarting between 1 and 5/6 times per day.
I can’t find any info on why it restarts and it does not seem to be regular.
After a restart, I see the following message in the logs: The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly

I tried manually clearing the database (after stopping the container and before restarting it).

Any idea ?

That’s a symptom of the unscheduled shutdown, not the cause.

Could be caused by hardware issues, check your power supply is sufficient. The normally recommended power supply does not take into account the extra load of the SSD.

Or resource use, monitor your RAM and CPU with the system monitor integration.

Or software, do you have loops in your automations and scripts?

Do the loops actually have a default exit if they run for too long?

Do you use custom integrations?

If so try starting in safe mode and see if that fixes the issue (disables all 3rd party integrations).

Developer Tools → YAML → Restart → Advanced Options → Restart Home Assistant in Safe Mode.

Now also suddenly seeing restarts every few 24 hours - I wasn’t before - the only thing I’ve changed recently is upgraded to 2024.2.2…

seems to possibly be seeing the same scenario?

I had similar problem when I decided to go with i7 comp first gen. It’s just keep restarting.
I could never find out what the issue was. I replace it with my old i3 second gen and it’s working flawless. I switched everything to it, gpu, google coral, all hdd and no problem.
I’m writing this because you probably have some hardware issue like me.

If I do have a hardware issue it’s totally new - previously my HA was rock solid for years on this Pi.