HACS - Failed after snapshot restoration

Hi there,

I recently had to restore my Home Assistant OS install from a full snapshot.

At the time of writing, I’m using the latest version of Home Assion OS installed into a Virtual Box environment on Windows 10.

When HA came back online after the restoration, the HACS icon had disappeared from my quick access panel on the left of the screen.

I checked the HACS entry on the integration page and it says “! Not loaded” in the description.

So I searched high and low for a solution, finding lots of threads where users had similar problems but none of their suggestions have worked for me. DISCLAIMER: I am very new to Home Assistant with limited understanding of coding.

I really like HACS and would appreciate it if someone could help me to get it up and running again. Here is what I’ve tried so far:

-the error that shows on boot of HA regarding HACS is the following:

Logger: homeassistant.setup
Source: setup.py:173
First occurred: 03:02:52 (1 occurrences)
Last logged: 03:02:52

Setup failed for hacs: Unable to import component: cannot import name 'ACCEPT_HEADERS' from 'aiogithubapi.common.const' (/usr/local/lib/python3.9/site-packages/aiogithubapi/common/const.py)

-I followed the instructions on this page to remove the integration: https://hacs.xyz/docs/installation/remove
-I am a recent HA adopter so there was nothing in config
-when I click delete on the HACS integration in the UI, nothing happens - instead, I get the following error in my log:

This error originated from a custom integration.

Logger: aiohttp.server
Source: custom_components/hacs/const.py:2
Integration: HACS (documentation, issues)
First occurred: 08:04:02 (1 occurrences)
Last logged: 08:04:02

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 89, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 70, in delete
    result = await hass.config_entries.async_remove(entry_id)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 809, in async_remove
    await entry.async_remove(self.hass)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 467, in async_remove
    component = integration.get_component()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/hacs/__init__.py", line 9, in <module>
    from .const import DOMAIN
  File "/config/custom_components/hacs/const.py", line 2, in <module>
    from aiogithubapi.common.const import ACCEPT_HEADERS
ImportError: cannot import name 'ACCEPT_HEADERS' from 'aiogithubapi.common.const' (/usr/local/lib/python3.9/site-packages/aiogithubapi/common/const.py)

*** the above happened no matter how many times I restarted HA or whether or not I had clicked Disable on the integration (which seems to work as it shows as Disabled)
-I tried at this point to delete the custom_components folder using the File Editor add-on (with the integration both disabled or enabled) but it gave me the following error (both times)


-so I tried renaming the hacs folder in custom_components to “temp_hacs” and then used the following command in the terminal to reinstall HACS:

wget -q -O - https://install.hacs.xyz | bash -

-this showed as successfully installing HACS so I restarted Home Assistant but alas the same thing happened and now I am stuck having tried all of the above without success

My wondering is why can I not use the File Editor to delete the folder in custom_components? And why is nothing happening when I click delete on the integration in the UI?

I’ve tried to include as much information as possible here but please let me know if you need anything extra.

Many thanks :slight_smile:

This has been solved btw.
I received excellent support at the HACS github issue page: