why did this happen to me or more users (as also reported on github) without changing anything, only after a restart? It actually broke a lot for me, and I would like to understand what happened, when there was no change or update…
I had the exact same issue as OP, looked for music-assistant in hacs.repositories but it was not there. I re-installed all integrations in HACS again and looks okay now I think
I had a big pause (2years) to home assistant and recognized now my backup logic I had in the past did not find the way to my new house.I could not find any backups at the moment. I will rework this for sure asap, but to solvethe mentioned issue: Where do i find an old version of config/.storage/hacs.repositories?
If you don’t find it in an old backup (like those made by HA before an update, for example) you have to re-download and re-install all integrations in HACS like written in the earlier post.
Thanks for the hint. I just found a file “core_2024_12_4.tar”. Maybe somewhere “in it” there is the file. Let’s see if i find a way to open it without restoring the whole “thingh”.
Here is the process to fix the issue (hopefully this saves you from having to reinstall everything!):
When you get the error: “Unable to initialize HACS” you may need to repair HACS. You will use a backup of the “hacs.repositories” file to restore the HACS component.
Download the latest working backup of Home Assistant and obtain the working “hacs.repositories” file:
In Home Assistant, go to “Settings” > “System” > “Backups”.
Click on the latest “Full backup” and choose the three dots in the top right > “Download backup”.
Go to the downloaded backup and open the “backup_name.tar” file (just double click it if using Windows).
Navigate to “homeassistant.tar” > “data” > “.storage” and find the “hacs.repositories” file.
Upload the “hacs.repositories” file to a Network Share that is attached to Home Assistant:
You can add a Network Share to Home Assistant by going to “Settings” > “System” > “Storage” > “ADD NETWORK STORAGE”. Fill in the options to add your network attached storage (choose the “Share” option under usage).
Make sure you copy the backed up “hacs.repositories” file to that network attached storage.
Disable the HACS integration:
In Home Assistant, go to “Settings” > “Devices & services” > “HACS”.
Click the three dots and choose “Disable”.
Replace the broken “hacs.repositories” with the working backed up one. Note: I prefer to use SSH to do this (using the “Advanced SSH & Web Terminal” addon in Home Assistant).
Using SSH in Home Assistant, go to the “config/.storage/” directory. Type: “cd config/.storage” and press enter.
List the contents of the “.storage” directory. Type: “ls” and press enter.
Confirm that you see the file “hacs.repositories”.
Delete the bad/corrupt “hacs.repositories” file. Type: “rm hacs.repositories” and press enter.
Confirm that “hacs.repositories” has been deleted. Type: “ls” and press enter, then check to make sure the file is gone.
Copy the old/working “hacs.repositories” file from the attached network storage to the
“.storage” directory. The command looks like this: “cp /source/of/file/hacs.repositories /destination/of/file/”
After pressing enter, type “ls” to ensure that the “hacs.repositories” file copied over correctly.
Re-enable the HACs Integration to test that it worked.
In Home Assistant, go to “Settings” > “Devices & services” and click the filter (three lines in the top right) to set the option for “Show disabled integrations”.
You can pull the “hacs.repositories” file out of the full backup (maybe a partial too, but I’m unsure). It would be at: “Backupname.tar/homassistant.tar/data/.storage/hacs.repositories”.
I wrote a guide in this thread with the entire process of replacing the broken hacs.repositories file if you need any help.
I just realized that not all my downloaded repositories were showing so I did the restore of the hacs.repositories file but it seems I am still missing some such as the NWS Alerts integration. Can I just download it again without it messing anything up?
Hello.
I followed Ryan’s instructions successfully and can now see all downloaded HACS integrations again.
However, I no longer receive any update messages for the integrations via HACS.
Does anyone know what to do?
Eckart