HACS disappeared from menu but still seems to work - No longer a problem

I recently updated to core_2022.8.6 and HACS seems to have disappeared in the process.
The reason for this “disappearance” is clear: I get the following errors in my log:
Error setting up entry for hacs

Logger: homeassistant.config_entries
Source: util/json.py:45
First occurred: 9:52:14 PM (1 occurrences)
Last logged: 9:52:14 PM

Error setting up entry for hacs
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 23902 column 44 (char 780993)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/hacs/__init__.py", line 223, in async_setup_entry
    setup_result = await async_initialize_integration(hass=hass, config_entry=config_entry)
  File "/config/custom_components/hacs/__init__.py", line 209, in async_initialize_integration
    await async_try_startup()
  File "/config/custom_components/hacs/__init__.py", line 196, in async_try_startup
    startup_result = await async_startup()
  File "/config/custom_components/hacs/__init__.py", line 153, in async_startup
    if not await hacs.data.restore():
  File "/config/custom_components/hacs/utils/data.py", line 120, in restore
    repositories = await async_load_from_store(self.hacs.hass, "repositories") or {}
  File "/config/custom_components/hacs/utils/store.py", line 49, in async_load_from_store
    return await get_store_for_key(hass, key).async_load() or {}
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 116, in async_load
    return await self._load_task
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 125, in _async_load
    return await self._async_load_data()
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 143, in _async_load_data
    data = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 45, in load_json
    raise HomeAssistantError(error) from error
homeassistant.exceptions.HomeAssistantError: unexpected character: line 23902 column 44 (char 780993)

and Could not parse JSON content: /config/.storage/hacs.repositories

Logger: homeassistant.util.json
Source: util/json.py:39
First occurred: 9:52:14 PM (1 occurrences)
Last logged: 9:52:14 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 23902 column 44 (char 780993)

However, the weird thing is that, if I access HA locally, I get a whole series of “custom element does not exist…” errors as I’d expect if HACS were missing. But if I access HA via nabu casa, everything works as it did before the update.
Any idea on what is going wrong and, more importantly, how to fix it?
Thanks.

I don’t think you should get that just because HACS is missing.

HACS only assists you in maintaining (install/remove/update) custom stuff. Once they are installed and configured HACS has nothing to do with them. That is all HA itself at that point just as if you installed everything manually.

It sounds like a cache issue to me. Try clearing that first?

I’m on 2022.8.6 and HACS is working fine for me.

1 Like

same here.

Still no go. By now you think I’d remember to clear the cache :slight_smile:
Anyway, here’s how it shows up on the Integrations page:
HACS not set up
(which is part of what had me checking those logs in the first place).
Any other ideas? Thanks.

update: So, I tried deleting and reinstalling HACS. Now the errors are everywhere (local and nabu casa). At least it’s consistent, but now I can’t access my main overview at all :frowning:
Here’s the full log entry:

2022-08-27 08:50:25.152 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-27 08:54:10.154 ERROR (SyncWorker_5) [homeassistant.util.json] Could not parse JSON content: /config/.storage/hacs.repositories
2022-08-27 08:54:10.155 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry for hacs
File "/config/custom_components/hacs/__init__.py", line 223, in async_setup_entry
File "/config/custom_components/hacs/__init__.py", line 209, in async_initialize_integration
File "/config/custom_components/hacs/__init__.py", line 196, in async_try_startup
File "/config/custom_components/hacs/__init__.py", line 153, in async_startup
if not await hacs.data.restore():
File "/config/custom_components/hacs/utils/data.py", line 120, in restore
repositories = await async_load_from_store(self.hacs.hass, "repositories") or {}
File "/config/custom_components/hacs/utils/store.py", line 49, in async_load_from_store

More information: Specifically, the components affected are custom:button card defined objects
core 2022.7.7 appears to work with them. core 2022.8.x does not.

The author of hacs does ask that issues are raised on github.

I was thinking that’s where this should go.