Home Assistant crashes every night, what am I missing?

Hi All, absolutely love HA so really hoping someone can help me figure out what I’ve done wrong.

I’m running HA on a standalone Linux Ubuntu Server 17.10 and I’ve installed it within a Python Virtual environment via these instructions: https://www.home-assistant.io/docs/installation/virtualenv/

I have HA running as my own user leon and I’ve ensured that the entire .homeassistant folder and contents are owned by leon using chown and verified with ls -al. I have the systemctl service set-up to use leon too.

Everything works perfectly except every morning I wake up to a broken UI and none of the automation’s working. The errors in the log are:

Error doing job: Task exception was never retrieved
permissionerror: [errno 13] permission denied: '/home/leon/.homeassistant'

If I restart HA everything starts working again until the following morning.

Any help would be greatly appreciated!

You gotta find the error that causes this. The errors you are seeing are a byproduct of the event that causes the issues.

Thank you for your reply. These errors are in the home-assistant.log file. Is there some other log files I could check to try and figure out what is causing them?

I would start at the linux level and first, check the ownership of each file and folder to insure it matches the owner that you have HA running as (root, homeassistant, you, etc.). Then check the permissions for each file and folder also. If you are the only user of this computer, open things up to at least 0755 on everything. (owner, all rights - group, read/write, other - read/write).

Just find the first error before all the connection errors. If the connection errors start the errors, then it may be a setting in your os. Maybe a ‘turn off network card when going to sleep’ setting?

Thank you all for your replies. I’ll keep an eye out for what happens just before the error occurs. I’ve already checked that all .homeassistant files are owned by the correct user but I can also set them all to 0755 too. Once I find out what is happening just before the crash I’ll report back. Thanks again.

The plot thickens. It appears the UI or entire system is no longer crashing, what I’ve now discovered that for whatever reason overnight my automation’s are getting disabled. So when I try and turn my lights on in the morning which is via the Wireless Aqara switch that uses an automation to turn on some IKEA bulbs the automation isn’t running.

While writing this something has just occurred to me. Every night I ask Google to “Turn off everything” before I go to bed. Does it seem likely that the Google Home integration would also turn off automation’s due to this command? I shall look into hiding certain items from Google Home if this is the case.

Thank you all for your help, I’ll report back with what I find.

That’s probably what happens.

You should limit what is going to Google home anyways. I restrict the following domains to my voice controlled devices:

- light
- switch
- input_boolean
- fan

basically, those are the only domains my voice controlled devices see.

Yep, totally was the problem, the UI still crashes every couple of hours after a restart but the system itself doesn’t stop functioning.

1 Like