mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
Magnet links downloads won't start (since version 3.3.0) #3842
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#3842
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Lore21 on GitHub (Jan 26, 2016).
Since version 3.3.0, every time I add a new torrent download through a magnet link, it doesn't go past "Retrieving metadata..." in the preview window, and once added it remains stuck at 0 bytes (with 0 seeds and 0 peers, or sometimes 0 seeds and 1 peer) indefinitely, with status "Downloading...".
Adding the exact same torrent downloading and double-clicking the .torrent file instead of using the magnet link works without flaws.
@sledgehammer999 commented on GitHub (Jan 27, 2016):
A screenshot of the whole window would be helpful (cover the torrent names).
@sledgehammer999 commented on GitHub (Jan 27, 2016):
And copy the log too. (View->Log)
@Lore21 commented on GitHub (Jan 27, 2016):
Here are the screenshots: the same torrent added through its magnet link and its .torrent file.
MAGNET LINK
Preview (never completes the metadata retrieval):

Download (stays so indefinitely):

Log:

.TORRENT FILE
Preview:

Download:

Log:

Thanks for the support! :)
@sledgehammer999 commented on GitHub (Jan 27, 2016):
Your log shows an error. I think it tells you that the port you chosen cannot be used. Choose another one(not 8999). And I suspect that's why you don't connect to any DHT nodes (look at the bottom of the window).
Also be sure that the port you choose is forwarded from your router otherwise other peers cannot reach you(that's why you have yellow icon).
@Lore21 commented on GitHub (Jan 27, 2016):
The error says it can't use the same socket address (protocol/address/port) twice, and as a matter of fact the "listening" log lines seem to be duplicated... :-?
Apart from that, the same error shows up even when using the .torrent file, yet in that case the download starts (and completes) without problems; moreover, magnet links stopped working alltogheter as soon as I updated qBittorent from version 3.2.x to version 3.3.x, mantaining the same configuration.
Changing the port randomly doesn't solve the problem anyway (same error with the new port).
@sledgehammer999 commented on GitHub (Jan 27, 2016):
Can you go to advanced settigns and choose your specific network interface instead of "any interface"? (might need to restart qbt) After that copy again the log (by selecting and right clicking copy)
@Lore21 commented on GitHub (Jan 27, 2016):
After selecting the specific network interface in advanced settings, the error still shows up (qBT still seems to try to listen on the same UDP port twice), but magnet links now work again! :-)
Here is the log:
@sledgehammer999 commented on GitHub (Jan 27, 2016):
@arvidn for some reason libtorrent sometimes tries to listen to UDP/port twice and it fails. Or the initial "success" alert may be false. I have never experienced it but this user (and others in the past) have. Any idea on whats wrong here?
@arvidn commented on GitHub (Jan 27, 2016):
the idea is that when it fails, the DHT stays inactive/broken because it doesn't have a socket?
this is 1.0.8?
@sledgehammer999 commented on GitHub (Jan 27, 2016):
I suppose so. The screenshots show zero DHT nodes.
Yes.
@pete6055 commented on GitHub (Jan 28, 2016):
Here's the thing, Sledge.....this wasn't an issue in version 3.25. And, yes, it's the same issue I reported earlier but withdrew. And.... several other folks seem have reported the same problem under other titles.
I think it might have to do with router port forwarding, but I can't search the forum, though someone else mentioned there were instructions there.
Checking Random Ports at start seems to help, but sometimes I still run into a conflict. It's almost like the assigned port is not closed or cleared at the end of the qbit session. Maybe you could compare 3.25 to 3.3.3 to see what's different, but that seems like finding a needle in a haystack.
@arvidn commented on GitHub (Jan 28, 2016):
if binding to a specific interface helps, it sounds like there might be two interfaces that end up having the same IP address assigned to them. That would be my first guess at least. libtorrent (by default) tries to bind to all interfaces by enumerating them, and then passing their IP to bind(). If two interfaces return the same IP, I would imagine the second socket would fail.
@Lore21 commented on GitHub (Jan 28, 2016):
In my case the binding error was still there even after selecting a specific interface instead of "All interfaces".
@arvidn commented on GitHub (Jan 29, 2016):
@sledgehammer999 I don't use SO_REUSEADDR on windows, because apparently it allows two live sockets to bind to the same port (as opposed to binding to a TIMED_WAIT port).
However, if the udp socket fails to bind, it's supposed to try again assuming you set a port range. Do you do that or just always specify a single port? It turns out the udp socket doesn't fall back to attempting to bind to port 0 (i.e. let the system pick one) since it's supposed to be bound to the same port as the TCP listen port. When announcing to a tracker you can only specify one port, not one for TCP and one for uTP.
@arvidn commented on GitHub (Jan 29, 2016):
Could someone give this patch a try? https://github.com/arvidn/libtorrent/pull/440
@sledgehammer999 commented on GitHub (Jan 29, 2016):
We pass specific local ip address to libtorrent unless "any interface" is configured by user where we let the system decide (eg 0.0.0.0 + :: )
We specify always one port.
When using
session::listen_on()we also use thesession::listen_no_system_portflag. But we also configure the network via the session constructor too, where we can't pass that flag.I'll provide a build now.
@arvidn commented on GitHub (Jan 29, 2016):
@sledgehammer999 I think my patch can build now
@sledgehammer999 commented on GitHub (Jan 29, 2016):
@Lore21 can you try this build: http://builds.shiki.hu/temp/qbittorrent_3.3.3_for_issue_4693.7z
Just overwrite the old files.
@Lore21 commented on GitHub (Jan 29, 2016):
Tried it, I still get the same error:
@arvidn commented on GitHub (Jan 29, 2016):
@Lore21 other than the error message in the log. do you experience the same symptom of not having a UDP socket / working DHT? (obviously under your original settings)
@Lore21 commented on GitHub (Jan 29, 2016):
Yes, I do: DHT stuck at 0 nodes/yellow icon.
And the magnet links are not starting again: it seems the one that worked a couple of days ago was only a lucky chance...
@arvidn commented on GitHub (Jan 30, 2016):
@sledgehammer999 I added one more commit attempting to address the udp bind error. When creating the sockets and binding them, I close the existing ones first. It turned out I had forgotten to close the UDP socket (or at least it appears so). with the listen_on() interface, it's easy for a client to kick the open-sockets logic twice. It's possible that qBT does, and sometimes the second time fails because the first one wasn't closed properly.
anyway, it's a bit of a long shot. If you wouldn't mind rebuilding, I'd be curious to know if this solves Lore21's problem.
@sledgehammer999 commented on GitHub (Jan 30, 2016):
@Lore21 can you try this: http://builds.shiki.hu/temp/qbittorrent_3.3.3_for_issue_4693_v2.7z
@arvidn we don't call listen_on() if the interface/port hasn't changed since session construction.
@Lore21 commented on GitHub (Jan 30, 2016):
Different error(s) this time: "The I/O operation has been aborted because of either a thread exit or an application request" (translated to english)
@arvidn commented on GitHub (Jan 30, 2016):
and does the problem of the DHT not working persist?
@Lore21 commented on GitHub (Jan 30, 2016):
Yes, 0 nodes/yellow icon
@sledgehammer999 commented on GitHub (Jan 30, 2016):
@arvidn now I get the same errors with RC_1_1 plus some new ones(and of course 0 dht nodes). Check this log:
I don't think I ever pass "null" or "127.0.0.1" as interface.
@arvidn commented on GitHub (Jan 31, 2016):
is this on windows?
@arvidn commented on GitHub (Jan 31, 2016):
unfortunately the setting up of listening sockets is a bit of a mess. I have an outstanding patch against master (which is still pretty far from complete) to clean it up and simplify it. I don't think it's realistic to solve the underlying problem for 1.0.9, I was hoping that I could solve it without too much surgery.
I'll take a look what can be done in RC_1_1
@arvidn commented on GitHub (Jan 31, 2016):
here's one more attempt in RC_1_0 https://github.com/arvidn/libtorrent/pull/444
@sledgehammer999 commented on GitHub (Jan 31, 2016):
Yes, windows. And I am preparing a new build for testing based on your new patch.
@sledgehammer999 commented on GitHub (Jan 31, 2016):
@Lore21 can you try this: http://builds.shiki.hu/temp/qbittorrent_3.3.3_for_issue_4693_v3.7z
@Lore21 commented on GitHub (Jan 31, 2016):
Back to the original error:
@arvidn commented on GitHub (Jan 31, 2016):
ok. there appears to be some event triggered that attempts to re-bind the UDP socket. I'll take a look what possibly could be doing that.
@sledgehammer999 would you mind creating a ticket against libtorrent for the RC_1_1 behavior you're seeing? please include that log and also what you pass in to listen_on() or the listen_interfaces setting.
@arvidn commented on GitHub (Feb 2, 2016):
@sledgehammer999 do you think there's any way I could reproduce, or attempt to reproduce, this error with client_test.cpp? could you describe how you interact with the session, specifically around how you tell it which IP and port to listen on?
@sledgehammer999 commented on GitHub (Feb 2, 2016):
I can't reproduce it myself with RC_1_0. Only with RC_1_1(I'll open a bug report shortly). I have made a very simple test program for @Lore21 to test. It just starts a libtorrent session and watches for the listen succeded/failed alerts. Nothing else. Build against latest RC_1_0.
@Lore21 can you try the following program: http://builds.shiki.hu/temp/test_interface_listen.7z
Open a console window and navigate to it. Noob instructions:
cmdand hit OK.cd <path-to-the-folder-that-contains-the-extracted-exe>test_interface_listen. It should output something in the console.Ctrl+CAnd for completeness sake here is the source code for
test_interface_listen:@arvidn commented on GitHub (Feb 2, 2016):
@sledgehammer999 maybe you could enable verbose logging in that build too
@Lore21 commented on GitHub (Feb 2, 2016):
Below is the output of the test program:
@sledgehammer999 commented on GitHub (Feb 2, 2016):
Can you do the same with the following build? Try running multiple times, you should get a "Listen failed blah blah" message in one of those times. It is a race condition somewhere and it doesn't always fail.
See my description here: https://github.com/arvidn/libtorrent/issues/450
Build: http://builds.shiki.hu/temp/test_interface_listen_v2.7z
@Lore21 commented on GitHub (Feb 2, 2016):
It executed 22 times in a row without errors (all "Listen succeeded on interface..."), then on the 23rd execution I got:
@sledgehammer999 commented on GitHub (Feb 2, 2016):
Nice. @arvidn that build applies session setting with
ssl_listenset to zero.@arvidn commented on GitHub (Feb 3, 2016):
I opened a ticket for the UDP socket bind issue. https://github.com/arvidn/libtorrent/issues/454
and sledgehammer999 opened a separate issue for the failure he discovered in RC_1_1 https://github.com/arvidn/libtorrent/issues/450
@arvidn commented on GitHub (Feb 7, 2016):
FYI. I have un-deprecated the endpoint field in listen_failed_alert. I realized it does make sense to keep it around, after having spent some more time on working on the direction I want to go to simplify and unify the socket listen logic in master.
@thalieht commented on GitHub (Sep 20, 2018):
Old issue, possibly fixed by now. Make a new one if it persists.