Integration: Fresh install gets "Error setting up entry for hacs"

Created on 29 Oct 2020  路  15Comments  路  Source: hacs/integration


Installation details

| Description | Value |
| -------------------------- | ----- |
| HACS version | 1.6.1
| Home Assistant version | 0.116.4
| Installation method for HA | virtualenv on a Mac

Checklist

  • [x] I'm running the newest version of HACS https://github.com/hacs/integration/releases/latest
  • [x] I have enabled debug logging for my installation.
  • [x] I have filled out the issue template to the best of my ability.
  • [x] I have read https://hacs.xyz/docs/issues
  • [x] This issue is related to the backend of HACS.
  • [x] This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).

Describe the issue

I did a fresh install of HACS on my HA install (moving the hacs folder to the custom_components folder). I waited for a while, because the docs told me to be patient. But i was greeted with a error in the logs. Now im not really sure how to proceed.

Steps to reproduce

1.
2.
3.

Debug logs


Logs


2020-10-29 11:03:56 DEBUG (MainThread) [custom_components.hacs.repository.integration.hacs.integration] Running checks against 1.6.1
2020-10-29 11:03:56 DEBUG (MainThread) [custom_components.hacs.repository.integration.hacs.integration] All (0) checks passed
2020-10-29 11:03:56 INFO (MainThread) [custom_components.hacs.repository.integration.hacs.integration] Registration completed
2020-10-29 11:03:57 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry  for hacs
Traceback (most recent call last):
  File "/Users/michaelschouman/Documents/homeassistant/lib/python3.8/site-packages/homeassistant/config_entries.py", line 231, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/Users/michaelschouman/.homeassistant/custom_components/hacs/__init__.py", line 30, in async_setup_entry
    return await hacs_ui_setup(hass, config_entry)
  File "/Users/michaelschouman/.homeassistant/custom_components/hacs/operational/setup.py", line 62, in async_setup_entry
    return await async_startup_wrapper_for_config_entry()
  File "/Users/michaelschouman/.homeassistant/custom_components/hacs/operational/setup.py", line 87, in async_startup_wrapper_for_config_entry
    startup_result = await async_hacs_startup()
  File "/Users/michaelschouman/.homeassistant/custom_components/hacs/operational/setup.py", line 188, in async_hacs_startup
    async_call_later(hacs.hass, 5, hacs.startup_tasks())
TypeError: startup_tasks() missing 1 required positional argument: '_event'

Bug backend

All 15 comments

Make sure you have read the issue guidelines and that you filled out the entire template.

Will look into this tonight.

Workaround:
If you are using HA 0.117 install 1.5.2
If you are not using HA 0.117 install 1.6.0

Reverting to 1.6.0 does the trick, thanks for the swift reply. If i can be of any help fixing this issue, please let me know.

Just need to append =None to the _event arg for startup_tasks and release a new version.
But I need time to do that and test it that something else does not break.

I just installed 2 days ago and I'm getting the following in my log:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/hacs/__init__.py", line 30, in async_setup_entry
    return await hacs_ui_setup(hass, config_entry)
  File "/config/custom_components/hacs/operational/setup.py", line 62, in async_setup_entry
    return await async_startup_wrapper_for_config_entry()
  File "/config/custom_components/hacs/operational/setup.py", line 87, in async_startup_wrapper_for_config_entry
    startup_result = await async_hacs_startup()
  File "/config/custom_components/hacs/operational/setup.py", line 135, in async_hacs_startup
    await async_setup_frontend()
  File "/config/custom_components/hacs/operational/setup_actions/frontend.py", line 38, in async_setup_frontend
    hacs.hass.components.frontend.async_register_built_in_panel(
  File "/usr/src/homeassistant/homeassistant/components/frontend/__init__.py", line 196, in async_register_built_in_panel
    raise ValueError(f"Overwriting panel {panel.frontend_url_path}")
ValueError: Overwriting panel hacs

This is a brand new machine that I'm setting up so HACS has never been installed on this system. I just got the time to look into the issue but it seems that this is the same thing?

You mentioned changing a bit of code and needed to test so If you'll post what you have I'll change it. You mentioned changing something in this part I believe?.. https://github.com/hacs/integration/blob/09e40170f45a8e0f512b9bcc88926efc93575cd6/custom_components/hacs/operational/setup.py#L184

If you post what should be changed I'll give it a try. I see that your last commit a few days ago modified this and I have no problem trashing this install as it doesn't have anything yet.

I'm running on an older dell x86 optiplex using the hassio nuc image.

@asdf1nit check out this issue as it is what's going on with yours: https://github.com/hacs/integration/issues/1555
Your issue (as posted currently) has nothing to do with "Error setting up entry for hacs"

@ludeeus I'm not so sure it's as simple as editing line 133 in hacsbase/hacs.py to be:
async def startup_tasks(self, _event=None):

I've done that, however still end up with the following log (as far as I can tell, nothing changed):
```2020-11-01 12:34:45 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for 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.
2020-11-01 12:35:07 DEBUG (MainThread) [custom_components.hacs] Configuration type: flow

2020-11-01 12:35:07 INFO (MainThread) [custom_components.hacs]

HACS (Home Assistant Community Store)
Version: 1.6.1
This is a custom integration
If you have any issues with this you need to open an issue here:

https://github.com/hacs/integration/issues

2020-11-01 12:35:07 INFO (MainThread) [custom_components.hacs] Setup task HacsSetupTask.WEBSOCKET
2020-11-01 12:35:07 INFO (MainThread) [custom_components.hacs] Setup task HacsSetupTask.FRONTEND
2020-11-01 12:35:08 INFO (MainThread) [custom_components.hacs] Setup task HacsSetupTask.CATEGORIES
2020-11-01 12:35:16 DEBUG (MainThread) [custom_components.hacs] Can update 489 repositories
2020-11-01 12:35:16 INFO (MainThread) [custom_components.hacs] Setup task HacsSetupTask.HACS_REPO
2020-11-01 12:35:16 DEBUG (MainThread) [custom_components.hacs.repository.integration.hacs.integration] Checking repository.
2020-11-01 12:35:17 DEBUG (MainThread) [custom_components.hacs.repository.integration.hacs.integration] Running checks against 1.6.1
2020-11-01 12:35:17 DEBUG (MainThread) [custom_components.hacs.repository.integration.hacs.integration] All (0) checks passed
2020-11-01 12:35:17 INFO (MainThread) [custom_components.hacs.repository.integration.hacs.integration] Registration completed
2020-11-01 12:35:17 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry for hacs
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 234, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/hacs/__init__.py", line 30, in async_setup_entry
return await hacs_ui_setup(hass, config_entry)
File "/config/custom_components/hacs/operational/setup.py", line 62, in async_setup_entry
return await async_startup_wrapper_for_config_entry()
File "/config/custom_components/hacs/operational/setup.py", line 87, in async_startup_wrapper_for_config_entry
startup_result = await async_hacs_startup()
File "/config/custom_components/hacs/operational/setup.py", line 175, in async_hacs_startup
if not await hacs.data.restore():
File "/config/custom_components/hacs/hacsbase/data.py", line 92, in restore
hacs = await async_load_from_store(self.hacs.hass, "hacs")
File "/config/custom_components/hacs/helpers/functions/store.py", line 14, in async_load_from_store
restored = await store.async_load()
File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 105, in async_load
return await self._load_task
File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 123, in _async_load
if data["version"] == self.version:
KeyError: 'version'

It should be that easy, you have a completely different problem.
For you, (and you only no one else reading this!!!), delete the /config/.storage/hacs.hacs file

It should be that easy, you have a completely different problem.
For you, (and you only no one else reading this!!!), delete the /config/.storage/hacs.hacs file

You, Sir, are a genius! I thought I had purged everything from a hacs install when I first got into HA several years ago. Decided to finally revisit it and low and behold, had a couple hacs files in there that I removed. Things appear to be working now.

Fixed in https://github.com/hacs/integration/releases/tag/1.6.2

I have the same issue installing HACS 1.6.2 today.

HACS
Integration version: | 1.6.2
Frontend version: | 202009091732

Home Assistant 0.117.6
Frontend version: 20201021.4 - latest

Log:

2020-11-15 13:21:59 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for 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.
2020-11-15 13:22:03 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for xiaomi_miio_airpurifier 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.
2020-11-15 13:22:23 WARNING (MainThread) [homeassistant.config_entries] Config entry for hacs not ready yet. Retrying in 5 seconds
2020-11-15 13:22:28 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry for hacs
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 234, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/hacs/__init__.py", line 30, in async_setup_entry
return await hacs_ui_setup(hass, config_entry)
File "/config/custom_components/hacs/operational/setup.py", line 66, in async_setup_entry
return await async_startup_wrapper_for_config_entry()
File "/config/custom_components/hacs/operational/setup.py", line 91, in async_startup_wrapper_for_config_entry
startup_result = await async_hacs_startup()
File "/config/custom_components/hacs/operational/setup.py", line 139, in async_hacs_startup
await async_setup_frontend()
File "/config/custom_components/hacs/operational/setup_actions/frontend.py", line 38, in async_setup_frontend
hacs.hass.components.frontend.async_register_built_in_panel(
File "/usr/src/homeassistant/homeassistant/components/frontend/__init__.py", line 196, in async_register_built_in_panel
raise ValueError(f"Overwriting panel {panel.frontend_url_path}")
ValueError: Overwriting panel hacs

Same for me after a fresh install in a VM (HA 0.117.6 and HACS 1.6.2):

2020-11-15 17:27:50 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for 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.
2020-11-15 17:28:05 WARNING (MainThread) [homeassistant.config_entries] Config entry for hacs not ready yet. Retrying in 5 seconds
2020-11-15 17:28:10 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry for hacs
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 234, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/hacs/__init__.py", line 30, in async_setup_entry
return await hacs_ui_setup(hass, config_entry)
File "/config/custom_components/hacs/operational/setup.py", line 66, in async_setup_entry
return await async_startup_wrapper_for_config_entry()
File "/config/custom_components/hacs/operational/setup.py", line 91, in async_startup_wrapper_for_config_entry
startup_result = await async_hacs_startup()
File "/config/custom_components/hacs/operational/setup.py", line 139, in async_hacs_startup
await async_setup_frontend()
File "/config/custom_components/hacs/operational/setup_actions/frontend.py", line 38, in async_setup_frontend
hacs.hass.components.frontend.async_register_built_in_panel(
File "/usr/src/homeassistant/homeassistant/components/frontend/__init__.py", line 196, in async_register_built_in_panel
raise ValueError(f"Overwriting panel {panel.frontend_url_path}")
ValueError: Overwriting panel hacs

And for me after a fresh install in a Proxmox VM (HA 0.117.6 and HACS 1.6.2):
arch | x86_64 -- | -- chassis | vm dev | false docker | true docker_version | 19.03.12 hassio | true host_os | HassOS 4.16 installation_type | Home Assistant OS os_name | Linux os_version | 5.4.75 python_version | 3.8.6 supervisor | 2020.11.0 version | 0.117.6 virtualenv | false

Log:


 Logger: homeassistant.config_entries
Source: components/frontend/__init__.py:196
First occurred: 1:14:10 (1 occurrences)
Last logged: 1:14:10

 Error setting up entry for hacs
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 234, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/hacs/__init__.py", line 30, in async_setup_entry
    return await hacs_ui_setup(hass, config_entry)
  File "/config/custom_components/hacs/operational/setup.py", line 66, in async_setup_entry
    return await async_startup_wrapper_for_config_entry()
  File "/config/custom_components/hacs/operational/setup.py", line 91, in async_startup_wrapper_for_config_entry
    startup_result = await async_hacs_startup()
  File "/config/custom_components/hacs/operational/setup.py", line 139, in async_hacs_startup
    await async_setup_frontend()
  File "/config/custom_components/hacs/operational/setup_actions/frontend.py", line 38, in async_setup_frontend
    hacs.hass.components.frontend.async_register_built_in_panel(
  File "/usr/src/homeassistant/homeassistant/components/frontend/__init__.py", line 196, in async_register_built_in_panel
    raise ValueError(f"Overwriting panel {panel.frontend_url_path}")
ValueError: Overwriting panel hacs

I had the same issue, waiting 24h and then restarting HA seems to have fixed it for now.

Hi, I substituted the content of Hacs folder as in

https://github.com/hacs/integration/releases/tag/1.6.2

But still getting the same error... am I missing something? Thanks .

Hi, I substituted the content of Hacs folder as in

https://github.com/hacs/integration/releases/tag/1.6.2

But still getting the same error... am I missing something? Thanks .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

astrandb picture astrandb  路  3Comments

lbouriez picture lbouriez  路  6Comments

noxhirsch picture noxhirsch  路  6Comments

Tamas-Toth-ebola picture Tamas-Toth-ebola  路  6Comments

SeanPM5 picture SeanPM5  路  6Comments