A cautionary tale (from an HA noob)

Hi
New to HA - about 3 weeks in of testing and adding smart items at home and thought I’d share a cautionary tale for other new users of the platform.

To test it out I’ve been using a Docker container on my NAS, - low CPU priority and 1024Mb RAM. It’s been pretty good even though I’d kneecapped it a little. Still faster than my RPi2b

I’ve done a lot of testing and poking and improving/adding elements every day over the last few weeks (damn it’s addictive), but I ran into an issue where the docker container kept crashing/restating every 15-30 minutes accompanied by an email from my NAS to say what happened.

I could see a jump in CPU to 10-20% activity, but more importantly it was filling the allocated RAM and that was why it was crashing.
I checked the UI logs and Watchman, but nothing on either.

I’d recently updated from my initial 2022.4.4 to 2022.4.6 and after digging about saw historically that people had had issues with memory creep since migrating from 2022.3.* to 2022.4.0. Even still, mine seems less like creep, more like gallop.

I’d added a bunch of QoL items recently following some HA YouTubers video’s and so I removed the integrations and front-end addons in case something was conflicting. Nope, still eating RAM at the rate of about 1Gb/10-15mins.

Curious to see how far it would go, I allowed the container 10Gb RAM and high CPU priorty, but it was hungry for all the ram I made available.

Thinking I may have corrupted a core file or database something (and no way to blanket restore yesterday’s backup with HA Core :frowning: ) resulted in a lot of faffing about, reinstalling existing integrations and add-ons. I also reversion tested 2022.3.8 and moved the V2 DB to force a new one in case that was corrupted, but it was following the same pattern of elevated CPU and memory consumption

3am quickly rolled by and so I gave up and and resigned myself to having to do a complete new build from scratch. I went to bed and left the container continue to do … whatever… while I slept.

Next day and it was still on my mind. I’d remembered that I still had a short entry in the top of the Raw Config Editor I had to remove for the swipe navigation which I’d removed the night before.

I have a bit of OCD so had to remove it just to be neat before starting the fresh build and … there it was. I’d manually typed the config code from the YT video I was following and I’d accidentally typo’d :man_facepalming:

I’d typed for Swipe Navigation:

swipre_nav:
  wrap: true
  animate: swipe
  prevent_default: true
  swipe amount: 20

… swipre * sigh * lol

I checked the GitHub and the correct entry should be:

swipe_nav

Oddly, even with they typo, it was working and my phone was swiping between tabs for a long time before docker started acting up, so I’d thought this one was less likely to be a culprit.

Once I removed that entry from the config file, restarted HA and there it goes… back to cruising along happily between 250-450Mb RAM and CPU levels back down to low single digits.

Experience gained, lesson learned (sleep lost lol)

CW

3 Likes