The port reported to Tracker will be "0" even the proxy and anonymous mode are both turned off. #7138

Closed
opened 2026-02-21 18:48:06 -05:00 by deekerman · 19 comments
Owner

Originally created by @partment on GitHub (Apr 12, 2018).

qBittorrent version and Operating System

4.0.4 on Windows 10 x64

What is the problem

The port reported to Tracker will be "0" even the proxy and anonymous mode are both turned off.
This lead to qB will not work in Private Tracker.

What is the expected behavior

The port reported to Tracker should be incoming and outcoming port.

Steps to reproduce

Just contact to Tracker

Originally created by @partment on GitHub (Apr 12, 2018). ### qBittorrent version and Operating System 4.0.4 on Windows 10 x64 ### What is the problem The port reported to Tracker will be "0" even the proxy and anonymous mode are both turned off. This lead to qB will not work in Private Tracker. ### What is the expected behavior The port reported to Tracker should be incoming and outcoming port. ### Steps to reproduce Just contact to Tracker
Author
Owner

@partment commented on GitHub (Apr 12, 2018):

The Private Tracker will response "Invalid Port".
And get back to the backend of the Tracker it indicates that the port qB sent is "0"

@partment commented on GitHub (Apr 12, 2018): The Private Tracker will response "Invalid Port". And get back to the backend of the Tracker it indicates that the port qB sent is "0"
Author
Owner

@partment commented on GitHub (Apr 13, 2018):

Update : This problem will only happen with tracker using https as protocol.

@partment commented on GitHub (Apr 13, 2018): Update : This problem will only happen with tracker using https as protocol.
Author
Owner

@partment commented on GitHub (Apr 13, 2018):

trackerlog
Here's the tracker's logs.

@partment commented on GitHub (Apr 13, 2018): ![trackerlog](https://user-images.githubusercontent.com/5278061/38748631-57ece1f2-3f81-11e8-8aa8-178bb3be0422.png) Here's the tracker's logs.
Author
Owner

@Supralateral commented on GitHub (Apr 23, 2018):

It really would be more helpful if you can provide more information. I can't reproduce this, on the same version/OS as you

Was this a one-off? Does it happen to one tracker, or all? What are your settings for the client? Anything disrupting your network? Have you done anything to troubleshoot?

@Supralateral commented on GitHub (Apr 23, 2018): It really would be more helpful if you can provide more information. I can't reproduce this, on the same version/OS as you Was this a one-off? Does it happen to one tracker, or all? What are your settings for the client? Anything disrupting your network? Have you done anything to troubleshoot?
Author
Owner

@partment commented on GitHub (Apr 24, 2018):

This problem happens everytime on every tracker that used https as protocol and not the highest priority.
Here's my solution.
I let the Tracker accept http connection and adjust the priority of Tracker into highest like this.
qbittorrent_2018-04-25_00-09-51
If I adjust the priority of Tracker into second like this. It will be not working.
qbittorrent_2018-04-25_00-10-02
Notes:The private tracker will not allow port "0" as a peer. You only can reproduce this on the private tracker don't accept port "0".

@partment commented on GitHub (Apr 24, 2018): This problem happens everytime on every tracker that used https as protocol and not the highest priority. Here's my solution. I let the Tracker accept http connection and adjust the priority of Tracker into highest like this. ![qbittorrent_2018-04-25_00-09-51](https://user-images.githubusercontent.com/5278061/39199921-40a2cf1c-481d-11e8-9a54-82eea8eafb98.png) If I adjust the priority of Tracker into second like this. It will be not working. ![qbittorrent_2018-04-25_00-10-02](https://user-images.githubusercontent.com/5278061/39199970-5ddf5744-481d-11e8-88cc-6efa1f60dde4.png) Notes:The private tracker will not allow port "0" as a peer. You only can reproduce this on the private tracker don't accept port "0".
Author
Owner

@Supralateral commented on GitHub (Apr 24, 2018):

Okay, I can replicate this after adding another tracker. It seems to fail most of the time, but not always. Sometimes the start event will announce the correct port for the second tracker, but the stop event & any subsequent announce will be port=0.
It's not an issue with the HTTPS protocol: I'm seeing failures when both trackers are HTTP.

It looks like the port just isn't (generally) announced for anything other than the initial tracker.

Related: #8606 #5445 #5221
Are you using a SOCKS proxy? I am not, but I do have qBt set to use a specific network interface

Also, this is a private tracker that enables DHT/PEX/LSD and also lets you add new trackers to announce to? That's certainly an interesting take on the definition of private!

@Supralateral commented on GitHub (Apr 24, 2018): Okay, I can replicate this after adding another tracker. It seems to fail most of the time, but not always. Sometimes the start event will announce the correct port for the second tracker, but the stop event & any subsequent announce will be port=0. It's not an issue with the HTTPS protocol: I'm seeing failures when both trackers are HTTP. It looks like the port just isn't (generally) announced for anything other than the initial tracker. Related: #8606 #5445 #5221 Are you using a SOCKS proxy? I am not, but I do have qBt set to use a specific network interface Also, this is a private tracker that enables DHT/PEX/LSD and also lets you add new trackers to announce to? That's certainly an interesting take on the definition of private!
Author
Owner

@partment commented on GitHub (Apr 24, 2018):

I am not using any kind of proxy such as SOCKS4 or SOCKS5 and the network interface is set to "any interface".
This tracker is allow to use DHT/PEX/LSD because it is just used to collect upload data from certain member in the group.

@partment commented on GitHub (Apr 24, 2018): I am not using any kind of proxy such as SOCKS4 or SOCKS5 and the network interface is set to "any interface". This tracker is allow to use DHT/PEX/LSD because it is just used to collect upload data from certain member in the group.
Author
Owner

@KozakaiAya commented on GitHub (Apr 29, 2018):

Same issue here.

@KozakaiAya commented on GitHub (Apr 29, 2018): Same issue here.
Author
Owner

@colinhd8 commented on GitHub (Aug 15, 2018):

Same issue here
4.4.1 on ubuntu 18.04

@colinhd8 commented on GitHub (Aug 15, 2018): Same issue here 4.4.1 on ubuntu 18.04
Author
Owner

@DJATOM commented on GitHub (Sep 13, 2018):

It seems libtorrent 1.1 is the culprit. 1.0 works fine when 1.1 fails to works as intended. Tested on qBittorrent EE fork with libt 1.0 and it just works.

@DJATOM commented on GitHub (Sep 13, 2018): It seems libtorrent 1.1 is the culprit. 1.0 works fine when 1.1 fails to works as intended. Tested on qBittorrent EE fork with libt 1.0 and it just works.
Author
Owner

@KozakaiAya commented on GitHub (Sep 13, 2018):

libt 1.1 seems to have a lot of unintended behaviors (like tracker announce and disk IO issues). I do hope qBittorrent won't drop the support for 1.0 branch in further versions.

@KozakaiAya commented on GitHub (Sep 13, 2018): libt 1.1 seems to have a lot of unintended behaviors (like tracker announce and disk IO issues). I do hope qBittorrent won't drop the support for 1.0 branch in further versions.
Author
Owner

@Chocobo1 commented on GitHub (Sep 14, 2018):

libt 1.1 seems to have a lot of unintended behaviors (like tracker announce and disk IO issues).

It still occurs with qbt v4.1.2 right?

@Chocobo1 commented on GitHub (Sep 14, 2018): >libt 1.1 seems to have a lot of unintended behaviors (like tracker announce and disk IO issues). It still occurs with qbt v4.1.2 right?
Author
Owner

@KozakaiAya commented on GitHub (Sep 14, 2018):

libt 1.1 seems to have a lot of unintended behaviors (like tracker announce and disk IO issues).

It still occurs with qbt v4.1.2 right?

As far as I know, in dual-stack network environments, any qbt version compiled with libt 1.1 (and other BT clients baesd on libt, like Deluge) cannot announce both IPv4 and IPv6 address to the tracker. Writing the tracker's IPv4 address in the 'hosts' file on OS can help solve the problem but I don't think it's a permenant solution because the tracker's IP address may change.

For the IO issues, I actually haven't encountered this issue because I always run BT clients on HDD and it's not that fast. According some of my friends who use qbt on SSD, there still hashing speed problems even on libt 1.1.8. Related Issue: https://github.com/qbittorrent/qBittorrent/issues/9061

@KozakaiAya commented on GitHub (Sep 14, 2018): > > libt 1.1 seems to have a lot of unintended behaviors (like tracker announce and disk IO issues). > > It still occurs with qbt v4.1.2 right? As far as I know, in dual-stack network environments, any qbt version compiled with libt 1.1 (and other BT clients baesd on libt, like Deluge) cannot announce both IPv4 and IPv6 address to the tracker. Writing the tracker's IPv4 address in the 'hosts' file on OS can help solve the problem but I don't think it's a permenant solution because the tracker's IP address may change. For the IO issues, I actually haven't encountered this issue because I always run BT clients on HDD and it's not that fast. According some of my friends who use qbt on SSD, there still hashing speed problems even on libt 1.1.8. Related Issue: https://github.com/qbittorrent/qBittorrent/issues/9061
Author
Owner

@Chocobo1 commented on GitHub (Sep 14, 2018):

@KozakaiAya
I see, however the announce issue you described seems to be not related to the opening post.
I'm concerned about the issue from OP, if the problems still occurs, we should ping @arvidn for it.
For the IO performance, we should see some improvements in the next release (v4.1.3), feel free to file an issue if it is still a problem.

@Chocobo1 commented on GitHub (Sep 14, 2018): @KozakaiAya I see, however the announce issue you described seems to be not related to the opening post. I'm concerned about the issue from OP, if the problems still occurs, we should ping @arvidn for it. For the IO performance, we should see some improvements in the next release (v4.1.3), feel free to file an issue if it is still a problem.
Author
Owner

@cbgilbert commented on GitHub (Oct 16, 2018):

Same issue here, using the official 4.1.3 release, windows 10.
I tried https and http tracker, and enabled/disabled socks5 proxy. The 4 results are the same.

@cbgilbert commented on GitHub (Oct 16, 2018): Same issue here, using the official 4.1.3 release, windows 10. I tried https and http tracker, and enabled/disabled socks5 proxy. The 4 results are the same.
Author
Owner

@Supralateral commented on GitHub (Oct 20, 2018):

Not to be confused with enabling the "Disable connections not supported by proxies" option, which intentionally announces the port as 0.

@Supralateral commented on GitHub (Oct 20, 2018): Not to be confused with enabling the "Disable connections not supported by proxies" option, which intentionally announces the port as 0.
Author
Owner

@partment commented on GitHub (Nov 7, 2018):

I've done some researchs on libtorrent's source code.
It seems like the problem is come up with the if statement to decide what port will be sent.
In the "src/http_tracker_connection.cpp" has the following code.
i2p ? 1 : tracker_req().listen_port at line 124.
If you disable the anonymous mode, this statement will request the port you assigned from tracker_req().listen_port
So I'm wondering whether this request has some bugs?

Hopefully someone can get some further investigations.

@partment commented on GitHub (Nov 7, 2018): I've done some researchs on libtorrent's source code. It seems like the problem is come up with the if statement to decide what port will be sent. In the "[src/http_tracker_connection.cpp](https://github.com/arvidn/libtorrent/blob/master/src/http_tracker_connection.cpp)" has the following code. `i2p ? 1 : tracker_req().listen_port` at line 124. If you disable the anonymous mode, this statement will request the port you assigned from `tracker_req().listen_port` So I'm wondering whether this request has some bugs? Hopefully someone can get some further investigations.
Author
Owner

@partment commented on GitHub (Nov 20, 2018):

This problem has been solved by this PR.
https://github.com/arvidn/libtorrent/pull/3452

@partment commented on GitHub (Nov 20, 2018): This problem has been solved by this PR. https://github.com/arvidn/libtorrent/pull/3452
Author
Owner

@colinhd8 commented on GitHub (Nov 20, 2018):

Good news. Thanks.

@colinhd8 commented on GitHub (Nov 20, 2018): Good news. Thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#7138
No description provided.