radsonpatrick / qbittorrent_custom_component

Custom component for use in Homeasssistant
6 stars 3 forks source link

not work after a reboot #3

Open SiriosDev opened 10 months ago

SiriosDev commented 10 months ago

after a system reboot the integration gives this error (hassos latest, core latest, qbittorrent addon latest)

Logger: urllib3.connectionpool
Source: custom_components/custom_qbittorrent/sensor.py:60
Integration: custom_qbittorrent (documentation)
First occurred: 19:57:52 (6 occurrences)
Last logged: 19:57:52

Retrying (Retry(total=0, connect=0, read=1, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f0fbafa3490>: Failed to establish a new connection: [Errno 111] Connection refused')': /
Retrying (Retry(total=0, connect=0, read=1, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0fbafadb90>: Failed to establish a new connection: [Errno 111] Connection refused')': /api/v2/auth/login
Retrying (Retry(total=0, connect=0, read=1, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0fbafbae90>: Failed to establish a new connection: [Errno 111] Connection refused')': /
Retrying (Retry(total=0, connect=0, read=1, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f0fbccb4d90>: Failed to establish a new connection: [Errno 111] Connection refused')': /
Retrying (Retry(total=0, connect=0, read=1, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0fbafe2cd0>: Failed to establish a new connection: [Errno 111] Connection refused')': /api/v2/auth/login
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:359
Integration: Sensore (documentation, issues)
First occurred: 19:57:52 (1 occurrences)
Last logged: 19:57:52

Error while setting up custom_qbittorrent platform for sensor
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3/util/connection.py", line 95, in create_connection
    raise err
  File "/usr/local/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 714, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 415, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 244, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.11/http/client.py", line 1286, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.11/http/client.py", line 1332, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.11/http/client.py", line 1281, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.11/http/client.py", line 1041, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.11/http/client.py", line 979, in send
    self.connect()
  File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0fbafee790>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 826, in urlopen
    return self.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 798, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=8081): Max retries exceeded with url: /api/v2/auth/login (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0fbafee790>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/qbittorrentapi/request.py", line 466, in _request_manager
    return self._request(
           ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/qbittorrentapi/request.py", line 532, in _request
    response = self._session.request(
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/qbittorrentapi/request.py", line 679, in request
    return super(QbittorrentSession, self).request(method, url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8081): Max retries exceeded with url: /api/v2/auth/login (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0fbafee790>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/custom_qbittorrent/sensor.py", line 60, in setup_platform
    client.auth_log_in()
  File "/usr/local/lib/python3.11/site-packages/qbittorrentapi/auth.py", line 100, in auth_log_in
    auth_response = self._post(
                    ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/qbittorrentapi/request.py", line 390, in _post
    return self._request_manager(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/qbittorrentapi/request.py", line 490, in _request_manager
    raise APIConnectionError(error_message, response=response)
qbittorrentapi.exceptions.APIConnectionError: Failed to connect to qBittorrent. Connection Error: ConnectionError(MaxRetryError("HTTPConnectionPool(host='127.0.0.1', port=8081): Max retries exceeded with url: /api/v2/auth/login (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0fbafee790>: Failed to establish a new connection: [Errno 111] Connection refused'))"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/custom_qbittorrent/sensor.py", line 61, in setup_platform
    except LoginFailed() as e:
TypeError: catching classes that do not inherit from BaseException is not allowed
radsonpatrick commented 5 months ago

hello... do you problem is solved ? sorry for freezing i'm back to develop the componet!

SiriosDev commented 5 months ago

Sorry but after a while I've switched to custom template sensors by myself, this weekend, I'll try