8000 Excessive traceback of errors updating hue lights: timeout and refused connections · Issue #8003 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Excessive traceback of errors updating hue lights: timeout and refused connections #8003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
azogue opened this issue Jun 12, 2017 · 1 comment · Fixed by #8524
Closed

Excessive traceback of errors updating hue lights: timeout and refused connections #8003

azogue opened this issue Jun 12, 2017 · 1 comment · Fixed by #8524

Comments

@azogue
Copy link
Member
azogue commented Jun 12, 2017

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version):
0.46.0

Python release (python3 --version):
3.5.2

Component/platform:
light.hue

Description of problem:
Logs are filled with traceback of errors about timeout or rejected connections when trying to update the state of some hue lights. In my case, this happen multiple times each day (but not always)

Expected:
Better error handling so logs are cleaner.

Problem-relevant configuration.yaml entries and steps to reproduce:

light:
  - platform: hue
    host: 192.168.1.X
    allow_unreachable: true
    homebridge_hidden: true
    scan_interval: 12

Traceback (if applicable):

2017-06-09 01:54:14 ERROR (Thread-6) [phue] GET Request to 192.168.1.X/api/XXXXXXXXXXXXXX timed out.
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/phue.py", line 651, in request
    connection.request(mode, address)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 1106, in request
    self._send_request(method, url, body, headers)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 1151, in _send_request
    self.endheaders(body)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 1102, in endheaders
    self._send_output(message_body)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 849, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/socket.py", line 711, in create_connection
    raise err
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/socket.py", line 702, in create_connection
    sock.connect(sa)
socket.timeout: timed out
2017-06-09 01:54:14 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.estudio fails
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/phue.py", line 651, in request
    connection.request(mode, address)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 1106, in request
    self._send_request(method, url, body, headers)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 1151, in _send_request
    self.endheaders(body)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 1102, in endheaders
    self._send_output(message_body)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 849, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/socket.py", line 711, in create_connection
    raise err
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/socket.py", line 702, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/homeassistant/.pyenv/versions/3.5.2/envs/hass35/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.hass.async_add_job(self.update)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.pyenv/versions/3.5.2/envs/hass35/lib/python3.5/site-packages/homeassistant/components/light/hue.py", line 455, in update
    self.update_lights(no_throttle=True)
  File "/home/homeassistant/.pyenv/versions/3.5.2/envs/hass35/lib/python3.5/site-packages/homeassistant/util/__init__.py", line 303, in wrapper
    result = method(*args, **kwargs)
  File "/home/homeassistant/.pyenv/versions/3.5.2/envs/hass35/lib/python3.5/site-packages/homeassistant/util/__init__.py", line 303, in wrapper
    result = method(*args, **kwargs)
  File "/home/homeassistant/.pyenv/versions/3.5.2/envs/hass35/lib/python3.5/site-packages/homeassistant/components/light/hue.py", line 182, in update_lights
    api = bridge.get_api()
  File "/home/homeassistant/.homeassistant/deps/phue.py", line 838, in get_api
    return self.request('GET', '/api/' + self.username)
  File "/home/homeassistant/.homeassistant/deps/phue.py", line 661, in request
    raise PhueRequestTimeout(None, error)
phue.PhueRequestTimeout: (None, 'GET Request to 192.168.1.X/api/XXXXXXXXXXXXXX timed out.')
2017-06-09 01:54:14 ERROR (Thread-8) [homeassistant.components.light.hue] Cannot reach the bridge
Traceback (most recent call last):
  File "/home/homeassistant/.pyenv/versions/3.5.2/envs/hass35/lib/python3.5/site-packages/homeassistant/components/light/hue.py", line 182, in update_lights
    api = bridge.get_api()
  File "/home/homeassistant/.homeassistant/deps/phue.py", line 838, in get_api
    return self.request('GET', '/api/' + self.username)
  File "/home/homeassistant/.homeassistant/deps/phue.py", line 651, in request
    connection.request(mode, address)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 1106, in request
    self._send_r
8000
equest(method, url, body, headers)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 1151, in _send_request
    self.endheaders(body)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 1102, in endheaders
    self._send_output(message_body)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/http/client.py", line 849, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/socket.py", line 711, in create_connection
    raise err
  File "/home/homeassistant/.pyenv/versions/3.5.2/lib/python3.5/socket.py", line 702, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Additional info:

I'm using a 2º gen Hue Bridge (the one compatible with Siri) with 9 hue bulbs. The ones that fail are 1 bulb located far away from the bridge, and a group of three bulbs that I use with hyperion to simulate a phillips ambilight around my tv running kodi. The lights in the group only fail when hyperion is running (and changing the lights very fast), so for these I think it is a problem of bridge overload. For the distant lamp, I think the bridge is not seeing it sometimes. Anyway, I thing the traceback should not appear in the log.

@azogue azogue changed the title Unhandled errors updating hue lights: timeout and refused connections Excessive traceback of errors updating hue lights: timeout and refused connections Jun 12, 2017
@eximo84
Copy link
eximo84 commented Jun 15, 2017

Can confirm i am getting the same problem. Happens with random lights and logs errors multiple times per day. I can still control the lights via the UI and automations work.

2017-06-14 21:34:25 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.boat_light fails
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/phue.py", line 651, in request
    connection.request(mode, address)
  File "/usr/lib/python3.4/http/client.py", line 1090, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.4/http/client.py", line 1128, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.4/http/client.py", line 1086, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.4/http/client.py", line 924, in _send_output
    self.send(msg)
  File "/usr/lib/python3.4/http/client.py", line 859, in send
    self.connect()
  File "/usr/lib/python3.4/http/client.py", line 836, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python3.4/socket.py", line 509, in create_connection
    raise err
  File "/usr/lib/python3.4/socket.py", line 500, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/light/hue.py", line 455, in update
    self.update_lights(no_throttle=True)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/util/__init__.py", line 303, in wrapper
    result = method(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/util/__init__.py", line 303, in wrapper
    result = method(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/light/hue.py", line 182, in update_lights
    api = bridge.get_api()
  File "/home/homeassistant/.homeassistant/deps/phue.py", line 838, in get_api
    return self.request('GET', '/api/' + self.username)
  File "/home/homeassistant/.homeassistant/deps/phue.py", line 661, in request
    raise PhueRequestTimeout(None, error)
phue.PhueRequestTimeout: (None, 'GET Request to 192.168.1.8/api/vGJJIrE-ADXHYwOtMu1xt9PkvoVXAE8dctsC6GNE timed out.')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0