core icon indicating copy to clipboard operation
core copied to clipboard

Deluge fails to set up

Open rccoleman opened this issue 2 years ago • 3 comments

The problem

Starting with HA 2024.2b0, the Deluge integration fails to set up.

What version of Home Assistant Core has the issue?

core-2024.2.0b0

What was the last working version of Home Assistant Core?

core-2024.1.6

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Deluge

Link to integration documentation on our website

https://www.home-assistant.io/integrations/deluge/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-01-31 19:48:51.599 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Deluge for deluge
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 442, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/deluge/__init__.py", line 37, in async_setup_entry
    api = await hass.async_add_executor_job(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/deluge_client/client.py", line 65, in __init__
    self._create_socket()
  File "/usr/local/lib/python3.12/site-packages/deluge_client/client.py", line 71, in _create_socket
    self._socket = ssl.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
                   ^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'

Additional information

This repeats whenever I reload the integration or restart HA. I removed the integration and tried to set it up again, also failing with this:

024-01-31 19:55:03.971 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 91, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 72, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 185, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 358, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 404, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 501, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/deluge/config_flow.py", line 42, in async_step_user
    if (error := await self.validate_input(user_input)) is None:
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/deluge/config_flow.py", line 89, in validate_input
    api = DelugeRPCClient(
          ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/deluge_client/client.py", line 65, in __init__
    self._create_socket()
  File "/usr/local/lib/python3.12/site-packages/deluge_client/client.py", line 71, in _create_socket
    self._socket = ssl.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
                   ^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'

rccoleman avatar Feb 01 '24 03:02 rccoleman

Hey there @tkdrob, mind taking a look at this issue as it has been labeled with an integration (deluge) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of deluge can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign deluge Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


deluge documentation deluge source (message by IssueLinks)

home-assistant[bot] avatar Feb 01 '24 03:02 home-assistant[bot]

This needs to be fixed in the upstream package.

https://github.com/JohnDoee/deluge-client/pull/45 has been open since October. This might warrant a fork if not merged soon.

tkdrob avatar Feb 01 '24 17:02 tkdrob

This needs to be fixed in the upstream package.

JohnDoee/deluge-client#45 has been open since October. This might warrant a fork if not merged soon.

Yep, that works for me.

Zamunda4Eva avatar Feb 07 '24 23:02 Zamunda4Eva

This needs to be fixed in the upstream package.

JohnDoee/deluge-client#45 has been open since October. This might warrant a fork if not merged soon.

Last update on that repo was 4 years ago so i would think a fork is in order. Contributors of the repo are active but ignoring the PR. Theres also another PR from 2020 that has not been merged.

Subcode avatar Feb 13 '24 18:02 Subcode