Home Assistant RPi locking up

I’ve been having a problem that started a few days ago where every day, usually more than once per day, my RPi 3 locks up and HA stops working. If I try to SSH to it, the connection is dropped as soon as I try to authenticate, and the WebUI gives a message I haven’t seen before in the upper left corner of the page. The activity LED on the RPi is also lit solid when it’s locked up. When it doesn’t start right after rebooting it, I generally see a bunch of messages in the home-assistant.log file indicating the home-assistant_v2.db file is ‘malformed’. I don’t know if this is the cause of the lockup or the result. Stopping the service, deleting the db file and then starting the service gets it working for a bit, but then it goes off the reservation again at some point.

The SD was built off the latest Hassbian image a few weeks ago, and is on 0.69.1. I’ve tried swapping RPi’s, only to have it lock up again a few hours later, so that pretty much leaves either something with Home Assistant or a bad SD card that’s causing the issue. Now, I don’t THINK it’s actually HASS that’s causing it to lock up and I’m more or less leaning towards a(nother) bad SD card (I had a 16GB Sandisk in it a few weeks ago and after a few days, it started getting flaky, so I rebuilt it again on another card - the I do think there’s something wrong with the Sandisk as it takes a lot longer to format than any other SD card with SDFormatter), but I could be wrong - is it possible there’s something in my setup that’s causing HASS to flake and lock the system, or is it more likely to be another bad SD card?

If it’s not the SD card I’d be looking closely at the power supply.

Well, I suppose it’s POSSIBLE it’s the power supply. But I’ve been using it since the day I started using a RPi for HA, even before I moved to HASS (This is the power supply I’m using), and I’ve got about six of them on other RPis - RPi 2, RPi3, RPi 3B+ - running Plex clients, another HASS controller, and EmonCMSHub, etc, no issues with them. USUALLY, at least with these, they usually don’t start gradually putting out less amperage, but just die outright (I’ve had two die, and they went from working fine to DOA, nothing in between). The switch powering most of them is a HP Procurve 5406ZL, so plenty capable of supplying the power needed for them.

Sometimes the smoothing electrolytic capacitors dry out and you get a great deal more ripple voltage under load.
As you have more than one it would be easy enough to swap and see if the symptoms persist.

Well, it wasn’t the power supply - swapped it with another one and it went off the reservation again. That pretty much leaves either the SD card or HASS itself. I’ve swapped the SDCard with a new one loaded with a fresh install and my config, so we’ll see what happens.

was it the SD card? im having the same issue