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
73.07k stars 30.57k forks source link

Home assistant not starting after update to 0.81.0 #17915

Closed pixeldublu closed 5 years ago

pixeldublu commented 6 years ago

Home assistant not starting after update to 0.81.0

Home Assistant release with the issue: 0.81.0

Last working Home Assistant release (if known): 0.80.3

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io

Component/platform: Maybe xiaomi aqara ? Not sure

Description of problem: Home assistant not starting anymore... multiple errors.

Traceback (if applicable):

2018-10-28 15:37:00 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=233 from 2018-10-28 13:17:48.205805)
2018-10-28 15:39:36 ERROR (MainThread) [homeassistant.core] Error doing job: Task was destroyed but it is pending!
2018-10-28 15:39:36 ERROR (SyncWorker_12) [concurrent.futures] exception calling callback for <Future at 0x725fcfb0 state=finished returned NoneType>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 417, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "uvloop/loop.pyx", line 1258, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 603, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 607, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 636, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2018-10-28 15:39:36 ERROR (MainThread) [homeassistant.core] Error doing job: Task was destroyed but it is pending!
2018-10-28 15:39:36 ERROR (MainThread) [homeassistant.core] Error doing job: Task was destroyed but it is pending!
2018-10-28 15:39:36 ERROR (SyncWorker_8) [concurrent.futures] exception calling callback for <Future at 0x72b6f4b0 state=finished raised RuntimeError>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/mitemp_bt.py", line 93, in setup_platform
    add_entities(devs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 175, in _schedule_add_entities
    update_before_add
  File "/usr/local/lib/python3.6/site-packages/homeassistant/util/async_.py", line 202, in run_callback_threadsafe
    loop.call_soon_threadsafe(run_callback)
  File "uvloop/loop.pyx", line 1258, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 603, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 607, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 636, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 417, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "uvloop/loop.pyx", line 1258, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 603, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 607, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 636, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2018-10-28 15:39:41 ERROR (SyncWorker_2) [concurrent.futures] exception calling callback for <Future at 0x72b64230 state=finished raised RuntimeError>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/xiaomi_aqara.py", line 142, in setup
    discovery.load_platform(hass, component, DOMAIN, {}, config)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/discovery.py", line 131, in load_platform
    hass_config))
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 245, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "uvloop/loop.pyx", line 1258, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 603, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 607, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 636, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 417, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "uvloop/loop.pyx", line 1258, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 603, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 607, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 636, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
mtweten commented 6 years ago

I got the same-ish error last night when I tried to upgrade to 0.81.0 from 0.80.1. It has a similar signature with some differences. I'm running hassio on an intel NUC.

The only thing stands out to me is that part of the stack trace points to zeroconf, but I don't see why that would be a problem. There is also an AlarmDecoder message at the bottom, but that seems more like a consequence of the previous errors more than anything - not sure though. Seems like something is wrong with async stuff, but I don't know python or the library used well enough to understand it.

Error log:

2018-10-28 17:44:31 WARNING (MainThread) [homeassistant.components.http] legacy_api_password support has been enabled. If you don't require it, remove the 'api_password' from your http config.
2018-10-28 17:44:45 ERROR (SyncWorker_18) [concurrent.futures] exception calling callback for <Future at 0x7f9daa2149e8 state=finished raised RuntimeError>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/zeroconf.py", line 62, in setup
    hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, stop_zeroconf)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 586, in listen_once
    self._hass.loop, self.async_listen_once, event_type, listener,
  File "/usr/local/lib/python3.6/site-packages/homeassistant/util/async_.py", line 202, in run_callback_threadsafe
    loop.call_soon_threadsafe(run_callback)
  File "uvloop/loop.pyx", line 1258, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 603, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 607, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 636, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 417, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "uvloop/loop.pyx", line 1258, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 603, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 607, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 636, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2018-10-28 17:44:45 ERROR (SyncWorker_12) [concurrent.futures] exception calling callback for <Future at 0x7f9db6c98a90 state=finished returned NoneType>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 417, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "uvloop/loop.pyx", line 1258, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 603, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 607, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 636, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2018-10-28 17:44:46 ERROR (SyncWorker_9) [concurrent.futures] exception calling callback for <Future at 0x7f9d9a604a20 state=finished returned NoneType>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 417, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "uvloop/loop.pyx", line 1258, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 603, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 607, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 636, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2018-10-28 17:44:47 ERROR (SyncWorker_11) [concurrent.futures] exception calling callback for <Future at 0x7f9dae94c860 state=finished returned NoneType>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 417, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "uvloop/loop.pyx", line 1258, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 603, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 607, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 636, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2018-10-28 17:44:49 WARNING (Thread-3) [homeassistant.components.alarmdecoder] AlarmDecoder unexpectedly lost connection.
jazzyisj commented 6 years ago

I had a very similar error. Couldn't start, stop, or restart hassio from the command prompt. Ran the check command from the command prompt, noticed this line.

twilio.base.obsolete.ObsoleteException:

TwilioRestClient has been removed from this version of the library. Please refer to current documentation for guidance.

So I removed the twilio component and related references in configuration.yaml. The Hassio UI fired right back up after rebooting the host. I did notice I am not able to restart hassio from the UI for some reason now. I have to restart it from the command line. Might have something to do with the Nest config error that popped up in 0.81.0

Anyway, hope this helps.

pixeldublu commented 6 years ago

Indeed... twillio seems to be the problem. Removed it and i could startup homeassistant.

mtweten commented 6 years ago

@jazzyisj Yep, looks like it was twilio for me as well, though when I ran the check it didn't tell me that for some reason like it told you! Good call though, thanks.

mtweten commented 6 years ago

Looks like fix is in the next point release: https://github.com/home-assistant/home-assistant/pull/17895

cgarwood commented 5 years ago

17885 included a fix for Twilio and was relased in 0.81.1. Please open a new issue if you still have issues after upgrading.