Environment Canada Component Hangs Home Assistant on Restart

Not sure even how to figure this out.

Running HA 100.3 in Docker and everything was running well until I did a server restart for a few changes I made in my snips_intent.yaml, automations.yaml, and ui_lovelave.yaml files.

After clicking the Restart option HA refuses to start and the home-assistant.log files has 1131 lines of errors like below (This is the end of the log file)

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 190, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/openuv/__init__.py", line 189, in async_setup_entry
    await openuv.async_update()
  File "/usr/src/homeassistant/homeassistant/components/openuv/__init__.py", line 281, in async_update
    await asyncio.gather(*tasks)
concurrent.futures._base.CancelledError
2019-10-29 11:31:29 ERROR (SyncWorker_3) [concurrent.futures] exception calling callback for <Future at 0x7fe629352c10 state=finished raised RuntimeError>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/aurora/binary_sensor.py", line 53, in setup_platform
    add_entities([AuroraSensor(aurora_data, name)], True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _schedule_add_entities
    update_before_add,
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 77, in run_callback_threadsafe
    loop.call_soon_threadsafe(run_callback)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 728, in call_soon_threadsafe
    self._check_closed()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 475, in _check_closed
    raise RuntimeError('Event loop is 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.7/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/usr/local/lib/python3.7/asyncio/futures.py", line 362, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 728, in call_soon_threadsafe
    self._check_closed()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 475, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

I reversed the additions I made to the files above and I’ve restarted the Docker container with no change.

Well tracked the problem down.

It’s the Environment Canada Weather Component

Hi Gents, +1 and 100% agree with @rlongfield. We’ll have to live without the component for now, while the author finds out what happened. I’ll dig into the code as soon as I can, but my guess is that while our servers were up, Environment Canada released a new version of their API that changes responses for calls that the component makes during initialization, and the component code blows up big time. Now that we’ve restarted HASS, the issue is evident for us (restarted due to an unrelated config change).

Ditto for me. HA just hangs during startup. Commented out the sensor, component and camera and my HA now starts.

The author is aware of the issue and is currently working on a fix or has pushed a fix that was planned to be out today.