Multiple restarts

Hi, I’m using HA on a raspberry pi 4 with just 1gb ram.

Unfortunately I have to obeserve several restarts a day and I don’t know what is the reason for that:-(

In my log file I just get the following message: The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly

But unfortunately I’m not able to understand what does it mean.

In addition to that I assume the hardware is working at limit because appr. 80% of ram is in usage. If I deactivate evcc which needs appr. 10% of ram then the system doesn’t restart several times a day.

Do I have the chance to find the reason for my problems? It would be great if you can help because I have no idea what I should do.

The error message points to a corrupt database. 1GB ram might be too little, yes.

1 Like

Hmm, that means the too little ram causes the corrupt database and it leads to a reboot? Sorry that I ask again but I just ensure that I understood it :slight_smile:

More likely the reboot caused the database to become corrupt. Not easy to say. You are probably pushing the limit with only 1 GB ram.

You can delete the .db file (warning, it removes all historic data) and start fresh without a corrupt database.

1GB is not enough. 2GB can work for small systems, 4GB is the minimum I’d recommend. And yes using it all can cause the system to crash.

You can add this integration to see how much of your memory you are using:

1 Like

I had the same problem with seemingly random restarts. No free RAM left was definitely the issue in my case.

I fixed it by disabling some add-ons I seldom needed. E.g. ESPHome devices do not need the ESPHome-Addon to work. Since then everything works stable again. So try to free some RAM or get a device with more of it would be my advice.

Hi ,
What they said but to add to that, the less memory, the more it will rely on swap space. If you had an SD card in there, that is probably toast as well because it will be over-used.The crashes may well be due to the speed and quality of the swap space not able to function to the OS specs.

How to Troubleshoot Raspberry Pi Crashing.

Thank you!

It seems I should upgrade from Pi 4 to such a mini pc with more power😁 Therefore, I‘ve just ordered a used mini pc.

2 Likes

Get one with a lot of ram.
Ram is often somewhat cheap for these and al though it is not necessary, it is really nice with a speedy HA and especially with ESPHome firmware compiling.