HACS failing due to .hacs.repositories misconfiguration

Hi all. First off, I want to say that the changes in HA over the last 6 months have made my instance much more stable. I haven’t had to rebuild in quite a while now.

That said, after updating to 8.4, I noticed a few of my add-ons have been failing; most notably HACS. It’s failed to load, and I’m noticing now things like the button-card are now failing as well (which oddly seems to be limited to the web interface, mobile app is fine though).

Looking at the logs, I’m seeing this:

Logger: homeassistant.util.json
Source: util/json.py:39
First occurred: 11:52:16 PM (1 occurrences)
Last logged: 11:52:16 PM

Could not parse JSON content: /config/.storage/hacs.repositories
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 39, in load_json
    return orjson.loads(fdesc.read())  # type: ignore[no-any-return]
orjson.JSONDecodeError: unexpected character: line 33127 column 22 (char 1200193)

I found some corrupted text in the hacs.repositories file in line 33125 and corrected it. After saving rebooting, I’m now seeing another error on line 33127. However, I don’t see what the problem is here. Formatting on this line seems to be identical to lines before and after. Any ideas?

Capture

1 Like

I let it sit for a day and the problem came to me. On the previous “topics” line, there was an open and closed bracket before the comma. Since there was already a closed bracket at the end of the nested code, I removed the closed bracket and comma from the topics line. After rebooting HA, HACS is working again.

1 Like

Thanks for the solution, I had a similar issue with my log reporting ‘Could not read /config/.storage/hacs.repositories, restore the file from a backup - unexpected character: line 2916 column 17 (char 103174)’. Using an SSH connection I edited the file and removed all the config related to ‘LG WebOS Remote Control’, saved, restarted and that fixed it.