Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't upgrade from 2024.1.5 to 2024.2 #109948

Closed
Steve2017 opened this issue Feb 8, 2024 · 10 comments · Fixed by #109966
Closed

Can't upgrade from 2024.1.5 to 2024.2 #109948

Steve2017 opened this issue Feb 8, 2024 · 10 comments · Fixed by #109966

Comments

@Steve2017
Copy link

The problem

When attempting to upgrade, the system fails and rolls back to 1.5

What version of Home Assistant Core has the issue?

2024.2

What was the last working version of Home Assistant Core?

2024.1.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

na

Link to integration documentation on our website

No response

Diagnostics information

Supervisor log:

24-02-08 15:33:00 INFO (SyncWorker_3) [supervisor.docker.manager] Stopping homeassistant application
24-02-08 15:33:10 INFO (SyncWorker_3) [supervisor.docker.manager] Cleaning homeassistant application
24-02-08 15:33:10 INFO (MainThread) [supervisor.homeassistant.module] Update pulse/client.config: /data/tmp/homeassistant_pulse
24-02-08 15:33:10 INFO (MainThread) [supervisor.docker.homeassistant] Starting Home Assistant ghcr.io/home-assistant/qemux86-64-homeassistant with version 2024.2.0
24-02-08 15:33:10 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
24-02-08 15:33:15 ERROR (MainThread) [supervisor.homeassistant.core] Home Assistant has crashed!
24-02-08 15:33:15 CRITICAL (MainThread) [supervisor.homeassistant.core] HomeAssistant update failed -> rollback!
24-02-08 15:33:15 INFO (MainThread) [supervisor.resolution.module] Create new issue update_rollback - core / None
24-02-08 15:33:15 INFO (MainThread) [supervisor.homeassistant.core] A backup of the logfile is stored in /config/home-assistant-rollback.log
24-02-08 15:33:15 INFO (MainThread) [supervisor.homeassistant.core] Updating Home Assistant to version 2024.1.5
24-02-08 15:33:15 INFO (MainThread) [supervisor.docker.interface] Updating image ghcr.io/home-assistant/qemux86-64-homeassistant:2024.2.0 to ghcr.io/home-assistant/qemux86-64-homeassistant:2024.1.5
24-02-08 15:33:15 INFO (MainThread) [supervisor.docker.interface] Downloading docker image ghcr.io/home-assistant/qemux86-64-homeassistant with tag 2024.1.5.
24-02-08 15:33:17 INFO (SyncWorker_0) [supervisor.docker.manager] Cleaning homeassistant application
24-02-08 15:33:17 INFO (MainThread) [supervisor.homeassistant.module] Update pulse/client.config: /data/tmp/homeassistant_pulse
24-02-08 15:33:17 INFO (MainThread) [supervisor.docker.homeassistant] Starting Home Assistant ghcr.io/home-assistant/qemux86-64-homeassistant with version 2024.1.5
24-02-08 15:33:17 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
24-02-08 15:33:20 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
24-02-08 15:33:20 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
24-02-08 15:33:22 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to NOT_RUNNING

Rollback Log:

2024-02-08 15:33:12.397 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'

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Had to roll back from 2024.1.6 because of Omada issue.

@bdraco
Copy link
Member

bdraco commented Feb 8, 2024

You have a custom integration that is using a list as a unique id. A unique id must be a string.

You'll have to manually fix your /config/.storage/core.config_entries file

  1. Downgrade back to an old version
  2. Check the file for "unique_id":[
  3. delete that integration
  4. upgrade

@dolenec
Copy link

dolenec commented Feb 8, 2024

Why HA do not show in UI which integration is problem. I have same problem.. can not update..

@ludeeus
Copy link
Member

ludeeus commented Feb 8, 2024

Probably hikvision_next

@emontnemery
Copy link
Contributor

emontnemery commented Feb 8, 2024

You have a custom integration that is using a list as a unique id. A unique id must be a string.

You'll have to manually fix your /config/.storage/core.config_entries file

  1. Downgrade back to an old version
  2. Check the file for "unique_id":[
  3. delete that integration
  4. upgrade

I don't agree. If we do optimization which make assumptions which are not enforced, we need to be able to handle the bad data. We need to handle the case where we already have bad data, and also prevent writing new bad data.

@emontnemery emontnemery added this to the 2024.2.1 milestone Feb 8, 2024
@thefunkygibbon
Copy link

thefunkygibbon commented Feb 8, 2024

why does downgrading need to be done .. will the "unique_id":[ not be in the current one? if its not, then why would it be failing on boot up now?

fwiw , I don't seem to have anything "unique_id":[ in my file

@joostlek
Copy link
Member

joostlek commented Feb 8, 2024

@thefunkygibbon can you execute

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

If that doesn't return anything, please open a new issue

@emontnemery
Copy link
Contributor

@thefunkygibbon can you execute

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

If that doesn't return anything, please open a new issue

The unhashable item does not have to be a list, it can also be a dict

@joostlek
Copy link
Member

joostlek commented Feb 8, 2024

Fair point

@thefunkygibbon
Copy link

ok i downgraded and checked the file again and i now have the list entry in there and it is the hikvision_next integration :-(

@Steve2017
Copy link
Author

I removed the Hikvision HACS integration and I can now update.

However, this brings back the Omada issue with 2024.1.6
#109339

I'd hoped the fix was being rolled out in 2024.2, but no, so it's back to 2024.1.5 I go..... although I tried the custom fix and it worked. Removed that, rebooted and now Omada is working again..
The old "Have you rebooted the machine IT fix!".

@frenck frenck removed this from the 2024.2.1 milestone Feb 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants