[Deluge] #3478: Magnets without metadata not restored from state.

4 views
Skip to first unread message

Deluge

unread,
Jul 20, 2021, 1:57:08 PM7/20/21
to delug...@googlegroups.com
#3478: Magnets without metadata not restored from state.
----------------------------+---------------------
Reporter: mhertz | Type: bug
Status: new | Priority: minor
Milestone: needs verified | Component: Unknown
Version: 2.0.0 | Keywords:
----------------------------+---------------------
As title, magnets without metadata aren't restored from state upon
restart, when using libtorrent 1.2.11 and above, because of change in
resume-saving logic of libtorrent i.e. resume-data saved for magnets even
without metadata now, which breaks restoring them upon restart in deluge.

I personally fixed it by this:
{{{
diff -urN a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
--- a/deluge/core/torrentmanager.py 2021-04-21 12:44:14.000000000
+0200
+++ b/deluge/core/torrentmanager.py 2021-07-20 19:38:41.819231547
+0200
@@ -1029,6 +1029,7 @@
tid
for tid, t in self.torrents.items()
if t.handle.need_save_resume_data()
+ if t.has_metadata
)

def on_torrent_resume_save(dummy_result, torrent_id):
}}}
Easy quick way to reproduce, is to add a magnet with non-existing info-
hash and restart deluge, and as said, need to use libtorrent 1.2.11 or
above. (e.g.
"magnet:?xt=urn:btih:85bbba4035cca750f681284857f53e405eb41f8d"
)

Tested on deluge-2.0.4.dev56 and libtorrent-1.2.14 on arch-linux.

Thanks in advance.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3478>
Deluge <https://deluge-torrent.org/>
Deluge Project

Deluge

unread,
Aug 3, 2021, 5:45:03 PM8/3/21
to delug...@googlegroups.com
#3478: Magnets without metadata not restored from state.
----------------------+----------------------------
Reporter: mhertz | Owner:

Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Unknown | Version: 2.0.0
Resolution: | Keywords:
----------------------+----------------------------

Comment (by Reiver):

Testing this to see if resolves the corresponding forum topic
[https://forum.deluge-torrent.org/viewtopic.php?f=7&t=55918 Deluge not
remembering some torrents that were added (any torrents with 0 Bytes)]
this patch prevents adding any new magnets as an URL (with current git
dev67). Not tested adding with normal torrent file.

(I often add magnets in paused state as bookmark to be downloaded later
but deluge is forgetting them on restart.)

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3478#comment:1>

Deluge

unread,
Aug 4, 2021, 7:13:50 AM8/4/21
to delug...@googlegroups.com
#3478: Magnets without metadata not restored from state.
----------------------+----------------------------
Reporter: mhertz | Owner:

Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Unknown | Version: 2.0.0
Resolution: | Keywords:
----------------------+----------------------------

Comment (by mhertz):

Yes, my patch fixes the issue of said forum topic, and I just retested it
now also on latest dev67 and I cannot reproduce your issue of not being
able to add magnets following, and my code added simply just blocks
torrents without metadata from being saved into fastresume file, as is
otherwise now done on libtorrent 1.2.11+ and causing this issue, so cannot
see neither how should block anything.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3478#comment:2>

Deluge

unread,
Aug 4, 2021, 9:26:51 AM8/4/21
to delug...@googlegroups.com
#3478: Magnets without metadata not restored from state.
----------------------+----------------------------
Reporter: mhertz | Owner:

Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Unknown | Version: 2.0.0
Resolution: | Keywords:
----------------------+----------------------------

Comment (by Reiver):

Hmm, I'd did multiple tests adding a magnet as url, ticking "Add in paused
state" and then adding but it then disappearing (or rather never
appearing). I didn't test adding normal torrent files or magnet url not in
a paused state (IIRC).

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3478#comment:3>

Deluge

unread,
Aug 4, 2021, 10:11:45 AM8/4/21
to delug...@googlegroups.com
#3478: Magnets without metadata not restored from state.
----------------------+----------------------------
Reporter: mhertz | Owner:

Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Unknown | Version: 2.0.0
Resolution: | Keywords:
----------------------+----------------------------

Comment (by mhertz):

I also did multiple tests, and just did again with having the "add in
paused state" option ticket, as didn't before, and same result. I have
tested magnets and torrents, but mostly magnets, as that's main issue
here, as not sure if torrents even is possible to be without
metadata(atleast normally is with metadata - I haven't looked at the
"metadata from peers" extension spec much and very long ago, and just
guessed it was only for magnets).

I tested with a clean profile.

Make sure to have restarted after applying fix.

I know of other issue unrelated to this, where when starting deluge then
your torrents/magnets are in the session but hidden for some reason(but
can be seen loaded into session from the left side 'States' menu, where
under 'All' list a number other than zero), and comes up again after a
restart usually or if fiddling with the UI littlebit, but not sure if ever
seen that issue happen after adding torrent/magnet and not restarting, but
if that, then is seperate issue than this, where the magnets aren't hidden
in session but actually simply not restored upon restart, so gone(so
neither shown under 'States' to the left under 'All').

Sorry if not working for you, and I cannot understand why, since I neither
can reproduce, nor see how that code-addition should be able to do such,
so honestly I think is unrelated to that, and would suggest running with
debug logging and check if any clues off why happens.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3478#comment:4>

Deluge

unread,
Aug 4, 2021, 2:21:36 PM8/4/21
to delug...@googlegroups.com
#3478: Magnets without metadata not restored from state.
---------------------+----------------------------
Reporter: mhertz | Owner:

Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Core | Version: develop
Resolution: | Keywords:
---------------------+----------------------------
Changes (by mhertz):

* version: 2.0.0 => develop
* component: Unknown => Core


--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3478#comment:5>

Deluge

unread,
Aug 23, 2021, 3:15:11 AM8/23/21
to delug...@googlegroups.com
#3478: Magnets without metadata not restored from state.
---------------------+----------------------------
Reporter: mhertz | Owner:

Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Core | Version: develop
Resolution: | Keywords:
---------------------+----------------------------

Comment (by Cas):

Thanks for reporting and looking into this, it definitely an lt bug that
Deluge will need to workaround:

https://github.com/arvidn/libtorrent/issues/6420

https://github.com/arvidn/libtorrent/issues/6421

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3478#comment:6>

Deluge

unread,
Aug 29, 2021, 11:00:34 AM8/29/21
to delug...@googlegroups.com
#3478: Magnets without metadata not restored from state.
---------------------+---------------------
Reporter: mhertz | Owner:
Type: bug | Status: closed
Priority: minor | Milestone: 2.0.4
Component: Core | Version: develop
Resolution: Fixed | Keywords:
---------------------+---------------------
Changes (by Cas):

* status: new => closed
* resolution: => Fixed
* milestone: needs verified => 2.0.4


Comment:

Fixed in develop [4b6c7d01b2]

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3478#comment:7>

Reply all
Reply to author
Forward
0 new messages