deluged unresponsive? deluge-console gets stuck

General support for problems installing or using Deluge
Post Reply
Nemo_bis
New User
New User
Posts: 5
Joined: Thu Feb 16, 2017 8:48 am

deluged unresponsive? deluge-console gets stuck

Post by Nemo_bis »

Sometimes I give a deluge-console command and it gets stuck but never times out, so I just wait forever. This is annoying because my shell loops of commands get stuck every few hundreds commands, so a ctrl-C is needed to abort the failed command and continue. Sometimes I get a descriptive error:

Code: Select all

$ deluge-console "info -s Seeding" | grep -c ID
5000
$ deluge-console "info -s Seeding" | grep -c ID
^CUnhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/protocols/policies.py", line 167, in clientConnectionLost
    self.wrappedFactory.clientConnectionLost(connector, reason)
  File "/usr/lib/python2.7/dist-packages/deluge/ui/client.py", line 230, in clientConnectionLost
    self.daemon.disconnect_deferred.callback(reason.value)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 382, in callback
    self._startRunCallbacks(result)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 490, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 577, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/quit.py", line 46, in on_disconnect
    reactor.stop()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 580, in stop
    "Can't stop reactor that isn't running.")
twisted.internet.error.ReactorNotRunning: Can't stop reactor that isn't running.
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr

$ deluge-console "info -s Seeding" | grep -c ID
5009
From within the deluge-console interface, the same can happen too. Usually the command just gives no output at all, but sometimes I get an error like:

Code: Select all

>>> info 5b31ae2a0326d14d8d0237631187725204c07d1a                                                                                              
Name: avwiktionary-20161220-pages-meta-current.xml.bz2                                                                                         ID: 5b31ae2a0326d14d8d0237631187725204c07d1a
Error getting torrent info: [Failure instance: Traceback: <type 'exceptions.KeyError'>: 'Checking Resume Data'                                 /usr/lib/python2.7/dist-packages/twisted/protocols/policies.py:120:dataReceived
/usr/lib/python2.7/dist-packages/deluge/ui/client.py:179:dataReceived                                                                          /usr/lib/python2.7/dist-packages/twisted/internet/defer.py:382:callback
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:490:_startRunCallbacks                                                              --- <exception caught here> ---
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:577:_runCallbacks                                                                   /usr/lib/python2.7/dist-packages/deluge/ui/console/commands/info.py:154:on_torrents_status
/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/info.py:190:show_info                                                              ]
It would be nice of deluge-console to handle such failures, for instance with a timeout after which it retries or just aborts whatever it's doing (the specific command, or the interface altogether).

This is on:
$ uname -a
Linux dumps-1 3.13.0-100-generic #147-Ubuntu SMP Tue Oct 18 16:48:51 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ deluge-console --version
deluge-console: 1.3.6
libtorrent: 0.16.13.0
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: deluged unresponsive? deluge-console gets stuck

Post by Cas »

The first thing you need to do is upgrade deluge
Nemo_bis
New User
New User
Posts: 5
Joined: Thu Feb 16, 2017 8:48 am

Re: deluged unresponsive? deluge-console gets stuck

Post by Nemo_bis »

Cas wrote:The first thing you need to do is upgrade deluge
Thanks for the reply. Since you asked nicely, I upgraded to 1.3.12 with pinning (I didn't originally make a bug report since I'm stuck on an older Ubuntu and upgrading is a pain). So far I don't see any difference; if I open deluge-console in one screen and issue some "lengthy" deluge-console commands in another, it's especially easy for them to get stuck.
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: deluged unresponsive? deluge-console gets stuck

Post by Cas »

If you get any new errors then post them. How many torrents do you have loaded? Do the other UIs become unresponsive?
Nemo_bis
New User
New User
Posts: 5
Joined: Thu Feb 16, 2017 8:48 am

Re: deluged unresponsive? deluge-console gets stuck

Post by Nemo_bis »

Thanks. Here's a new one (a single other "deluge-console add" command might have been running at the same time):

Code: Select all

$ deluge-console "info -v 64321954d652702a2c5463f95af53a39c944b90c"

Name: bclwiki-20161201-pages-articles-multistream.xml.bz2
ID: 64321954d652702a2c5463f95af53a39c944b90c
Error getting torrent info: [Failure instance: Traceback: <type 'exceptions.KeyError'>: 'Checking Resume Data'
/usr/lib/python2.7/dist-packages/twisted/protocols/policies.py:120:dataReceived
/usr/lib/python2.7/dist-packages/deluge/ui/client.py:179:dataReceived
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:382:callback
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:490:_startRunCallbacks
--- <exception caught here> ---
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:577:_runCallbacks
/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/info.py:154:on_torrents_status
/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/info.py:190:show_info
]
I've not tried other UIs: I could maybe try the web UI on another server, but not this. My setup is admittedly a bit extreme and I'm still tweaking my configuration: I have 9000 torrents as of now.

Code: Select all

$ deluge-console info | grep -c ID
8953
$ deluge-console "info -s Seeding" | grep -c ID
5024
$ lsof -c deluged | grep -c REG
37
$ lsof -c deluged | grep -c IPv
2245
$ lsof -c deluged | grep -c UDP
8
$ top | head
top - 19:08:05 up 108 days, 22:37,  1 user,  load average: 1.89, 2.20, 2.30
Tasks: 135 total,   3 running, 132 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2.4 us,  0.7 sy,  0.0 ni, 91.4 id,  5.3 wa,  0.0 hi,  0.2 si,  0.0 st
KiB Mem:   4048120 total,  3879356 used,   168764 free,    68668 buffers
KiB Swap:  1999868 total,        0 used,  1999868 free.  1594184 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
14497 nemobis   20   0 1389468 1.134g   8984 R 147.7 29.4 374:34.26 deluge
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: deluged unresponsive? deluge-console gets stuck

Post by Cas »

Ok so will that many torrents it is expected that the daemon can struggle. The version in develop should handle that amount.

I shall look at fixing that <type 'exceptions.KeyError'>: 'Checking Resume Data'
Update: I just realised you are not running 1.3.13 which may well fix this!
Post Reply