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] deluge and from_deluge: Unhandled error in plugin from_deluge: module 'ssl' has no attribute 'wrap_socket' #12

Closed
1 task done
atajsic opened this issue Jul 27, 2024 · 5 comments · Fixed by #13

Comments

@atajsic
Copy link

atajsic commented Jul 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

On deluge and from_deluge, the following error occurs:
Unhandled error in plugin from_deluge: module 'ssl' has no attribute 'wrap_socket'

Expected Behavior

Successful connection to deluge

Steps To Reproduce

Step 1: install latest image
Step 2: try and connect to deluge via the deluge or from_deluge plugin
Step 3: critical crash

Environment

OS: docker

CPU architecture

x86-64

Docker creation

flexget:
    image: lscr.io/linuxserver/flexget
    container_name: flexget
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Australia/Sydney
      - FG_LOG_LEVEL=info
      - FG_LOG_FILE=/config/flexget.log
      - FG_CONFIG_FILE=/config/.flexget/config.yml
    volumes:
      - ./flexget:/config
      - /media/downloads:/media/downloads
    networks:
      - proxy

Container logs

2024-06-25 14:06:57 CRITICAL task          my-task BUG: Unhandled error in plugin from_deluge: module 'ssl' has no attribute 'wrap_socket'
Traceback (most recent call last):

  File "/usr/lib/python3.12/threading.py", line 1030, in _bootstrap
    self._bootstrap_inner()
    │    └ <function Thread._bootstrap_inner at 0x7f10600cad40><Thread(task_queue, started daemon 139708153867064)>
  File "/usr/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
    │    └ <function Thread.run at 0x7f10600caa20><Thread(task_queue, started daemon 139708153867064)>
  File "/usr/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
    │    │        │    │        │    └ {}
    │    │        │    │        └ <Thread(task_queue, started daemon 139708153867064)>
    │    │        │     ()
    │    │        └ <Thread(task_queue, started daemon 139708153867064)>
    │    └ <bound method TaskQueue.run of <flexget.task_queue.TaskQueue object at 0x7f1057ded3d0>><Thread(task_queue, started daemon 139708153867064)>
  File "/lsiopy/lib/python3.12/site-packages/flexget/task_queue.py", line 46, in run
    self.current_task.execute()
    │    │            └ <function Task.execute at 0x7f105c2cbba0>
    │    └ <flexget.task.Task object at 0x7f10574d5370><flexget.task_queue.TaskQueue object at 0x7f1057ded3d0>
  File "/lsiopy/lib/python3.12/site-packages/flexget/task.py", line 87, in wrapper
    return func(self, *args, **kw)
           │    │      │       └ {}
           │    │       ()
           │    └ <flexget.task.Task object at 0x7f10574d5370><function Task.execute at 0x7f105c2cbb00>
  File "/lsiopy/lib/python3.12/site-packages/flexget/task.py", line 716, in execute
    self._execute()
    │    └ <function Task._execute at 0x7f105c2cba60><flexget.task.Task object at 0x7f10574d5370>
  File "/lsiopy/lib/python3.12/site-packages/flexget/task.py", line 685, in _execute
    self.__run_task_phase(phase)
    │                     └ 'start'<flexget.task.Task object at 0x7f10574d5370>
  File "/lsiopy/lib/python3.12/site-packages/flexget/task.py", line 514, in __run_task_phase
    response = self.__run_plugin(plugin, phase, args)
               │                 │       │      └ (<flexget.task.Task object at 0x7f10574d5370>, {'host': '<<redacted>>', 'username': ''<<redacted>>', 'password': ''<<redacted>>', 'filter':...
               │                 │       └ 'start'
               │                 └ <PluginInfo(name=from_deluge)>
               └ <flexget.task.Task object at 0x7f10574d5370>
> File "/lsiopy/lib/python3.12/site-packages/flexget/task.py", line 547, in __run_plugin
    result = method(*args, **kwargs)
             │       │       └ {}
             │       └ (<flexget.task.Task object at 0x7f10574d5370>, {'host': ''<<redacted>>', 'username': ''<<redacted>>', 'password': ''<<redacted>>', 'filter':...
             └ <Event(name=plugin.from_deluge.start,func=on_task_start,priority=128)>
  File "/lsiopy/lib/python3.12/site-packages/flexget/event.py", line 21, in __call__
    return self.func(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ (<flexget.task.Task object at 0x7f10574d5370>, {'host': ''<<redacted>>', 'username': ''<<redacted>>', 'password': ''<<redacted>>', 'filter':...
           │    └ <bound method InputDeluge.on_task_start of <flexget.plugins.clients.deluge.InputDeluge object at 0x7f10579bd910>>
           └ <Event(name=plugin.from_deluge.start,func=on_task_start,priority=128)>
  File "/lsiopy/lib/python3.12/site-packages/flexget/plugins/clients/deluge.py", line 138, in on_task_start
    super().on_task_start(task, config)
                          │     └ {'host': ''<<redacted>>', 'username': ''<<redacted>>', 'password': ''<<redacted>>', 'filter': {'label': 'flexget'}, 'port': 58846}
                          └ <flexget.task.Task object at 0x7f10574d5370>
  File "/lsiopy/lib/python3.12/site-packages/flexget/plugins/clients/deluge.py", line 25, in on_task_start
    self.setup_client(config)
    │    │            └ {'host': ''<<redacted>>', 'username': ''<<redacted>>', 'password': ''<<redacted>>', 'filter': {'label': 'flexget'}, 'port': 58846}
    │    └ <function DelugePlugin.setup_client at 0x7f1059c40d60>
    └ <flexget.plugins.clients.deluge.InputDeluge object at 0x7f10579bd910>
  File "/lsiopy/lib/python3.12/site-packages/flexget/plugins/clients/deluge.py", line 51, in setup_client
    return DelugeRPCClient(
           └ <class 'deluge_client.client.DelugeRPCClient'>
  File "/lsiopy/lib/python3.12/site-packages/deluge_client/client.py", line 71, in __init__
    self._create_socket()
    │    └ <function DelugeRPCClient._create_socket at 0x7f1057556480>
    └ <deluge_client.client.DelugeRPCClient object at 0x7f10574d5280>
  File "/lsiopy/lib/python3.12/site-packages/deluge_client/client.py", line 77, in _create_socket
    self._socket = ssl.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
    │              │               │      │      │      │        │      └ <SocketKind.SOCK_STREAM: 1>
    │              │               │      │      │      │        └ <module 'socket' from '/usr/lib/python3.12/socket.py'>
    │              │               │      │      │      └ <AddressFamily.AF_INET: 2>
    │              │               │      │      └ <module 'socket' from '/usr/lib/python3.12/socket.py'>
    │              │               │      └ <class 'socket.socket'>
    │              │               └ <module 'socket' from '/usr/lib/python3.12/socket.py'>
    │              └ <module 'ssl' from '/usr/lib/python3.12/ssl.py'>
    └ <deluge_client.client.DelugeRPCClient object at 0x7f10574d5280>

AttributeError: module 'ssl' has no attribute 'wrap_socket'
@atajsic
Copy link
Author

atajsic commented Jul 27, 2024

I'm speculating,
However it could be the change in python verison

624a276#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R65

the last working linuxserver/flexget is 3.11.37 which uses python 3.11

and the official docker image is still using python 3.11
https://github.com/Flexget/Flexget/blob/develop/Dockerfile#L1

Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@thespad
Copy link
Member

thespad commented Jul 27, 2024

How very annoying, I tested a bunch of modules against 3.12 but not deluge. I'd like to try and avoid a rollback but if there are multiple affected plugins and/or they're not in any rush to fix them we may need to.

@atajsic
Copy link
Author

atajsic commented Jul 28, 2024 via email

@kylhill
Copy link

kylhill commented Aug 15, 2024

I have the same issue with the deluge plugin while using 3.12.

@thespad thespad mentioned this issue Aug 17, 2024
1 task
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants