linuxserver / docker-flexget

GNU General Public License v3.0
4 stars 2 forks source link

[BUG] deluge and from_deluge: Unhandled error in plugin from_deluge: module 'ssl' has no attribute 'wrap_socket' #12

Closed atajsic closed 3 months ago

atajsic commented 3 months ago

Is there an existing issue for this?

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 commented 3 months ago

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

https://github.com/linuxserver/docker-flexget/commit/624a2767ecbf681be2b15b0f90fdaa1ee899fd3b#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

github-actions[bot] commented 3 months ago

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

thespad commented 3 months ago

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 commented 3 months ago

Unfortunately I don't think there is any rush. I opened a duplicate issue on the flexget repository about a month ago: https://github.com/Flexget/Flexget/issues/4012

For now, I'm using the latest working image.

On Sat, 27 Jul 2024 at 20:24, Adam @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/linuxserver/docker-flexget/issues/12#issuecomment-2254105827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAELJCIWBUYQHUWSTIBMDVTZONYPLAVCNFSM6AAAAABLRYBRGKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGEYDKOBSG4 . You are receiving this because you authored the thread.Message ID: @.***>

kylhill commented 3 months ago

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