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.56k stars 30.74k forks source link

Random - RuntimeError: Event loop is closed #25328

Closed shreram closed 5 years ago

shreram commented 5 years ago

Home Assistant release with the issue:

arch x86_64
dev false
docker true
hassio false
os_name Linux
python_version 3.7.4
timezone America/Chicago
version 0.96.1
virtualenv false

Last working Home Assistant release (if known):

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

Component/platform:

Description of problem:

Almost every day HA randomly is non-responsive. I turned on debug logging and gathered additional information. I couldn't pinpoint the component which is causing this issue.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

Traceback (if applicable):

2019-07-19 22:20:11 DEBUG (Thread-5753) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 22:20:11 DEBUG (Thread-5753) [nest.nest] <<< keep-alive event
2019-07-19 22:20:13 DEBUG (Thread-7) [pychromecast.socket_client] [Living room Home:8009] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 0, 'status': {'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.5, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2019-07-19 22:20:13 DEBUG (Thread-7) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.5, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='')
2019-07-19 22:20:13 DEBUG (Thread-7) [pychromecast.socket_client] [Living room Home:8009] Sending: Message urn:x-cast:com.google.cast.tp.connection from sender-0 to 5a1890aa-ab7a-4861-b9b8-e2b9a329c40e: {'type': 'CLOSE', 'origin': {}}
2019-07-19 22:20:13 ERROR (Thread-7) [pychromecast.controllers.media] Exception thrown when calling media status callback
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pychromecast/controllers/media.py", line 477, in _fire_status_changed
    listener.new_media_status(self.status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 394, in new_media_status
    self._cast_device.new_media_status(media_status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 761, in new_media_status
    self.schedule_update_ha_state()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 339, in schedule_update_ha_state
    self.hass.add_job(self.async_update_ha_state(force_refresh))
  File "/usr/src/app/homeassistant/core.py", line 255, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2019-07-19 22:20:13 ERROR (Thread-7) [pychromecast.controllers] Exception thrown when calling cast status listener
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pychromecast/socket_client.py", line 1048, in _report_status
    listener.new_cast_status(self.status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 389, in new_cast_status
    self._cast_device.new_cast_status(cast_status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 755, in new_cast_status
    self.schedule_update_ha_state()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 339, in schedule_update_ha_state
    self.hass.add_job(self.async_update_ha_state(force_refresh))
  File "/usr/src/app/homeassistant/core.py", line 255, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2019-07-19 22:20:41 DEBUG (Thread-5753) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 22:20:41 DEBUG (Thread-5753) [nest.nest] <<< keep-alive event
2019-07-19 22:21:11 DEBUG (Thread-5753) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 22:21:11 DEBUG (Thread-5753) [nest.nest] <<< keep-alive event
2019-07-19 22:21:41 DEBUG (Thread-5753) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 22:21:41 DEBUG (Thread-5753) [nest.nest] <<< keep-alive event
2019-07-19 22:21:48 DEBUG (Dummy-18) [libopenzwave] notif_callback : new notification
2019-07-19 22:21:48 DEBUG (Dummy-18) [libopenzwave] notif_callback : Notification type : 2, nodeId : 2
2019-07-19 22:21:48 DEBUG (Dummy-18) [libopenzwave] addValueId : ValueID : 72057594076282880
2019-07-19 22:21:48 DEBUG (Dummy-18) [libopenzwave] addValueId : GetCommandClassId : 37, GetType : 0
2019-07-19 22:21:48 DEBUG (Dummy-18) [libopenzwave] addValueId : Notification : {'notificationType': 'ValueChanged', 'homeId': 3621646896, 'nodeId': 2, 'valueId': {'homeId': 3621646896, 'nodeId': 2, 'commandClass': 'COMMAND_CLASS_SWITCH_BINARY', 'instance': 1, 'index': 0, 'id': 72057594076282880, 'genre': 'User', 'type': 'Bool', 'value': True, 'label': 'Switch', 'units': '', 'readOnly': False}}
2019-07-19 22:21:48 DEBUG (Dummy-18) [libopenzwave] notif_callback : call callback context
2019-07-19 22:21:48 DEBUG (Dummy-18) [openzwave] zwcallback args=[{'notificationType': 'ValueChanged', 'homeId': 3621646896, 'nodeId': 2, 'valueId': {'homeId': 3621646896, 'nodeId': 2, 'commandClass': 'COMMAND_CLASS_SWITCH_BINARY', 'instance': 1, 'index': 0, 'id': 72057594076282880, 'genre': 'User', 'type': 'Bool', 'value': True, 'label': 'Switch', 'units': '', 'readOnly': False}}]
2019-07-19 22:21:48 DEBUG (Dummy-18) [openzwave] Z-Wave Notification ValueChanged : {'notificationType': 'ValueChanged', 'homeId': 3621646896, 'nodeId': 2, 'valueId': {'homeId': 3621646896, 'nodeId': 2, 'commandClass': 'COMMAND_CLASS_SWITCH_BINARY', 'instance': 1, 'index': 0, 'id': 72057594076282880, 'genre': 'User', 'type': 'Bool', 'value': True, 'label': 'Switch', 'units': '', 'readOnly': False}}
2019-07-19 22:21:48 ERROR (Dummy-18) [openzwave] Error in manager callback
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/openzwave/network.py", line 952, in zwcallback
    self._handle_value_changed(args)
  File "/usr/local/lib/python3.7/site-packages/openzwave/network.py", line 1504, in _handle_value_changed
    'value' : self.nodes[args['nodeId']].values[args['valueId']['id']]})
  File "/usr/local/lib/python3.7/site-packages/pydispatch/dispatcher.py", line 338, in send
    **named
  File "/usr/local/lib/python3.7/site-packages/pydispatch/robustapply.py", line 55, in robustApply
    return receiver(*arguments, **named)
  File "/usr/src/app/homeassistant/components/zwave/node_entity.py", line 157, in network_node_changed
    self.node_changed()
  File "/usr/src/app/homeassistant/components/zwave/node_entity.py", line 198, in node_changed
    self.maybe_schedule_update()
  File "/usr/src/app/homeassistant/components/zwave/node_entity.py", line 56, in maybe_schedule_update
    self.hass.add_job(self._schedule_update)
  File "/usr/src/app/homeassistant/core.py", line 255, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2019-07-19 22:21:48 DEBUG (Dummy-18) [libopenzwave] notif_callback : end
2019-07-19 22:21:48 DEBUG (Dummy-18) [libopenzwave] notif_callback : new notification
2019-07-19 22:21:48 DEBUG (Dummy-18) [libopenzwave] notif_callback : Notification type : 22, nodeId : 2
2019-07-19 22:21:48 DEBUG (Dummy-18) [libopenzwave] notif_callback : call callback context
2019-07-19 22:21:48 DEBUG (Dummy-18) [openzwave] zwcallback args=[{'notificationType': 'NodeQueriesComplete', 'homeId': 3621646896, 'nodeId': 2}]
2019-07-19 22:21:48 DEBUG (Dummy-18) [openzwave] Z-Wave Notification NodeQueriesComplete : {'notificationType': 'NodeQueriesComplete', 'homeId': 3621646896, 'nodeId': 2}
2019-07-19 22:21:48 DEBUG (Dummy-18) [openzwave] Z-Wave Notification Node : home_id: [0xd7ddf230] id: [2] name: [] model: [12722 On/Off Relay Switch]
2019-07-19 22:21:48 ERROR (Dummy-18) [openzwave] Error in manager callback
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/openzwave/network.py", line 978, in zwcallback
    self._handle_node_queries_complete(args)
  File "/usr/local/lib/python3.7/site-packages/openzwave/network.py", line 1288, in _handle_node_queries_complete
    self._handle_node(self.nodes[args['nodeId']])
  File "/usr/local/lib/python3.7/site-packages/openzwave/network.py", line 1128, in _handle_node
    **{'network': self, 'node':node})
  File "/usr/local/lib/python3.7/site-packages/pydispatch/dispatcher.py", line 338, in send
    **named
  File "/usr/local/lib/python3.7/site-packages/pydispatch/robustapply.py", line 55, in robustApply
    return receiver(*arguments, **named)
  File "/usr/src/app/homeassistant/components/zwave/node_entity.py", line 157, in network_node_changed
    self.node_changed()
  File "/usr/src/app/homeassistant/components/zwave/node_entity.py", line 198, in node_changed
    self.maybe_schedule_update()
  File "/usr/src/app/homeassistant/components/zwave/node_entity.py", line 56, in maybe_schedule_update
    self.hass.add_job(self._schedule_update)
  File "/usr/src/app/homeassistant/core.py", line 255, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed

Additional information:

shreram commented 5 years ago

Last night another error and had to stop and start the container.


2019-07-19 23:35:35 DEBUG (SyncWorker_6) [trakt.core] get: https://api-v2launch.trakt.tv/calendars/my/shows/2019-07-19/10
2019-07-19 23:35:35 DEBUG (SyncWorker_6) [trakt.core] headers: {'Content-Type': 'application/json', 'trakt-api-version': '2', 'trakt-api-key': 'LONGNUMBER', 'Authorization': 'Bearer TOKEN'}
2019-07-19 23:35:35 DEBUG (SyncWorker_6) [trakt.core] method, url :: get, https://api-v2launch.trakt.tv/calendars/my/shows/2019-07-19/10
2019-07-19 23:35:35 DEBUG (SyncWorker_6) [trakt.core] RESPONSE [get] (https://api-v2launch.trakt.tv/calendars/my/shows/2019-07-19/10): <Response [500]>
2019-07-19 23:35:35 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "uvloop/loop.pyx", line 1445, in uvloop.loop.Loop.run_until_complete
  File "uvloop/loop.pyx", line 1438, in uvloop.loop.Loop.run_until_complete
  File "uvloop/loop.pyx", line 1347, in uvloop.loop.Loop.run_forever
  File "uvloop/loop.pyx", line 487, in uvloop.loop.Loop._run
  File "uvloop/loop.pyx", line 404, in uvloop.loop.Loop._on_idle
  File "uvloop/cbhandles.pyx", line 68, in uvloop.loop.Handle._run
  File "/usr/src/app/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 380, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/trakt/sensor.py", line 144, in update
    calendar = MyShowCalendar(days=self._days)
  File "/usr/local/lib/python3.7/site-packages/trakt/calendar.py", line 31, in __init__
    self._get()
  File "/usr/local/lib/python3.7/site-packages/trakt/core.py", line 455, in inner
    json_data = self._handle_request('get', url)
  File "/usr/local/lib/python3.7/site-packages/trakt/core.py", line 432, in _handle_request
    raise self.error_map[response.status_code]()
trakt.errors.TraktInternalException: Internal Server Error
2019-07-19 23:35:35 DEBUG (MainThread) [aioharmony.responsehandler] Received STOP for callback handler
2019-07-19 23:35:35 DEBUG (MainThread) [aioharmony.responsehandler] Callback handler stopped.
2019-07-19 23:35:35 DEBUG (MainThread) [aioharmony.hubconnector] 192.168.86.130: Received STOP for listener
2019-07-19 23:35:35 DEBUG (MainThread) [aioharmony.hubconnector] 192.168.86.130: Listener stopped.

2019-07-19 23:35:50 ERROR (SyncWorker_3) [concurrent.futures] exception calling callback for <Future at 0x1458402da850 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/app/homeassistant/components/speedtestdotnet/__init__.py", line 79, in update
    dispatcher_send(self._hass, DATA_UPDATED)
  File "/usr/src/app/homeassistant/helpers/dispatcher.py", line 68, in dispatcher_send
    hass.loop.call_soon_threadsafe(async_dispatcher_send, hass, signal, *args)
  File "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, 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.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 "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2019-07-19 23:35:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:35:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:36:28 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:36:28 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:36:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:36:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:37:22 DEBUG (SubscribeMessageWorker) [homeassistant.components.wink] {'capabilities': {'fields': [{'field': 'connection', 'mutability': 'read-only', 'type': 'boolean'}, {'field': 'powered', 'mutability': 'read-write', 'type': 'boolean'}, {'field': 'brightness', 'mutability': 'read-write', 'type': 'percentage'}]}, 'created_at': 1512444765, 'desired_state': {}, 'device_manufacturer': 'sengled', 'gang_id': None, 'hidden_at': None, 'hub_id': '677334', 'icon_code': 'light_bulb-light_bulb', 'icon_id': '71', 'last_reading': {'brightness': 1.0, 'brightness_changed_at': 1558599404.5909247, 'brightness_updated_at': 1563597409.0227919, 'connection': True, 'connection_changed_at': 1562905492.7579682, 'connection_updated_at': 1563597409.0227919, 'desired_brightness_changed_at': 1562905513.8150935, 'desired_brightness_updated_at': 1563597435.699885, 'desired_powered_changed_at': 1563597313.1867664, 'desired_powered_updated_at': 1563597313.1867664, 'firmware_date_code': None, 'firmware_date_code_updated_at': None, 'firmware_version': '0.0b00 / 0.0b03', 'firmware_version_changed_at': 1512444775.5198102, 'firmware_version_updated_at': 1563597409.0227919, 'powered': False, 'powered_changed_at': 1563597313.1314814, 'powered_updated_at': 1563597409.0227919}, 'lat_lng': [38.573252, -90.623834], 'light_bulb_id': '3201479', 'linked_service_id': None, 'local_id': '5', 'locale': 'en_us', 'location': '16437 Cherry Valley Ct, Wildwood, MO 63040, USA', 'manufacturer_device_id': None, 'manufacturer_device_model': 'sengled_e11_g13', 'model_name': 'Element Classic', 'name': 'Hallway Light Bulb Two', 'object_id': '3201479', 'object_type': 'light_bulb', 'order': 0, 'primary_upc_code': 'sengled-element-classic-softwhite', 'radio_type': 'zigbee', 'subscription': {'pubnub': {'channel': '628332c36ab40a6bc8d339fc44f9899aac7b4af4|light_bulb-3201479|user-709438', 'origin': 'notifier.wink.com', 'subscribe_key': 'sub-c-f7bf7f7e-0542-11e3-a5e8-02ee2ddab7fe'}}, 'triggers': [], 'units': {}, 'upc_code': 'sengled-element-classic-softwhite', 'upc_id': '1234', 'updated_at': 1563581610, 'user_ids': ['709438'], 'uuid': '284fa35c-9247-40c3-820a-5415a2b184f8', 'nonce': '2001116426'}
2019-07-19 23:37:28 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:37:28 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:37:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:37:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:38:28 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:38:28 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:38:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:38:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:39:28 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:39:28 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:39:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:39:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:40:17 DEBUG (Thread-15) [pychromecast.socket_client] [Living room Home:8009] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 0, 'status': {'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.5, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2019-07-19 23:40:17 DEBUG (Thread-15) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.5, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='')
2019-07-19 23:40:17 DEBUG (Thread-15) [pychromecast.socket_client] [Living room Home:8009] Sending: Message urn:x-cast:com.google.cast.tp.connection from sender-0 to 14027cc3-30a1-4143-973a-ed190ac086b9: {'type': 'CLOSE', 'origin': {}}
2019-07-19 23:40:17 ERROR (Thread-15) [pychromecast.controllers.media] Exception thrown when calling media status callback
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pychromecast/controllers/media.py", line 477, in _fire_status_changed
    listener.new_media_status(self.status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 394, in new_media_status
    self._cast_device.new_media_status(media_status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 761, in new_media_status
    self.schedule_update_ha_state()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 339, in schedule_update_ha_state
    self.hass.add_job(self.async_update_ha_state(force_refresh))
  File "/usr/src/app/homeassistant/core.py", line 255, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2019-07-19 23:40:17 ERROR (Thread-15) [pychromecast.controllers] Exception thrown when calling cast status listener
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pychromecast/socket_client.py", line 1048, in _report_status
    listener.new_cast_status(self.status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 389, in new_cast_status
    self._cast_device.new_cast_status(cast_status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 755, in new_cast_status
    self.schedule_update_ha_state()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 339, in schedule_update_ha_state
    self.hass.add_job(self.async_update_ha_state(force_refresh))
  File "/usr/src/app/homeassistant/core.py", line 255, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2019-07-19 23:40:28 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:40:28 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:40:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:40:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:41:28 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:41:28 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:41:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:41:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:42:28 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:42:28 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:42:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:42:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:43:28 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:43:28 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:43:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:43:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:44:14 DEBUG (Thread-4) [sseclient] Dispatching put event, 7278 bytes...
2019-07-19 23:44:14 DEBUG (Thread-4) [nest.nest] <<< put event
2019-07-19 23:44:14 DEBUG (Nest update listener) [homeassistant.components.nest] Dispatching nest data update
2019-07-19 23:44:28 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:44:28 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:44:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:44:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:45:00 DEBUG (Thread-16) [pychromecast.socket_client] [Home group ALL :42116] Received: Message urn:x-cast:com.google.cast.multizone from receiver-0 to *: {'device': {'capabilities': 196612, 'deviceId': '499c6523-bbca-9bdb-84f2-91ec7da5e6ca', 'name': 'Living room Home', 'volume': {'level': 0.3636363744735718, 'muted': False}}, 'requestId': 0, 'type': 'DEVICE_UPDATED'}
2019-07-19 23:45:00 DEBUG (Thread-10) [pychromecast.socket_client] [All Speakers:42024] Received: Message urn:x-cast:com.google.cast.multizone from receiver-0 to *: {'device': {'capabilities': 196612, 'deviceId': '499c6523-bbca-9bdb-84f2-91ec7da5e6ca', 'name': 'Living room Home', 'volume': {'level': 0.3636363744735718, 'muted': False}}, 'requestId': 0, 'type': 'DEVICE_UPDATED'}
2019-07-19 23:45:00 DEBUG (Thread-10) [pychromecast.socket_client] [All Speakers:42024] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 0, 'status': {'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.34840908646583557, 'muted': False, 'stepInterval': 0.05000000074505806}}, 'type': 'RECEIVER_STATUS'}
2019-07-19 23:45:00 DEBUG (Thread-10) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.34840908646583557, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='')
2019-07-19 23:45:00 ERROR (Thread-10) [pychromecast.controllers] Exception thrown when calling cast status listener
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pychromecast/socket_client.py", line 1048, in _report_status
    listener.new_cast_status(self.status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 389, in new_cast_status
    self._cast_device.new_cast_status(cast_status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 755, in new_cast_status
    self.schedule_update_ha_state()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 339, in schedule_update_ha_state
    self.hass.add_job(self.async_update_ha_state(force_refresh))
  File "/usr/src/app/homeassistant/core.py", line 255, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2019-07-19 23:45:00 DEBUG (Thread-15) [pychromecast.socket_client] [Living room Home:8009] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 0, 'status': {'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.3636363744735718, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2019-07-19 23:45:00 DEBUG (Thread-15) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.3636363744735718, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='')
2019-07-19 23:45:00 ERROR (Thread-15) [pychromecast.controllers] Exception thrown when calling cast status listener
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pychromecast/socket_client.py", line 1048, in _report_status
    listener.new_cast_status(self.status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 389, in new_cast_status
    self._cast_device.new_cast_status(cast_status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 755, in new_cast_status
    self.schedule_update_ha_state()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 339, in schedule_update_ha_state
    self.hass.add_job(self.async_update_ha_state(force_refresh))
  File "/usr/src/app/homeassistant/core.py", line 255, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2019-07-19 23:45:00 DEBUG (Thread-16) [pychromecast.socket_client] [Home group ALL :42116] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 0, 'status': {'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.3636363744735718, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2019-07-19 23:45:00 DEBUG (Thread-16) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.3636363744735718, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='')
2019-07-19 23:45:00 ERROR (Thread-16) [pychromecast.controllers] Exception thrown when calling cast status listener
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pychromecast/socket_client.py", line 1048, in _report_status
    listener.new_cast_status(self.status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 389, in new_cast_status
    self._cast_device.new_cast_status(cast_status)
  File "/usr/src/app/homeassistant/components/cast/media_player.py", line 755, in new_cast_status
    self.schedule_update_ha_state()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 339, in schedule_update_ha_state
    self.hass.add_job(self.async_update_ha_state(force_refresh))
  File "/usr/src/app/homeassistant/core.py", line 255, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "uvloop/loop.pyx", line 1261, in uvloop.loop.Loop.call_soon_threadsafe
  File "uvloop/loop.pyx", line 604, in uvloop.loop.Loop._call_soon
  File "uvloop/loop.pyx", line 608, in uvloop.loop.Loop._call_soon_handle
  File "uvloop/loop.pyx", line 637, in uvloop.loop.Loop._check_closed
RuntimeError: Event loop is closed
2019-07-19 23:45:28 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:45:28 DEBUG (Thread-4) [nest.nest] <<< keep-alive event
2019-07-19 23:45:58 DEBUG (Thread-4) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-07-19 23:45:58 DEBUG (Thread-4) [nest.nest] <<< keep-alive event

``
bieniu commented 5 years ago

I had this issue yesterday twice. HA stopped answering completely and had to be restarted.

RPi3/Raspbian Stretch/Python3.7.2/venv/HA 0.96

stale[bot] commented 5 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

H3llK33p3r commented 4 years ago

Same for me twice this week HA wa offline.... with same kind of errors and due to docker and small logs size I can't have the origin of the errors :

RuntimeError: Event loop is closed
2020-04-23 21:37:02 ERROR (Dummy-3) [openzwave] Error in manager callback
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/openzwave/network.py", line 952, in zwcallback
    self._handle_value_changed(args)
  File "/usr/local/lib/python3.7/site-packages/openzwave/network.py", line 1504, in _handle_value_changed
    'value' : self.nodes[args['nodeId']].values[args['valueId']['id']]})
  File "/usr/local/lib/python3.7/site-packages/pydispatch/dispatcher.py", line 338, in send
    **named
  File "/usr/local/lib/python3.7/site-packages/pydispatch/robustapply.py", line 55, in robustApply
    return receiver(*arguments, **named)
  File "/usr/src/homeassistant/homeassistant/components/zwave/node_entity.py", line 201, in network_node_changed
    self.node_changed()
  File "/usr/src/homeassistant/homeassistant/components/zwave/node_entity.py", line 243, in node_changed
    self.maybe_schedule_update()
  File "/usr/src/homeassistant/homeassistant/components/zwave/node_entity.py", line 79, in maybe_schedule_update
    self.hass.add_job(self._schedule_update)
  File "/usr/src/homeassistant/homeassistant/core.py", line 285, in add_job
    self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 736, in call_soon_threadsafe
    self._check_closed()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 479, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

RPi2 / HASS.io 0.108.5

So welcome back Domoticz :(, I was testing HA and two availability issues in some days is not a good sign.