Skip to content
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

[bug fix] Handle stacktrace when rtorrent host is unreachable #24541

Merged
merged 1 commit into from
Jun 15, 2019
Merged

[bug fix] Handle stacktrace when rtorrent host is unreachable #24541

merged 1 commit into from
Jun 15, 2019

Conversation

mafrosis
Copy link
Contributor

@mafrosis mafrosis commented Jun 15, 2019

Description:

Bug fix a stacktrace from the rtorrent sensor.

My log is full of these when my NAS (which runs rtorrent) is down:

2019-06-15 00:03:17 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.rtorrent_up_speed fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/rtorrent/sensor.py", line 100, in update
    self.data = multicall()
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 882, in __call__
    return MultiCallIterator(self.__server.system.multicall(marshalled_list))
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
    return self.__send(self.__name, args)
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1452, in __request
    verbose=self.__verbose
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1154, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1166, in single_request
    http_conn = self.send_request(host, handler, request_body, verbose)
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1279, in send_request
    self.send_content(connection, request_body)
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1309, in send_content
    connection.endheaders(request_body)
  File "/usr/local/lib/python3.7/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1016, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 956, in send
    self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 928, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 727, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
OSError: [Errno 113] Host is unreachable

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]

@homeassistant
Copy link
Contributor

Hi @mafrosis,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@homeassistant homeassistant added small-pr PRs with less than 30 lines. cla-needed cla-signed and removed cla-needed labels Jun 15, 2019
@mafrosis
Copy link
Contributor Author

For the record, I hate E501 😄

@balloob balloob merged commit 6b3c740 into home-assistant:dev Jun 15, 2019
@balloob
Copy link
Member

balloob commented Jun 15, 2019

Awesome! 🐬

@balloob balloob mentioned this pull request Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants