Exceptions thrown when trying to delete a torrent

General support for problems installing or using Deluge
Post Reply
Blodo
New User
New User
Posts: 1
Joined: Mon Mar 09, 2020 8:11 pm

Exceptions thrown when trying to delete a torrent

Post by Blodo »

Hey guys. I think I found a bug with the version of deluge that's currently available in the Arch repos (deluge 2.0.4.dev23+g2f1c008a2-3). I'm running in client-server mode on my ghetto seedbox rpi and noticed after updating that trying to delete some torrents completely crashes the server and I have to restart it afterwards. The problem then is that the server is left in a state where the torrent is half deleted (still lingers in session.state) and the only way to get rid of it completely is to clear your session.state file because trying to delete it just crashes the server again. I had a pretty long list of seeded torrents that I "lost" because of this (I kept a backup of the hashed cache torrents but adding 200 of them in one go freezes the server with no progress bar, so not sure if that's going to work out), and it happened on three different torrents for me. For reference here is the stack trace that pops up:

Code: Select all

Mar 09 20:16:03 Daedalus deluged[840]: Unhandled Error
Mar 09 20:16:03 Daedalus deluged[840]: Traceback (most recent call last):
Mar 09 20:16:03 Daedalus deluged[840]:   File "/usr/lib/python3.8/site-packages/deluge/core/daemon_entry.py", line 122, in run_daemon
Mar 09 20:16:03 Daedalus deluged[840]:     daemon.start()
Mar 09 20:16:03 Daedalus deluged[840]:   File "/usr/lib/python3.8/site-packages/deluge/core/daemon.py", line 164, in start
Mar 09 20:16:03 Daedalus deluged[840]:     reactor.run()
Mar 09 20:16:03 Daedalus deluged[840]:   File "/usr/lib/python3.8/site-packages/twisted/internet/base.py", line 1283, in run
Mar 09 20:16:03 Daedalus deluged[840]:     self.mainLoop()
Mar 09 20:16:03 Daedalus deluged[840]:   File "/usr/lib/python3.8/site-packages/twisted/internet/base.py", line 1292, in mainLoop
Mar 09 20:16:03 Daedalus deluged[840]:     self.runUntilCurrent()
Mar 09 20:16:03 Daedalus deluged[840]: --- <exception caught here> ---
Mar 09 20:16:03 Daedalus deluged[840]:   File "/usr/lib/python3.8/site-packages/twisted/internet/base.py", line 913, in runUntilCurrent
Mar 09 20:16:03 Daedalus deluged[840]:     call.func(*call.args, **call.kw)
Mar 09 20:16:03 Daedalus deluged[840]:   File "/usr/lib/python3.8/site-packages/deluge/core/torrentmanager.py", line 1599, in on_alert>
Mar 09 20:16:03 Daedalus deluged[840]:     self.handle_torrents_status_callback(self.torrents_status_requests.pop())
Mar 09 20:16:03 Daedalus deluged[840]:   File "/usr/lib/python3.8/site-packages/deluge/core/torrentmanager.py", line 1668, in handle_t>
Mar 09 20:16:03 Daedalus deluged[840]:     status_dict[torrent_id] = self.torrents[torrent_id].get_status(
Mar 09 20:16:03 Daedalus deluged[840]:   File "/usr/lib/python3.8/site-packages/deluge/core/torrent.py", line 1007, in get_status
Mar 09 20:16:03 Daedalus deluged[840]:     status_dict[key] = self.status_funcs[key]()
Mar 09 20:16:03 Daedalus deluged[840]:   File "/usr/lib/python3.8/site-packages/deluge/core/torrent.py", line 942, in get_name
Mar 09 20:16:03 Daedalus deluged[840]:     name = decode_bytes(self.handle.name())
Mar 09 20:16:03 Daedalus deluged[840]: builtins.RuntimeError: invalid torrent handle used
This has happened when I tried it on magnet links specifically (not checked .torrent files) and it happens whenever the torrent name has spaces in it. My first intuition after checking source was that it could be weird hidden UTF characters, but as it turned out after some testing no it was spaces. Unfortunately I can't really edit the session.state directly to find out whether removing the spaces will fix it, but basically trying to delete torrents with spaces in the name of the torrent currently results in an unrecoverable server crash.

Cheers for still working on this software, its the only one available that is both easy to use and has all the features I need out of a torrent client.
Post Reply