Database corrupts every few hours, reboot shows no error and a working database

Hello,

2 days ago I upgraded my Raspberry Pi 4 (with SSD) to a Raspberry Pi 5 with NVME SSD and transferred it using a backup. Everything went smoothly.

Now I’m getting a corrupt database for the third time in 36 hours and Home Assistant is still online but no longer responsive.

Logs say that the database got corrupted and renamed so Home Assistant can boot up again.

But if I restart the Home Assistant (the only thing that helps is unplugging the plug and plugging it back in), I can’t find any renamed database - only the original one - and all historical the data is still there.

I even read up a bit on SQL and installed the SQLLite Web Addon and checked it using “pragma integrity_check;”. No errors are displayed here.

So after I rebooted the Home Assistant, it works perfectly again as if nothing had happened and all my data is still there.

Does anyone have an idea what I can do here?

Can this be a Hardware related Error (since new Pi5 + new SSD)?

Thanks

Michael

Probably this is a reason why db is corrupted?

Is it possible to get inside via SSH & reboot it normally?

Hello

I would also check if you are having a power problem.
If the power supply is shared for PI and SSD, there can be noise and power problems seen in the data.
An external USB hub with it’s own power supply is recommended. (for instance)

It gets corrupted before unplugging and then does not respond to any shutdown inside Home Assistant.

I have setup SSH but after it happens I cannot get an SSH connection anymore to shut it down either.

I am using an 27Watt power supply as per recommondation for a Raspberry Pi 5.

It is a third party one but “should” also work.

But since I still suspect some problem with the NVME SSD I have now ordered a new SSD and also added a new NVME Header and the official Raspberry Pi 5 (27W) power supply … just in case there is a fault with my third-party one.