home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.16k stars 29.83k forks source link

Upgrade to 2022.2.0 failed with many strange errors in logs #65658

Closed blacknell closed 2 years ago

blacknell commented 2 years ago

The problem

As mentioned in issue home-assistant/addons #2375 the upgrade did not run smoothly

The UI hung when doing the upgrade and then I got lots of Gateway 502 errors when using File Editor

I have traced further error messages in the logs (see below) that might be helpful

What version of Home Assistant Core has the issue?

2022.2.0

What was the last working version of Home Assistant Core?

2021.12.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2022-02-03 11:46:25 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2022-02-03 11:46:37 WARNING (MainThread) [homeassistant.setup] Setup of hassio is taking over 10 seconds.
2022-02-03 11:46:43 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /supervisor/options request
2022-02-03 11:46:43 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547586894960] Received invalid command: mobile_app/push_notification_channel
2022-02-03 11:46:57 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that accessed discovery_info.__contains__('ssdp_location') instead of discovery_info.upnp.__contains__('ssdp_location') or discovery_info.ssdp_headers.__contains__('ssdp_location'); this will fail in version 2022.6. Please report issue for upnp using this method at homeassistant/components/upnp/device.py, line 78: if ssdp.ATTR_SSDP_LOCATION not in headers:
2022-02-03 11:46:57 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that accessed discovery_info['ssdp_location'] instead of discovery_info.ssdp_location, discovery_info.upnp['ssdp_location'] or discovery_info.ssdp_headers['ssdp_location']; this will fail in version 2022.6. Please report issue for upnp using this method at homeassistant/components/upnp/device.py, line 81: location = headers[ssdp.ATTR_SSDP_LOCATION]
2022-02-03 11:46:58 WARNING (MainThread) [homeassistant.components.webostv] Please make sure webOS TV media_player.living_room_tv is turned on to complete the migration of configuration.yaml to the UI
2022-02-03 11:46:58 WARNING (MainThread) [homeassistant.components.webostv] Please make sure webOS TV media_player.bedroom_tv is turned on to complete the migration of configuration.yaml to the UI
2022-02-03 11:47:16 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: icloud
2022-02-03 11:48:16 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: icloud
2022-02-03 11:51:08 ERROR (MainThread) [homeassistant.components.hassio.http] Client error on api supervisor/logs request Cannot connect to host 172.30.32.2:80 ssl:default [Connect call failed ('172.30.32.2', 80)]
2022-02-03 11:51:56 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /host/reboot - System is not ready with state: setup
2022-02-03 11:51:56 WARNING (MainThread) [homeassistant.components.hassio] Can't read Supervisor data: System is not ready with state: setup
2022-02-03 11:52:41 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /host/reboot - System is not ready with state: setup
2022-02-03 12:12:03 WARNING (MainThread) [homeassistant.components.hassio] Can't read Supervisor data: System is not ready with state: shutdown
2022-02-03 12:12:45 WARNING (MainThread) [homeassistant.core] Timed out waiting for shutdown stage 1 to complete, the shutdown will continue
2022-02-03 12:12:45 ERROR (MainThread) [homeassistant.components.hassio.handler] Client error on /host/reboot request Server disconnected
2022-02-03 12:12:45 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /host/reboot - 
2022-02-03 12:12:45 WARNING (Thread-4) [homeassistant.util.executor] Thread[SyncWorker_6] is still running at shutdown: File "/usr/local/lib/python3.9/threading.py", line 930, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 77, in _worker
    work_item.run()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 646, in shutdown
    self.join()
  File "/usr/local/lib/python3.9/threading.py", line 1053, in join
    self._wait_for_tstate_lock()
  File "/usr/local/lib/python3.9/threading.py", line 1069, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
2022-02-03 12:12:46 WARNING (Thread-4) [homeassistant.util.executor] Thread[SyncWorker_6] is still running at shutdown: File "/usr/local/lib/python3.9/threading.py", line 930, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 77, in _worker
    work_item.run()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 646, in shutdown
    self.join()
  File "/usr/local/lib/python3.9/threading.py", line 1053, in join
    self._wait_for_tstate_lock()
  File "/usr/local/lib/python3.9/threading.py", line 1069, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
2022-02-03 12:12:55 WARNING (MainThread) [homeassistant.util.executor] Thread[SyncWorker_6] is still running at shutdown: File "/usr/local/lib/python3.9/threading.py", line 930, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 77, in _worker
    work_item.run()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 646, in shutdown
    self.join()
  File "/usr/local/lib/python3.9/threading.py", line 1053, in join
    self._wait_for_tstate_lock()
  File "/usr/local/lib/python3.9/threading.py", line 1069, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
2022-02-03 12:12:56 WARNING (MainThread) [homeassistant.util.executor] Thread[SyncWorker_6] is still running at shutdown: File "/usr/local/lib/python3.9/threading.py", line 930, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 77, in _worker
    work_item.run()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 646, in shutdown
    self.join()
  File "/usr/local/lib/python3.9/threading.py", line 1053, in join
    self._wait_for_tstate_lock()
  File "/usr/local/lib/python3.9/threading.py", line 1069, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
2022-02-03 12:13:03 ERROR (Recorder) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 783, in run
    self._run_event_loop()
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 798, in _run_event_loop
    self._shutdown()
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 1202, in _shutdown
    self.hass.add_job(self._async_stop_queue_watcher_and_event_listener)
  File "/usr/src/homeassistant/homeassistant/core.py", line 364, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 791, in call_soon_threadsafe
    self._check_closed()
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

recorder documentation recorder source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (recorder) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

balloob commented 2 years ago

It was probably doing the migration as the errors are recorder related.