Corrupted storage, no good backups

I had an issue with HACS failing, and it seems that my data files have been corrupted. I was told that re-installing HACS won’t solve the issue, as the .storage will still be corrupted, and all I can do is restore a backup.

Issue I submitted:

Unfortunately I only have 3 days of backups, and I did not notice this issue soon enough, so I have nothing to restore to.

What can I do to repair home assistant at this point?

Wipe and start from new. If its gone, its gone!

Hacs folder should be under custom components. Maybe go across with Samba to see what’s there.

Did you have any custom yaml files to preserve?

Maybe wipe/uninstall getHACS too.

Bring down your system to power off and restart between steps.

Have you tried a full HomeAssistant server rebuild, and restore with HACS omitted, and then install HACS as usual?

Why was it corrupted in the first place is my next question, and how to prevent it happening again? Are you shutting down the system by interrupting the power, is there disc data corruption, or is the media faulty?

1 Like

Try try again

You only need to get a copy of backup so try enough times you may be able to read file

Is the issue data recovery, or getting HACS running again?

1 Like

Sounds very much like what people often say when using an SD card on a PI.
If this is the case, has your SD card failed?

I can deal with losing the data, I just want to get HACS working again.

And would like to not have to rebuild my whole server from scratch.

It hasn’t effected the browser yet, but most of my dashboards on the mobile app are errored out because it can’t find the custom components for most of my cards.

Adding to this comment, didn’t realize you also were the one that made the first reply.

When you say wipe it, you mean my whole HA installation and remake it from scratch?

No custom yamls, just don’t want to manually rebuild all my integrations, devices, etc.

I attempted to uninstall HACS following their instructions. Deleting the integration, restarting twice, deleting the HACS folder in custom components then restarting again. But when I reinstall, I get the same issue. Maybe I’m not deleting the correct files?

Would I just spin up a new VM, restore from a backup, and uncheck HACS? I didn’t see the option two when I just restored a backup, but maybe it needs to be a new install.

The only thing that may have caused it was pinning the VM to a single CPU which caused it to crash, but I had fixed that already I thought. I could run a test on my RAM.

No, I am running HA in a VM on an Unraid server. I have not noticed any other issues with the server.

Copy your VM image to a windows machine, open it and find all your yaml files, and in .storage you’ll find your dashboards in .json format, these you can convert online to yaml

You can pretty much reconstruct most this way.
There is a description somewhere in this Forum, probably many, i have posted i.e the Paths to these folders etc.

Even the backup files you can open , if they are not corrupt

If you can get HA up and running with the old Image(where HACS is corrupt), you can also find and copy most essential yaml/json/config files this way

The Custom_component folder in /config is your HACS-integrations, under folder /www/community, you find your Custom cards , And you can ADD them manually in i.e VIEW or Dashboards/resources, thou they willl no longer be provided/updated by HACS ( But you can re-download the cards again from Hacs, and with your restored Dashboards-files, everything looks good again)

BTW you haven’t showed ANY logfiles, so who knows whats wrong ?
Only 3 days old Backup, then thats what you get

You can even “replace” some .registry files, but i think this is to “deep” a task for you

Right, i don’t know how you came up with that idea
Feel Lucky, Your still have your hardware and most config you can copy/paste, but yes you do have the whole weekend to do this, giving you yet another experience :slight_smile:

I believe my backup files are not corrupted, I am able to restore them, they just don’t solve the issue. HA itself is running fine now even, just not HACS.

The log files I had are included in the link I shared to the issue on HACS’s github, although I can post them again here if that would help. Also shows their response about my .storage being corrupted.

What do you mean by too deep? What would replacing .registry files do?

Cut your losses.

If you only have three days worth of data, you haven’t lost much if you just wipe everything and start from a fresh install. Auto recognition of your devices and memory of your integrations should fill in most blanks.
Abandon restoring your old data. Accept it is gone.
Sometimes it is not worth the time and trouble, and if your data you are restoring is suspect, what to trust?

Learning the lesson to have verified backups is priceless.

Vatican bank motto: Jesus saves, so ahould you.

1 Like

I decided to try re-installing HACS again, but this time in addition to their steps I also deleted everything mentioning HACS in the .storage directory. I was able to install it just fine after that and everything seems to be working fine now.

1 Like

Good news.
Check your backups are restorable from time to time. Make offsite copies. You now know how important they are.
Close your GitHub report too.

1 Like