snicker / zwift_hass

Zwift Sensor Integration for HomeAssistant
53 stars 13 forks source link

v3.1 killing HA after restart #11

Closed badguy99 closed 4 years ago

badguy99 commented 4 years ago

After a restart of HA, I have a lot of tracebacks coming out and can't get to the front end, until I comment out the zwift config and restart again.

Zwift config:

# Zwift
sensor zwift:
  - platform: zwift
    username: !secret zwift_username
    password: !secret zwift_password
    players:
      - !secret zwift_rachel_id

Logs:

2020-05-17 19:17:18 ERROR (MainThread) [homeassistant.setup] Error during setup of component water_heater
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 "/usr/local/lib/python3.7/asyncio/base_events.py", line 574, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 541, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1786, in _run_once
    handle._run()
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/config/custom_components/zwift/sensor.py", line 126, in async_setup_platform
    await update_data(None)
  File "/config/custom_components/zwift/sensor.py", line 114, in update_data
    await hass.async_add_executor_job(zwift_data.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/zwift/sensor.py", line 338, in update
    player_state = world.player_status(player_id)
  File "/usr/local/lib/python3.7/site-packages/zwift/world.py", line 25, in player_status
    '/relay/worlds/{}/players/{}'.format(self.world_id, player_id))
  File "/usr/local/lib/python3.7/site-packages/zwift/request.py", line 45, in protobuf
    resp.status_code, resp.reason))
zwift.error.RequestException: 404 - Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 171, in _async_setup_component
    hass, processed_config
  File "/usr/src/homeassistant/homeassistant/components/water_heater/__init__.py", line 98, in async_setup
    await component.async_setup(config)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 131, in async_setup
    await asyncio.gather(*tasks)
concurrent.futures._base.CancelledError
2020-05-17 19:17:18 ERROR (MainThread) [homeassistant.setup] Error during setup of component climate
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 "/usr/local/lib/python3.7/asyncio/base_events.py", line 574, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 541, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1786, in _run_once
    handle._run()
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/config/custom_components/zwift/sensor.py", line 126, in async_setup_platform
    await update_data(None)
  File "/config/custom_components/zwift/sensor.py", line 114, in update_data
    await hass.async_add_executor_job(zwift_data.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/zwift/sensor.py", line 338, in update
    player_state = world.player_status(player_id)
  File "/usr/local/lib/python3.7/site-packages/zwift/world.py", line 25, in player_status
    '/relay/worlds/{}/players/{}'.format(self.world_id, player_id))
  File "/usr/local/lib/python3.7/site-packages/zwift/request.py", line 45, in protobuf
    resp.status_code, resp.reason))
zwift.error.RequestException: 404 - Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 171, in _async_setup_component
    hass, processed_config
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 108, in async_setup
    await component.async_setup(config)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 131, in async_setup
    await asyncio.gather(*tasks)
concurrent.futures._base.CancelledError
2020-05-17 19:17:18 ERROR (MainThread) [homeassistant.setup] Error during setup of component media_player
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 "/usr/local/lib/python3.7/asyncio/base_events.py", line 574, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 541, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1786, in _run_once
    handle._run()
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/config/custom_components/zwift/sensor.py", line 126, in async_setup_platform
    await update_data(None)
  File "/config/custom_components/zwift/sensor.py", line 114, in update_data
    await hass.async_add_executor_job(zwift_data.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/zwift/sensor.py", line 338, in update
    player_state = world.player_status(player_id)
  File "/usr/local/lib/python3.7/site-packages/zwift/world.py", line 25, in player_status
    '/relay/worlds/{}/players/{}'.format(self.world_id, player_id))
  File "/usr/local/lib/python3.7/site-packages/zwift/request.py", line 45, in protobuf
    resp.status_code, resp.reason))
zwift.error.RequestException: 404 - Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 171, in _async_setup_component
    hass, processed_config
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 208, in async_setup
    await component.async_setup(config)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 131, in async_setup
    await asyncio.gather(*tasks)
concurrent.futures._base.CancelledError
badguy99 commented 4 years ago

Not sure what happened, but this seems to be working fine now. So closing this.

snicker commented 4 years ago

I've been seeing issues like this lately myself, running an early dev version of 0.110. In my case, it seems to be some kind of other custom components with missing/bad translations, and the logging calls inside the exception handling block calling upon these for the format string... ? I haven't dug into it too deeply yet, but I was going to try switching to the dev release of 0.110 today and see if they still take place