Home Assistant stopped - Most nights at 3AM

No idea how I would even start trouble shooting this. HA is stopping and restarting almost every night at 3am. No idea why. Any ideas?

image

Need a whole lot more info, than just a problem statement. Please read: How to help us help you - or How to ask a good question - #3

SWAG: Bad Host Issue, Conflicting services on host, Host power issues, host memory issues, etc

3am exactly each time?

Check the host’s logs - and cron and crontab entries. (Linux scheduling). Don’t know why that would have been set, but it’s where I’d start.

Do you do automatic backups at 3 am? may be filling the disk up.

@digdilem Just to confirm you mean the logs that sit in the config folder? Also, I rarely have had to check things via SSH. Am I on the right track with this? - How to List, Display, & View all Current Cron Jobs in Linux

@Arh Yes right on 3:00.00AM every time. I do backups every second day at 4am. Doing this via google drive add on so don’t believe that is the issue.

even using google drive backup it leaves a backup on your disk. Worth checking.

It is obviously doing something at 3am (guess I don’t need to tell you that :slight_smile: ) list your automations by last triggered to easily if anything happens at 3am.

@s1nk - I mean on the underlying os.

Checking HA’s logs is certainly a good starting point, and if that can be done through the webui, great.
Obviously you’re looking for something that happens at 0300 or a minute or two either side. It might be some maintnence task that’s been forgotten, or something else that’s affecting something HA relies upon

If you’re running Docker natively on linux, then checking those cron logs (yep, that link looks useful) - on debian/ubuntu, they’ll be in /var/log/syslog or thereabouts (View with “less /var/log/syslog” once you’re ssh’d in. You may need to be root to do this)

“crontab -l” lists the cron jobs for that particular user, so ensure you’re running it as the same user HA runs as, and root. Also check in /etc/cron.d and the other /etc/cron.??? folders - any files in there can contain crontab entries too.

Whilst you’re ssh’d in, check the system uptime with “uptime” to ensure it’s as you expect. It’s possible it’s actually rebooting and HA isn’t set to automatically restart.

Or if you’re running in a Docker container, then checking the same places too is also worthwhile especially if there’s any mention of ‘docker’ doing something. You would also need to look for logs inside the docker container (using portainer/similar, or entering the container with docker exec -it)

Bodge tip: If you cannot find the cause, you can bodge it by creating a new crontab entry to restart HA at 0305… Some people routinely restart services because they believe if helps stability or memory leaks. That shouldn’t be needed with HA, as it’s well behaved software, but it is a thing you can do and won’t cause any harm.

1 Like