HA dies every morning

Yes I am using the recommended ASMedia one. I’ll try unplugging Zigbee as the last resort, I have a lot of important stuff on it. Thanks!

i also have similar problem. hangs every alternate day 6.11am…yesterday I increased the swap size. and today It didnt stop at scheduled (!) time, still running. i will observe a week, lets see.

1 Like

That uses an NVMe hard drive? IIRC they draw more power under load than a sata version. If you have a powered usb hub, you could use that to power the zigbee dongle.

No, SATA SSD.

It happened again, at the same time. Nothing of interest in log, no apparent spike of any kind. I’m returning back the SD card as I can’t deal with this right now (it’s a bitch to diagnose as it only ever happens at 5AM, and there’s a toddler involved who absolutely requires a working zigbee device around that time). I’ve ordered (another) powered USB hub and some heatsinks and will give it a go later. If I have to choose between unreliable solution that’s been working flawlessly for 2+ years (I have backups) or a reliable one that dies for no apparent reason every day, I’ll take the former :slight_smile:

Thanks y’all!

update:
it’s been running without any hangs for 5 days since I increase my swap from 1GB to 3GB. I did see some spikes in the swap size and actually, its current value is more than the default value. perhaps you can try increasing the swap size give it a try.

Thank you, I just went back to the SD card and it’s smooth sailing since. I don’t have the time to troubleshoot hardware for no good reason :slight_smile:

You should use the datadisk option which is a lot more stable than USB booting

First time I see this mentioned. Also, if it happens after almost a full day of operation and not around the boot time, is it really due to this? Thanks anyway, I’ll look into it!

It’s more complicated than that yes. Another issue is that it works fine for a while then it deteriorates till it hangs forever. This usually this means you need to add quirks to the drive.

But datadisk is more recommended especially these days when it’s only a click away from the Supervisor panel.

I’ll probably stay on the SD. It’s rock solid, has been for over two years (it’s a heavy duty Sandisk card with around 90 MB/s speeds), and I have daily backups. And the speed difference are almost non-existent on a Rpi4. I tried to go to SSD specifically to avoid (potential) corruption, but all I got is the exact thing I’m trying to avoid in the first place, so… Bad luck probably, but still.

heavy duty Sandisk card doesn’t mean it will last you forever. Just today someone on Discord was complaining they got one of those and it corrupted withing weeks. All it takes is something continuously writing to it (e.g. creating daily backups isn’t helping either).

I’m not trying to push you to the SSD. I’m only saying any SD card that is continuously written to is a disaster waiting to happen.

I know and understand all that. I did make the move to SSD and was struck by immediate problems (and I’m apparently not alone). So the rational choice is to use what works, and with automatic cloud backups, a restore when it potentially (or eventually) fails, is a matter of literally minutes. No disaster at all.

Thanks!

Not really, continuously writing to it is not a problem at all if your card is large enough. Most high quality SD cards have some form of basic wear leveling built in. The problem is when your card is so small that parts of it need to be overwritten again and again. If you have a card with lots of unused free space, then the memory controller will just write into the empty space instead of overwriting existing cells.

I’ve been using the same Sandisk extreme for close to 4 years now I think, around two on HA and previously on Domoticz. Not a single issue. My backups and the database are on a NAS though. Especially the db can cause massive amount of writes.

1 Like

Exactly! Most users do not have that. And at first everyone starts small so they don’t get issues. But the larger the DB gets and the more things you add the easier it is to fail. Also most people get 32/64GB SD cards (not to mention the people who get bellow the recommended 32GB).

And given the cost of these so called high endurance 128GB SD cards you are better off getting a 32GB card that only has the OS which is read only anyway and use an 128GB SSD to move everything else in.

From what I’ve heard, SSDs on the Pi cause more problems than what they’re worth. And 128GB ?! How much data are you accumulating in your home lol ? :exploding_head: I mean if you reach that kind of size, maybe a Pi isn’t the right platform anymore and an x64 based system would be more appropriate (with SSD or HDD).

FWIW, my card is a 32GB one. I’m currently using 8GB of it, around 21GB is unused. That usage level has been stable for a while now. It runs not only HA, but a full graphical desktop environment with VNC (LXDE), some other services (zwavejs, mosquitto, various deamons, etc) and I have full gcc/clang and NodeJS / yarn dev buildchains set up. So I could seriously reduce usage if I took the time cleaning the thing up a bit.

And about backups, isn’t there some kind of addon that does backups to the cloud / Google drive / whatever, in case people don’t have a NAS ?

1 Like

database is in MariaDB, which I think is better suited than the default one (it concantenates writes so the card doesn’t get hammered if I understand right). Also, recorder is set to commit once every 10 minutes, further alleviating the load while no functionality is lost.

2 Likes

yep, this one, using it since literally day one and it has yet to fail me. I do have a Synology NAS but I prefer cloud for the HA backup. I’m running the whole Sonarr/Prowlarr/Radarr/qBittorrent suite (torrents are stored on NAS but client runs on HA Pi4), and also Adguard Home and Wireguard and it’s perfect. I do have bugs of course as everyone does but do not have any stability issues. The only stability issues were paradoxically when I moved the install to SSD (via restoring a backup).

Yeah, managing the db is key here. I’d guess that this is the root cause of almost all of the ‘my SD card died after 2 days’ issues that some people run into (well, other than super cheap / fake SD cards). The default db is really bad and the fact that everything is recorded by default certainly doesn’t help.

1 Like

yes, I have excluded whole globs of useless info from recorder, logbook and history. there should probably be some prominent warnings about that. i really don’t need to store UTC time, weather, TV inputs and volume levels and stuff like that in history for days and I doubt most need to.