Deluge not remembering some torrents that were added (any torrents with 0 Bytes)

General support for problems installing or using Deluge
New User
New User
Posts: 2
Joined: Fri Apr 02, 2021 12:47 am

Deluge not remembering some torrents that were added (any torrents with 0 Bytes)

Postby mind » Fri Apr 02, 2021 2:25 am

When I start Deluge, I notice that some torrents are lost from the previous session.
Taking screenshots to compare, it looks like torrents that were added and showed
on list but the size column shows at 0 Bytes at time of shutdown were removed
from next startup (no longer showing). As soon as they eventually show their actual
file size (may take minutes or indefinitely), they won't be lost.

Is this to be expected? I add all my torrents via magnet links instead of
.torrent files because all my torrents tend to have magnet links but only some
have .torrent files. As a result, it's problematic for me because torrents that
were 0 Bytes when Deluge quits will be lost unless I manually save and keep
track of magnet links that were added to Deluge. Would a .torrent file ensure
torrents will never be lost since Deluge could always reference it? Could a .torrent
file be generated from a magnet link if the torrent site does not provide one?

Since the size column shows 0 Bytes as opposed to the actual size of the files
to be loaded by the torrent, I assume that means Deluge hasn't even downloaded
the metadata for the torrents which might be needed to reference on next startup
in order to continue the download. Shouldn't this happen as soon as I add the
magnet link? Is the only way to avoid this to make sure Deluge shows the actual
size of the files and save the magnet links to a text file for any that shows as
0 Bytes so I can add them the next time I start up Deluge?

Is it possible to retrieve a list of all torrents (e.g. magnet links) from the
list of the current session and/or prior session in order to back this up to
prevent the possibility of losing torrents that were added in my situation? I'm
looking at ~/.config/state/ but it doesn't seem clear for finding magnet links
or torrent names. EDIT: Actually, it looks like torrents.state does show it but it's a
binary file. How can I extract all magnet links and torrent name nicely?

Any suggestions or alternatives to my workflow is much appreciated. I'm on Arch
Linux on the latest version of deluge (2.0.4).

EDIT: Just tried AutoAdd and it does not solve this problem. I added a text file with
a magnet link, then it gets automatically added to the torrent list. While it shows 0 B,
I close Deluge and start it back up to see if the torrent is "lost". It is, and the
example.magnet in the watch folder renames to example.magnet.invalid (as opposed
to example.magnet.added, due to this
However, the alarming thing is that if I add a example2.magnet with the same magnet
link inside, it will rename to example2.magnet.invalid but not add the torrent.
If I restart Deluge again, then it will add the torrent if I rename example2.magnet.invalid
to example2.magnet. So this implies torrents that were added to Deluge but has a size
of 0 Bytes when Deluge is closed resulting in them being lost on next restart can still somehow
be referenced by Deluge on the restart despite not being in the torrent list. Only on another
restart will the reference be cleared and the user allow to re-add the torrent for it to
show up. Adding a torrent that shows 0 B and then removing it in the same session does
not have the same problem--I can re-add the torrent in that same session successfully,
so the problem is specific to torrents that shows as 0 B before Deluge is shutdown.

Compulsive Poster
Compulsive Poster
Posts: 1069
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge not remembering some torrents that were added (any torrents with 0 Bytes)

Postby mhertz » Fri Apr 02, 2021 6:48 pm

Sorry, I have nothing usefull to add really, but just wanted to state that I also noticed this issue some years ago, and reported it also, but nothing came to it,

I'm thinking as you, that if the metadata isn't even downloaded, then no *.torrent file added to said state folder, which then isn't loaded upon restart. Normally metadata is downloaded in matter of seconds, but if rarer content, then could be a shortage of peers to get it from at the time.

Also, as you state it is logged into torrents.state binary file, so I guess should be importable anyway, even without metadata(torrent) yet retrieved, so seems a deluge bug and not general libtorrent issue/short-coming. Also why I state that, is because I quickly tested something, and found that the full URI is listed in torrents.state, as you said before, but isn't listed in the fastresume file, just name of it and stuff logged there. If I then after closing deluge, deletes the fastresume and bak of it, so only the torrents.state(and it's bak, but not important) is there, well there can be other torrents there but my point is just no fastresume or it's bak file , then it works and is retained upon next restart, but however not really a good workaround e.g. to script this, as would miss fastresume data each statup. Btw, a good test-case, which I also added to my original bug-ticket I remember, is this ipmagnet website, which never downloads metadata either and just relies on a fallback tracker in the magnet URI and always will report 0% progress:

There are small scripts and apps that can download metadata for you, which could be scripted, and or some even can start retrieved torrent with default torrent client afterwards e.g. LordAro's fork of magnet2torrent from danfolkes, but in the cases where deluge doesn't get any metadata, then that script/app would also just be halting anyway, like deluge, as e.g. LordAro's fork, like original from danfolkes uses libtorrent-rasterbar anyways, and e.g. other often used aria2c app is in my experience much slower and less aggressive at retrieving metadata than libtorrent-rasterbar frontends, which beats everyone else by a mile imho(lead-dev Arvid profiled this functionality alot to make it optimal, he stated when I asked him about it on his mailing-list some years ago), hence why I don't use my otherwise favorite client rtorrent-ps(often 40 secs vs 3 for popular torrents, which annoying when only using magnets).

I will try look some more into this and the code, e.g. looked into save_state() already, but now seems to be failing in loading part and not saving, from above testing, but i'm not good at this at all, so 99.9% chance of this going nowhere for me, but then i'll remake propper ticket again, as I don't remember but is possible I made last ticket under consoleUI heading, as always use that, and i'd guess that has lower priority, but just a guess of-course.

Indeed anoying issue and thanks for making us aware of this, and reminding me :)

New User
New User
Posts: 2
Joined: Fri Apr 02, 2021 12:47 am

Re: Deluge not remembering some torrents that were added (any torrents with 0 Bytes)

Postby mind » Fri Apr 02, 2021 8:22 pm

Good to know this a not a problem unique to my experience and appreciate the bug submission.

Return to “Support”

Who is online

Users browsing this forum: No registered users and 13 guests