Configuration reverts to old files on reboot

Every time I need to reboot my pi all of my config files revert to older versions of the files and new files are completely gone. This is really frustrating because I have to copy my backup configs over and end up losing several days of changes because I don’t remember to backup every time I make changes. Has anyone else experienced this issue?

This is one of the stranger problems I have seen reported.

How did you install HA on the Pi, and what method do you use to edit the files?

Does it always revert to the same version?

I installed using the Hassbian image which I’ve done on other several other occasions and never had this problem. I was primarily using a samba share and notepad ++ to edit for convenience. When I noticed this issue I went back to editing in Nano from an SSH session. It doesn’t seem to matter how it’s edited. I’ve got a few other services running like Mosquitto and Dasher. Mosquitto is good but I have the same problem with the Dasher config on reboot. It always goes back to the same version. If I knew what was going on and I could get my config where I wanted it and then locked to that version this would be a neat feature. However, it’s kind of a mystery as to how this is happening. Thanks for any insight I’m about to pull my hair out dealing with this

This sounds to me that some setup script on Hassbian not ended properly and now runs on every boot and copy the default configs from source.

I’m not running Hassbian, so i can only guess.

Search for another configuration.yaml in your system.
sudo find -iname '*configuration.yaml*'
if there’s a second one, edit this to find out if this is the source.
This would be a temporary workaround.

Then i would look in some default places for autostart if there are some calls to scripts and comment them out for testing.
I guess on Hassbian it would be /etc/rc.local, but not sure.

Good luck!

Same here. After editing my configuration.yaml I need to reboot. But reboot reverts config to its defaults. Tried to install Hassbian and All-In-One - same result. And HA Info page shows current version 0.33.0 although latest versions should be 0.42.4
(editing via SSH and WinSCP)

Can be a corrupt SD card. After a restart, are these logfiles outdated too? I have experienced something simulator, see here: https://community.home-assistant.io/t/how-to-recover-from-raspberry-pi-sd-card-read-only-malfunction-due-to-wear

Well, i was wrong with my guess on autostart in /etc/rc.local. Found this https://github.com/home-assistant/hassbian-scripts#install-home-assistant-install_homeassistantsh which runs on hassbian installation, and there is a systemd service that gets disabled and deleted.
Maybe you give it a try and run it in a terminal?

Just an update from my end. I finally got fed up and decided to start from scratch. I took the micro SD card out to reformat and put a fresh copy of Hassbian on it. However the card wouldn’t format. I was getting a write protection error. The write protection switch on the sd card adapter wasn’t on, so I thought something was wrong with the micro SD card. I got another card out and prepped. I went through the process of getting the SSL certs back on it got mosquito up and running got my configs copied over and updated and everything seemed cool. Last week I saw the IOS app was available, so I updated HA added the iOS component and saved as usual. Then I rebooted the pi like a day later and low and behold the config was missing the IOS component that was previously in there and working, and my HA version had reverted to 0.42.1. I don’t know if something I’m installing is causing this or possibly the card reader? I’ll try again with a different brand of micro sd and a different adapter and see how that works. I’m baffled.

did you ever get this figured out? My installation is doing the same thing. I stop the HA service, make modifications and reboot and all old files are back. Very frustrating. Thanks!

Is it a Samsung EVO card?
I’ve seen a lot of reports of similar issues with those cards on the RPi.

I didn’t really figure out the problem. I just ended up buying a few more Pis after I switched everything to a B+ everything has been great.

I’m just wiping out the card and reinstalling. I can’t figure it out. It’s like the card is frozen and no matter what I do changes are wiped on restart. It’s really frustrating.

OK, ended up being a bad microsd card. All attempts to write to it failed so it appeared to be in a read only mode.

That’s similar to what I experienced. However after I got a different card setup and running it did the same thing. They were the same Kingston brand so maybe that had something to do with it. That being said the same card is running just fine in a different Pi.

So was having the same issue of files reverting back to older version after restart. Bad or corrupt SD card. Was able to capture img and rewrite to another card, and boom, working like it should. Much faster as well. The card was a 32G Samsung. I replaced with a 32G Scandisk. I’m just wondering if I should just routinely replace the card every 6 or 12 months.

experiencing the same issue :frowning:

I’m having the same issue. Has it been confirmed that it is the SD card? I don’t want to waste money and time on getting new SD cards if that is not the problem.

Yes, it is definitely the SD card.

omg. I’ve spent days in the twilight zone over my lights not saving. They would retain temporarily and i would move on to something else and an hour later be back to the original state or name. ITS BEEN DRIVING ME INSANE

I have a samsung evo 64gb card. It has had less than 10 write cycles. I want to burn that company to the ground right now