Deluge Python Error

Any reason why I would get the following errors when running “deluged” ?

I’ve uninstalled and reinstalled deluge and get the same out come running deluged.

root@DietPi:~# deluged
root@DietPi:~# [ERROR   ] 16:32:15 component:118 [Failure instance: Traceback: <type 'exceptions.RuntimeError'>: Address family not supported by protocol
/usr/lib/python2.7/dist-packages/deluge/main.py:230:start_daemon
/usr/lib/python2.7/dist-packages/deluge/core/daemon.py:161:__init__
/usr/lib/python2.7/dist-packages/deluge/component.py:296:start
/usr/lib/python2.7/dist-packages/deluge/component.py:124:_component_start
--- <exception caught here> ---
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:139:maybeDeferred
/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py:160:start
/usr/lib/python2.7/dist-packages/deluge/config.py:312:register_set_function
/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py:254:_on_set_listen_ports
]
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/deluge/main.py", line 230, in start_daemon
    Daemon(options, args)
  File "/usr/lib/python2.7/dist-packages/deluge/core/daemon.py", line 161, in __init__
    component.start("PreferencesManager")
  File "/usr/lib/python2.7/dist-packages/deluge/component.py", line 296, in start
    deferreds.append(self.components[name]._component_start())
  File "/usr/lib/python2.7/dist-packages/deluge/component.py", line 124, in _component_start
    d = maybeDeferred(self.start)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 139, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py", line 160, in start
    self._on_set_listen_ports)
  File "/usr/lib/python2.7/dist-packages/deluge/config.py", line 312, in register_set_function
    function(key, self.__config[key])
  File "/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py", line 254, in _on_set_listen_ports
    self.session.listen_on(value[0], value[1], str(self.config["listen_interface"]).strip())
exceptions.RuntimeError: Address family not supported by protocol
[ERROR   ] 16:32:15 component:118 [Failure instance: Traceback: <type 'exceptions.RuntimeError'>: Address family not supported by protocol
/usr/lib/python2.7/dist-packages/deluge/main.py:230:start_daemon
/usr/lib/python2.7/dist-packages/deluge/core/daemon.py:169:__init__
/usr/lib/python2.7/dist-packages/deluge/component.py:296:start
/usr/lib/python2.7/dist-packages/deluge/component.py:124:_component_start
--- <exception caught here> ---
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:139:maybeDeferred
/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py:160:start
/usr/lib/python2.7/dist-packages/deluge/config.py:312:register_set_function
/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py:254:_on_set_listen_ports

I’ll need to check your system settings. Please can you send a bug report:

dietpi-bugreport

No need to fill out the text document, I just need your Reference CODE:.

Thanks for taking a look at it!

Reference CODE: b827eba506ac-0

Got the bug report thanks.

I replicated your installation for testing. I was unable to obtain the errors you received.

[ERROR   ] 16:32:15 component:118 [Failure instance: Traceback: <type 'exceptions.RuntimeError'>: Address family not supported by protocol

This sounds like an network / IPv6 issue of some kind.

When you run deluged and deluge-web, regardless of the errors are you able to access the web interface?

Have you tried doing a fresh install of the DietPi image and only installing deluge?

Failing that, I can only recommend you contact deluge’s support/forum for assistance. Maybe they can assist with debugging the python sourcecode.

I’m not sure whats causing this error then. I posted the same question in Deluge forums Deluge Python Error RPI2 - Deluge Forum

The ports are valid integers and listen_interface is an empty string. I cannot replicate the error myself. However I suspect it is due to IPv6 being disabled on RPi Raspbian. I don’t ever recall seeing this issue from users running 0.16.

So as you suspected it looks like something to do with IPv6. They also said this issue was fixed with Libtorrent 1.07 which apparently is a long process to install and is not part of the standard apt-get packages. Wondering why it’s not… but the issue is fixed with Libtorrent 1.07.

What I don’t understand is what is causing this problem. I’m curious if OpenVpn is causing the issue but as you said you replicated my installation so I’m not sure?

The only things I have installed is Deluge, OpenVPN & VNC after a fresh install. I guess I could try a fresh install less the openvpn install to see if I still get this issue.

So I did a fresh install and only installed VNC and Deluge…

This was the first thing I did after a reboot and I get the same error. So I’m stumped as to why this happens.

root@DietPi:~# pkill deluged
root@DietPi:~# deluged
root@DietPi:~# [ERROR   ] 14:56:17 component:118 [Failure instance: Traceback: <type 'exceptions.RuntimeError'>: Address family not supported by protocol
/usr/lib/python2.7/dist-packages/deluge/main.py:230:start_daemon
/usr/lib/python2.7/dist-packages/deluge/core/daemon.py:161:__init__
/usr/lib/python2.7/dist-packages/deluge/component.py:296:start
/usr/lib/python2.7/dist-packages/deluge/component.py:124:_component_start
--- <exception caught here> ---
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:139:maybeDeferred
/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py:160:start
/usr/lib/python2.7/dist-packages/deluge/config.py:312:register_set_function
/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py:254:_on_set_listen_ports
]
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/deluge/main.py", line 230, in start_daemon
    Daemon(options, args)
  File "/usr/lib/python2.7/dist-packages/deluge/core/daemon.py", line 161, in __init__
    component.start("PreferencesManager")
  File "/usr/lib/python2.7/dist-packages/deluge/component.py", line 296, in start
    deferreds.append(self.components[name]._component_start())
  File "/usr/lib/python2.7/dist-packages/deluge/component.py", line 124, in _component_start
    d = maybeDeferred(self.start)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 139, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py", line 160, in start
    self._on_set_listen_ports)
  File "/usr/lib/python2.7/dist-packages/deluge/config.py", line 312, in register_set_function
    function(key, self.__config[key])
  File "/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py", line 254, in _on_set_listen_ports
    self.session.listen_on(value[0], value[1], str(self.config["listen_interface"]).strip())
exceptions.RuntimeError: Address family not supported by protocol
[ERROR   ] 14:56:17 component:118 [Failure instance: Traceback: <type 'exceptions.RuntimeError'>: Address family not supported by protocol
/usr/lib/python2.7/dist-packages/deluge/main.py:230:start_daemon
/usr/lib/python2.7/dist-packages/deluge/core/daemon.py:169:__init__
/usr/lib/python2.7/dist-packages/deluge/component.py:296:start
/usr/lib/python2.7/dist-packages/deluge/component.py:124:_component_start
--- <exception caught here> ---
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:139:maybeDeferred
/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py:160:start
/usr/lib/python2.7/dist-packages/deluge/config.py:312:register_set_function
/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py:254:_on_set_listen_ports
]

Yep its strange. Works fine my end.

If it is a network / ipv6 issue as you mentioned, try setting a static IP for your device in dietpi-config.

Also, for testing purposes, try disabling IPv6 on your network router.
If that fails, try enabling IPv6: Add IPv6 support · Issue #72 · MichaIng/DietPi · GitHub. I dont have a IPv6 capable network, so i’am unable to test my end.

Its gonna be one of those “trial and error” scenarios, at least until Libtorrent 1.07 is available in the repo or compiled :slight_smile: