Snapshots skips config files

I wanted to update my Hassio setup from 0.81.6 to 0.82 but it failed so I wanted to restore from a snapshot. This isn’t the first time and previous times I have had the same problem: Snapshot config folder only contains a couple of yams files and misses most. On previous fails I thought this was due to a bad sd card so I got a brand new good one bot now I have lost most of my yaml files, again.

Anyone else have this problem? it only happens after a while, the first couple of days it saves everything but after a couple of weeks it just doesn’t snapshot everything. Kinda sad I now have to rewrite most of my stuff if I can even figure out what is missing.

This is why it’s important to make and keep a number of backups off the device itself.

You should look into one of syncing options mentioned here: Hassio 0.61 Snapshot Service

Having it keep 30 days worth of snapshots on Dropbox would go a long way. :slight_smile:

(Personally, I don’t trust anything outside of a server class solution for backups. That’s why I setup a Systemd Timer to run Borg Backup every night at midnight. It makes a differential backup (a snapshot) of the entire HA installation directory, a list of all installed system packages, my PostgreSQL database, home directories and the system /etc and /var folders. This is all backed up to an external drive attached to another computer over SSH. It automatically keeps the last 7 daily, 4 weekly and 12 monthly backups. A bit overkill, but the sys admin side of me is neurotic like that.)

I upload all my snapshots to dropbox daily and automatically. The problem is that for some reasons the snapshots don’t contain all the files that are in my Home Assistant config and I can’t figure out why. Have you ever had this problem?

There was a problem with missing yaml files in snapshots but it was fixed in one of the versions well prior to v0.81.6.

I just checked my backups to be sure this wasn’t happening again and all the yaml files are there.

Ah, I see now. I thought you were saying that some snapshots were being corrupted on the device itself, but you’re actually saying they’re all missing some files.

Just to be clear, are the missing files the same amongst the snapshots or do they differ?

Edit: Ignore this. I keep forgetting you’re on Hassio.
You should also make sure it’s not a permissions problem. (SSH in and run chown -R user:user /path/to/config/folder and chmod 600 /path/to/config/folder/* [replace ‘user’ with the username that runs the HA process; you can easily get this by running ps aux | grep hass and looking at the left hand side].)

Another thing to check is your snapshot config; make sure you haven’t accidentally removed those files from the include list (or put them into some sort of exclude list).

I tried enabling the snapshot feature on my test Hassio machine this afternoon and it worked fine, so it must be something specific to your setup. :confused:

You really don’t do this with hassio. None of those changes would be persistent anyway. Hassio handles the permissions itself in the addon. You probably can’t even chown in the hassio container anyway… Depends I guess on what hardware you are using and how you installed hassio but generally speaking you don’t need to do that.

1 Like

I’ve run into a couple of issues where permissions got borked during an upgrade, but come to think of it they must have been outside of the container. So, yeah, you’re probably right. (The above instructions would apply fine to a Hassbian/Raspbian/Virtualenv installation though.)

Home Assistant having so many supported platforms is a double edge sword. It’s great for user choice, but man does it make it difficult to help people sometime.

They would but there are no add-ons with Raspbian etc… only hassio

agreed. it’s easy to assume they have one and then turns out they have something different…

Well, I meant HA and/or its various components in general, not in this specific case. (I’ve certainly seen issues where, for example, HA’s automation or script editor wouldn’t work because someone had used sudo to create the files, or restored backup copies as root.)

I edited my original post and crossed out that advice.

Sometimes I read too fast for my own good. I see “Hass…” and just assume Hassbian.

1 Like

I checked my last snapshot and it looks like the same files are missing again but I have no idea what could be wrong with them. I only edit them with the Configurator add-on. Guess I’ll have to manually back-up everytime I change something.

Are you leaving the files open in configurator?

I don’t think I am. I always save files because otherwise they have no effect obviously…
Also never leave HA tabs open normally. Next time my system fails I will try and not use configurator and see if anything changes.