core icon indicating copy to clipboard operation
core copied to clipboard

2024.2.0 not starting for unknown reason

Open brave0d opened this issue 1 year ago • 9 comments

The problem

Just updated my docker container to latest version - 2024.2.0 from 2024.1.6 and getting the following error in docker logs:

2024-02-07 20:33:26.421 ERROR (MainThread) [root] Uncaught exception
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 221, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/runner.py", line 188, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 684, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in setup_and_run_hass
    hass = await bootstrap.async_setup_hass(runtime_config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 203, in async_setup_hass
    await async_from_config_dict(config_dict, hass) is not None
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 319, in async_from_config_dict
    await async_load_base_functionality(hass)
  File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 296, in async_load_base_functionality
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1354, in async_initialize
    entries[entry_id] = config_entry
    ~~~~~~~^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1148, in __setitem__
    self._domain_unique_id_index.setdefault(entry.domain, {})[
TypeError: unhashable type: 'list'

container keeps restarting.

I guess it might be some custom integration I have enabled, but no idea which one. The information is so vague, so I cannot even know where to dig.

What version of Home Assistant Core has the issue?

2024.2.0

What was the last working version of Home Assistant Core?

2024.1.6

What type of installation are you running?

Home Assistant Container

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

brave0d avatar Feb 07 '24 21:02 brave0d

Do you have hikvision_next installed?

joostlek avatar Feb 07 '24 21:02 joostlek

I have exactly the same issue after pulling the 2024.2.0 image.

kst84 avatar Feb 07 '24 21:02 kst84

same problem. Yes, hikvision_next are installed.

vampywiz17 avatar Feb 07 '24 21:02 vampywiz17

Same problem. Back to 2024.1.5

msaphoto06 avatar Feb 07 '24 21:02 msaphoto06

The hikvision_next config entries should be removed and someone should create an issue at hikvision_next repository

joostlek avatar Feb 07 '24 21:02 joostlek

@joostlek

Do you have hikvision_next installed?

😮 wow, how do you know? I do have it...

We got this issue during beta, but the guy didn't need the integration anymore and I didn't have time to file an issue

joostlek avatar Feb 07 '24 21:02 joostlek

https://github.com/maciej-or/hikvision_next/issues/138

brave0d avatar Feb 07 '24 21:02 brave0d

I also had a similar error with my Home Assistant, but I am not using hikvision. I see that it's an ip camera integration... I am using a custom integration for my doorbell which is Eufy home: https://github.com/fuatakgun/eufy_security

Here are my logs, for what they're worth:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 221, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/runner.py", line 188, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 684, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in setup_and_run_hass
    hass = await bootstrap.async_setup_hass(runtime_config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 203, in async_setup_hass
    await async_from_config_dict(config_dict, hass) is not None
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 319, in async_from_config_dict
    await async_load_base_functionality(hass)
  File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 296, in async_load_base_functionality
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1354, in async_initialize
    entries[entry_id] = config_entry
    ~~~~~~~^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1148, in __setitem__
    self._domain_unique_id_index.setdefault(entry.domain, {})[
TypeError: unhashable type: 'list'``` 

DarkWolf7 avatar Feb 07 '24 21:02 DarkWolf7

Same issues this is my log...

2024-02-08 10:14:51.561 ERROR (MainThread) [root] Uncaught exception Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 221, in sys.exit(main()) ^^^^^^ File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/runner.py", line 188, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/base_events.py", line 684, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in setup_and_run_hass hass = await bootstrap.async_setup_hass(runtime_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 203, in async_setup_hass await async_from_config_dict(config_dict, hass) is not None ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 319, in async_from_config_dict await async_load_base_functionality(hass) File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 296, in async_load_base_functionality await asyncio.gather( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1354, in async_initialize entries[entry_id] = config_entry ~~~~~~~^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1148, in setitem self._domain_unique_id_index.setdefault(entry.domain, {})[ TypeError: unhashable type: 'list'

alanburchill avatar Feb 08 '24 00:02 alanburchill

Same issue here, I do also have hikvision_next in custom components

GroteGehaktBal avatar Feb 08 '24 01:02 GroteGehaktBal

I have the same issue, however I do not have hikvision integrations.

jcarr avatar Feb 08 '24 02:02 jcarr

same issue . I have the next add-on why is ha made in such a way that a custom integration can stop the whole system booting up correctly. surely having some kind of boot process which if a integration doesn't load it is simply dropped and ignored from the boot process .

moved the integration elsewhere but still failing on boot. error parts of logs are as follows but can't see anything in it pointing to anything I recognise

2024-02-08 07:23:09.910 ERROR (MainThread) [root] Uncaught exception Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 221, in <module> sys.exit(main()) ^^^^^^ File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/runner.py", line 188, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/base_events.py", line 684, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in setup_and_run_hass hass = await bootstrap.async_setup_hass(runtime_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 203, in async_setup_hass await async_from_config_dict(config_dict, hass) is not None ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 319, in async_from_config_dict await async_load_base_functionality(hass) File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 296, in async_load_base_functionality await asyncio.gather( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1354, in async_initialize entries[entry_id] = config_entry ~~~~~~~^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1148, in __setitem__ self._domain_unique_id_index.setdefault(entry.domain, {})[ TypeError: unhashable type: 'list'

thefunkygibbon avatar Feb 08 '24 07:02 thefunkygibbon

Same issue, i'm using the docker image...

robex2005 avatar Feb 08 '24 07:02 robex2005

Everyone who uses the Hikvision, please stop posting as we know it's an issue. For the others, I'll cook up a script with which we can identify the integration you're struggling with

joostlek avatar Feb 08 '24 07:02 joostlek

jq -r '.data.entries[] | select(.unique_id | type == "array") | {unique_id, domain}' /config/.storage/core.config_entries

joostlek avatar Feb 08 '24 08:02 joostlek

If you execute that, it will note down integrations which have an unique_id setup incorrectly

joostlek avatar Feb 08 '24 08:02 joostlek

If you execute that, it will note down integrations which have an unique_id setup incorrectly

Mine was schlage

jcarr avatar Feb 08 '24 08:02 jcarr

Do you use a custom integration for this?

joostlek avatar Feb 08 '24 08:02 joostlek

Do you use a custom integration for this?

I believe I am using a built in integration: https://github.com/home-assistant/core/tree/dev/homeassistant/components/schlage

jcarr avatar Feb 08 '24 08:02 jcarr

Can you please confirm this? Does /config/custom_components/schlage exist?

Did you use a custom component for schlage before you migrated to core? When did you install schlage?

Cc @dknowles2

joostlek avatar Feb 08 '24 08:02 joostlek

~~I think we may have to revert https://github.com/home-assistant/core/pull/107590 and come up with a non destructive solution which handles existing unhashable data.~~

Let's not revert, the change in #109966 should fix this issue 👍

emontnemery avatar Feb 08 '24 08:02 emontnemery

Can you please confirm this? Does /config/custom_components/schlage exist?

Did you use a custom component for schlage before you migrated to core? When did you install schlage?

Cc @dknowles2

I'm fairly confident the schlage integration has always set unique_id as a string. (Even the old custom integration...)

dknowles2 avatar Feb 08 '24 12:02 dknowles2

@jcarr Can you maybe post the output of the command so we know what the unique_id was?

joostlek avatar Feb 08 '24 12:02 joostlek

I'm having the same issue as well after attempting to upgrade to v2024.2.0 using a docker container image.

schlage was my culprit as well using the script above:

config_entries { "unique_id": [ "s****n@s*****t.com" ], "domain": "schlage" }

I do have a custom component for Schlage (I believe there was a reason for this?) (https://github.com/mcnutter1/homeasssitant-schlage)

root@Server:/mnt/zfs-nvme/docker/homeassistant# ls -lart custom_components/schlage/ total 89 -rw-rw-rw- 1 nobody users 3237 Jun 26 2023 init.py -rw-rw-rw- 1 nobody users 2187 Jun 26 2023 config_flow.py -rw-rw-rw- 1 nobody users 197 Jun 26 2023 const.py -rw-rw-rw- 1 nobody users 3176 Jun 26 2023 lock.py -rw-rw-rw- 1 nobody users 4990 Jun 26 2023 new_api.py -rw-rw-rw- 1 nobody users 2620 Jun 26 2023 sensor.py drwxrwxrwx 2 nobody users 3 Jun 26 2023 translations/ -rw-rw-rw- 1 nobody users 567 Jun 26 2023 strings.json -rw-rw-rw- 1 nobody users 359 Jun 26 2023 manifest.json drwxrwxrwx 4 nobody users 12 Jun 26 2023 ./ drwxr-xr-x 2 nobody users 8 Jun 26 2023 pycache/ drwxr-xr-x 18 nobody users 18 Feb 5 09:20 ../

StephenShamakian avatar Feb 08 '24 14:02 StephenShamakian