Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxies and UDP issues (no DHT/magnet/metadata/UDP trackers) #11735

Closed
sledgehammer999 opened this issue Dec 22, 2019 · 218 comments
Closed

Proxies and UDP issues (no DHT/magnet/metadata/UDP trackers) #11735

sledgehammer999 opened this issue Dec 22, 2019 · 218 comments
Labels
Network Issues related to network connectivity Proxy/VPN Issues related to the use of proxy/VPN

Comments

@sledgehammer999
Copy link
Member

sledgehammer999 commented Dec 22, 2019

This is to gather all relevant bug reports about proxies and UDP connection issues(no DHT, no magnet/metadata working, no UDP trackers working etc)

These came into being after the 4.2.0 release which uses libtorrent 1.2.0. Libtorrent 1.2.x doesn't have the force_proxy setting that libtorrent 1.1.x did. This option, when false, allowed direct connections to DHT/metadata/μTP peers/UDP trackers when the proxy didn't support UDP connections.
In libtorrent 1.2.x this was deemed non-sensical and if the proxy doesn't support UDP connections then all the above will not work. No direct connection will be attempted.

Anonymous mode doesn't play a role in this.

There is a slight chance that libtorrent code doesn't correctly detect UDP support by the proxy. So the purpose of the thread is to help debug and forward details to the libtorrent author.

For the time being the libtorrent author has provided a PR(arvidn/libtorrent#4202) which logs socks5 related errors. I will provide a test builds shortly.

@sledgehammer999 sledgehammer999 added the Proxy/VPN Issues related to the use of proxy/VPN label Dec 22, 2019
@xavier2k6
Copy link
Member

Should this be pinned?

@sledgehammer999
Copy link
Member Author

This is the test build mentioned above based on arvidn/libtorrent#4202 and on 4.2.1 with below patch applied.
Please report the errors you get in the log. Don't forget to enclose them in "code" tags. For this click the relevant button from the toolbar present above the comment input box which has a tooltip "Insert code". The loglines will be posted suitable for easy reading.

Link: http://builds.shiki.hu/temp/qbittorrent_4.2.1_x64_patched_for_issue_11735.7z
(run from any folder or overwrite official files)

diff:

diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp
index a4cf15107..b86e83219 100644
--- a/src/base/bittorrent/session.cpp
+++ b/src/base/bittorrent/session.cpp
@@ -4211,6 +4211,9 @@ void Session::handleAlert(const lt::alert *a)
         case lt::external_ip_alert::alert_type:
             handleExternalIPAlert(static_cast<const lt::external_ip_alert*>(a));
             break;
+        case lt::socks5_alert::alert_type:
+            handleSocks5Alert(static_cast<const lt::socks5_alert*>(a));
+            break;
 #if (LIBTORRENT_VERSION_NUM >= 10200)
         case lt::alerts_dropped_alert::alert_type:
             handleAlertsDroppedAlert(static_cast<const lt::alerts_dropped_alert *>(a));
@@ -4623,6 +4626,11 @@ void Session::handleListenFailedAlert(const lt::listen_failed_alert *p)
 #endif
 }
 
+void Session::handleSocks5Alert(const lt::socks5_alert *p)
+{
+    LogMsg(tr("Socks5 error: %1").arg(QString::fromLocal8Bit(p->message().c_str())), Log::CRITICAL);
+}
+
 void Session::handleExternalIPAlert(const lt::external_ip_alert *p)
 {
     lt::error_code ec;
diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h
index 4591f4477..859b9abad 100644
--- a/src/base/bittorrent/session.h
+++ b/src/base/bittorrent/session.h
@@ -576,6 +576,7 @@ namespace BitTorrent
         void handleListenFailedAlert(const lt::listen_failed_alert *p);
         void handleExternalIPAlert(const lt::external_ip_alert *p);
         void handleSessionStatsAlert(const lt::session_stats_alert *p);
+        void handleSocks5Alert(const lt::socks5_alert *p);
 #if (LIBTORRENT_VERSION_NUM >= 10200)
         void handleAlertsDroppedAlert(const lt::alerts_dropped_alert *p) const;
 #endif

@sledgehammer999
Copy link
Member Author

sledgehammer999 commented Dec 23, 2019

Should this be pinned?

No.

@sledgehammer999 sledgehammer999 changed the title Proxies and UDP connection issues Proxies and UDP issues (no DHT/magnet/metadata/UDP trackers) Dec 23, 2019
@calvilasboasjr
Copy link

Can i post this here?

When I used QBittorrent Version 3.3.16 + Socks5 proxy + Nordvpn = Show on EXECUTION LOG TAB:
External IP: x.x.x.x
where "x.x.x.x" is the vpn proxy, of course,
and all connections IS MADE

When I used QBittorrent Version 4.2.0 + Socks5 proxy + Nordvpn = Show on EXECUTION LOG TAB:
External IP: 0.0.0.0
and NO connections is made.
NO DOWNLOAD, NOTHING.

The same settings was made for both version 3.3.16 and 4.2.0.

@sledgehammer999
Copy link
Member Author

@calvilasboasjr did you even read my 2 previous comments?

@ExceptionGit
Copy link

Please report the errors you get in the log.
Link: http://builds.shiki.hu/temp/qbittorrent_4.2.1_x64_patched_for_issue_11735.7z

Log (no error "Socks5 error: %1", wait 30min):

qBittorrent v4.2.1 started
Using config directory: ...
Trying to listen on: 192.168.0.2:8999
Peer ID: -qB4210-
HTTP User-Agent is 'qBittorrent/4.2.1'
DHT support [ON]
Local Peer Discovery support [ON]
PeX support [ON]
Anonymous mode [ON]
Encryption support [ON]
GeoIP database loaded. Type: GeoLite2-Country. Build time: ... .
Options were saved successfully.
Successfully listening on IP: 192.168.0.2, port: UDP/8999
...
'...' restored.
Successfully moved torrent: ... New path: ...
...
UPnP / NAT-PMP support [OFF]

Test:

  • Windows 7 Ultimate 64-bit SP1
  • Use proxy only for torrents (Socks5 Tor proxy, doesn't support UDP connections)
  • Any interface and all addresses OR set interface and address
  • Disable/Enable anonymous mode
  • Disable/Enable UPnP / NAT-PMP support (use port forwarding in my router)
  • Disable disable connections not supported by proxies

Result:

  • No DHT, no magnet working
  • No in log: Successfully listening on IP: 0.0.0.0, port: TCP/port
  • When set Any interface and all addresses get in log Detected external IP: x.x.x.x
  • When set Any interface and my address get in log Detected external IP: x.x.x.x
  • When set My interface and all addresses no in log Detected external IP: x.x.x.x
  • When set My interface and my address no in log Detected external IP: x.x.x.x
  • Gone back to 4.1.9 again and working fine

In my case, I want to connect to trackers through a proxy and make all other connections directly.

@sledgehammer999
Copy link
Member Author

sledgehammer999 commented Dec 23, 2019

@ExceptionGit There is a slight possibility that the posted build didn't have the patch applied. I reuploaded it. Can you download the same file again and test?

@ExceptionGit
Copy link

@sledgehammer999 Yes, file hashes have been updated.

SHA3_512
fb0b262bf1f7b68457863e3abea9a661cf39bb656f4f309d2533dbf3e575c00622b66718d6e1b98f14e82babb0e659cf29c49b48371f0e7d2626b47a93742727 *qbittorrent.exe
b11b4c40379e6009813f8c3bb291e3f303966ecc721387c589396ba3eae8292d090db327d303750747cee532ce05e2f775dd74c238dd52f1dc6e49c1ce46d4f6 *qbittorrent.pdb

Config:

  • Enable anonymous mode
  • Set My interface and my addres

Log (no error "Socks5 error: %1", wait ~8min):

qBittorrent v4.2.1 started
Using config directory: ...
Trying to listen on: 192.168.0.2:8999
Peer ID: -qB4210-
HTTP User-Agent is 'qBittorrent/4.2.1'
DHT support [ON]
Local Peer Discovery support [ON]
PeX support [ON]
Anonymous mode [ON]
Encryption support [ON]
GeoIP database loaded. Type: GeoLite2-Country. Build time: ... .
Options were saved successfully.
Successfully listening on IP: 192.168.0.2, port: UDP/8999
UPnP / NAT-PMP support [OFF]

Config:

  • Disable anonymous mode
  • Set Any interface and all addresses

Log (no error "Socks5 error: %1", wait ~10min):

qBittorrent v4.2.1 started
Using config directory: ...
Trying to listen on: 0.0.0.0:8999,[::]:8999
Peer ID: -qB4210-
HTTP User-Agent is 'qBittorrent/4.2.1'
DHT support [ON]
Local Peer Discovery support [ON]
PeX support [ON]
Anonymous mode [OFF]
Encryption support [ON]
GeoIP database loaded. Type: GeoLite2-Country. Build time: ... .
Options were saved successfully.
Successfully listening on IP: 0.0.0.0, port: UDP/8999
Detected external IP: ...
UPnP / NAT-PMP support [OFF]

I think my old proxy server version does not return error for libtorrent.

@arvidn
Copy link
Contributor

arvidn commented Dec 24, 2019

@sledgehammer999 you can test the build and logging by just setting a random hostname and port as a socks5 proxy, and ensure you get the socks5_alert(s) indicating you failed to connect.

After having thought a bit more about this, I think one issue, that may not have existed in libtorrent-1.1.x, is that the socks5 proxy logic sits on the individual socket object layer. That means that if you have multiple interfaces (which one is likely to have), each interface will trigger a socks5 connection and tunnel. This is not ideal, and I can understand if socks proxies frown upon that behavior and only let the first one (or the last one) in.

For example, when just testing this now, I get these listen interface by default:

[Dec 24 01:00:11] successfully listening on [UDP] 0.0.0.0:6881
[Dec 24 01:00:11] successfully listening on [TCP] [fe80::1%lo0]:6881
[Dec 24 01:00:11] successfully listening on [UDP] [fe80::1%lo0]:6881
[Dec 24 01:00:11] successfully listening on [TCP] [fe80::1808:b4b2:e86b:e3ee%en0]:6881
[Dec 24 01:00:11] successfully listening on [UDP] [fe80::1808:b4b2:e86b:e3ee%en0]:6881
[Dec 24 01:00:11] successfully listening on [TCP] [fe80::44e7:e2ff:feeb:6bb3%awdl0]:6881
[Dec 24 01:00:11] successfully listening on [UDP] [fe80::44e7:e2ff:feeb:6bb3%awdl0]:6881
[Dec 24 01:00:11] successfully listening on [TCP] [fe80::44e7:e2ff:feeb:6bb3%llw0]:6881
[Dec 24 01:00:11] successfully listening on [UDP] [fe80::44e7:e2ff:feeb:6bb3%llw0]:6881
[Dec 24 01:00:11] successfully listening on [TCP] [fe80::302c:6ee8:8e44:c2f2%utun0]:6881
[Dec 24 01:00:11] successfully listening on [UDP] [fe80::302c:6ee8:8e44:c2f2%utun0]:6881
[Dec 24 01:00:11] successfully listening on [TCP] [fe80::429c:ce7f:c10b:49df%utun1]:6881
[Dec 24 01:00:11] successfully listening on [UDP] [fe80::429c:ce7f:c10b:49df%utun1]:6881
[Dec 24 01:00:11] successfully listening on [TCP] [fe80::8956:242a:2e6d:aac5%utun2]:6881
[Dec 24 01:00:11] successfully listening on [UDP] [fe80::8956:242a:2e6d:aac5%utun2]:6881
[Dec 24 01:00:11] successfully listening on [TCP] [fe80::6693:a331:ed65:6426%utun3]:6881
[Dec 24 01:00:11] successfully listening on [UDP] [fe80::6693:a331:ed65:6426%utun3]:6881
[Dec 24 01:00:11] successfully listening on [TCP] [fe80::35fa:7336:d62c:1b24%utun4]:6881
[Dec 24 01:00:11] successfully listening on [UDP] [fe80::35fa:7336:d62c:1b24%utun4]:6881
[Dec 24 01:00:11] successfully listening on [TCP] [fe80::ce3f:b640:c788:9377%utun5]:6881
[Dec 24 01:00:11] successfully listening on [UDP] [fe80::ce3f:b640:c788:9377%utun5]:6881

As a quick hack to avoid this, I think setting listen_interfaces to 0.0.0.0:6881 (or whatever port) whenever a socks5 proxy is configured, might work. I think it would make sense for libtorrent to work a bit differently too. I can see two approaches:

  1. whenever a proxy is configured, we're not accepting connections directly via sockets anyway, just via the proxy (which is only one connection/socket). So, the proxy setting could override the logic of opening one socket per interface. Instead it would open one that matches whatever protocol the proxy uses (either IPv4 or IPv6). Problem with this is that if you really have multiple interfaces connected to the internet, you wand to use them all, and all of them should establish a tunnel via the proxy.

  2. When establishing a proxy connection, only do that with a matching address family as the listen socket. If the proxy hostname doesn't resolve to a compatible address family, disable that listen socket. i.e. if the socks5 proxy only resolves to an IPv4 address, don't open the IPv6 listen sockets, and vice versa.

I'm leaning towards (2), but maybe there's should be a more generic rule around filtering listen interfaces as well. For instance, all those %utun0 etc, interfaces are most likely stale.

Does anyone have any opinions?

@sledgehammer999
Copy link
Member Author

you can test the build and logging by just setting a random hostname and port as a socks5 proxy, and ensure you get the socks5_alert(s) indicating you failed to connect.

Yes it does print errors if I point to eg 127.0.0.1

As a quick hack to avoid this, I think setting listen_interfaces to 0.0.0.0:6881 (or whatever port) whenever a socks5 proxy is configured

Guys, if you want to test the above, go to Advanced settings and choose Any interface + All IPv4 addresses (and then restart)

@condoghost
Copy link

Please report the errors you get in the log. Don't forget to enclose them in "code" tags. For this click the relevant button from the toolbar present above the comment input box which has a tooltip "Insert code". The loglines will be posted suitable for easy reading.

Link: http://builds.shiki.hu/temp/qbittorrent_4.2.1_x64_patched_for_issue_11735.7z
(run from any folder or overwrite official files)

Sorry - I did not understand "to enclose them in "code" tags" as I could not find "click the relevant button from the toolbar present above the comment input box which has a tooltip "Insert code". The loglines will be posted suitable for easy reading."

Link: http://builds.shiki.hu/temp/qbittorrent_4.2.1_x64_patched_for_issue_11735.7z extracted to folder and ran from that folder.

qBittorrent v4.2.1 Set Tools, Options, Connections Proxy Server Socks5, Authentication, OK

Preloaded torrents with URL http trackers: some are Working, some are Not Working,
Had to individually Pause / Force Resume or Force reannounce each torrent where URL http Not Working for all URL http to be Working.

Loaded torrent with URL udp trackers: all trackers Not Working, have 0-Seeds, have 0-Peers, and torrent is not downloading.

Looking at qBittorrent v4.2.1 Execution Log I see no errors and these are the lines copied one-by-one ...
24/12/2019 11:08 - UPnP/NAT-PMP: Port mapping successful, message: successfully mapped port using UPnP. external port: UDP/45484
24/12/2019 11:08 - Successfully listening on IP: fe80::9f9:72a4:f6eb:d270%11, port: UDP/55535
24/12/2019 11:08 - Successfully listening on IP: fe80::9f9:72a4:f6eb:d270%11, port: TCP/55535
24/12/2019 11:08 - Options were saved successfully.
24/12/2019 11:08 - GeoIP database loaded. Type: GeoLite2-Country. Build time: Tue Dec 17 19:59:54 2019.
24/12/2019 11:08 - UPnP / NAT-PMP support [ON]
24/12/2019 11:08 - Encryption support [ON]
24/12/2019 11:08 - Anonymous mode [ON]
24/12/2019 11:08 - PeX support [OFF]
24/12/2019 11:08 - Local Peer Discovery support [OFF]
24/12/2019 11:08 - DHT support [OFF]
24/12/2019 11:08 - HTTP User-Agent is 'qBittorrent/4.2.1'
24/12/2019 11:08 - Peer ID: -qB4210-
24/12/2019 11:08 - Trying to listen on: 0.0.0.0:55535,[::]:55535

qBittorrent v4.2.1 Set Tools, Options, Connections Proxy Server (None) OK. Closed client. Deleted App Data Local Temp Files. Restarted client.

URL udp trackers Working, have Seeds, have Peers, and torrent is downloading.

Looking at qBittorrent v4.2.1 Execution Log I see no errors and these are the lines copied one-by-one ...
24/12/2019 11:47 - Successfully listening on IP: fe80::9f9:72a4:f6eb:d270%11, port: UDP/55535
24/12/2019 11:47 - Successfully listening on IP: fe80::9f9:72a4:f6eb:d270%11, port: TCP/55535
24/12/2019 11:47 - Successfully listening on IP: 0.0.0.0, port: UDP/55535
24/12/2019 11:47 - Successfully listening on IP: 0.0.0.0, port: TCP/55535
24/12/2019 11:47 - Options were saved successfully.
24/12/2019 11:47 - GeoIP database loaded. Type: GeoLite2-Country. Build time: Tue Dec 17 19:59:54 2019.
24/12/2019 11:47 - UPnP / NAT-PMP support [ON]
24/12/2019 11:47 - Encryption support [ON]
24/12/2019 11:47 - Anonymous mode [ON]
24/12/2019 11:47 - PeX support [OFF]
24/12/2019 11:47 - Local Peer Discovery support [OFF]
24/12/2019 11:47 - DHT support [OFF]
24/12/2019 11:47 - HTTP User-Agent is 'qBittorrent/4.2.1'
24/12/2019 11:47 - Peer ID: -qB4210-
24/12/2019 11:47 - Trying to listen on: 0.0.0.0:55535,[::]:55535

@ExceptionGit
Copy link

ExceptionGit commented Dec 24, 2019

it does print errors if I point to eg 127.0.0.1

This is my case (if I set a non-existent network address), but no error "Socks5 error: %1" if i set proxy address, Any interface + All IPv4 addresses and restart: no dht, no error.

@condoghost

@RandomInhabitant
Copy link

I'm looking at one which has these characteristics
image
As you can see it has 2 seeds and 32 peers, yet nothing is happening, it's stuck at "downloading metadata".
Here are some active trackers:
image

Usually when data actually flows it is from one of these sources:
image

Is the code base which uses trackers separate from the code base which handles DHT/PeX/LSD?

Sorry in advance, I just noticed these trackers aren't UDP, but I figure this might be useful toward figuring out what is going on.

@arvidn
Copy link
Contributor

arvidn commented Dec 26, 2019

@RandomInhabitant http trackers do not go through the same path as udp trackers, when using a socks5 proxy.
The issue people seem to experience is related to the socks5 UDP proxying.

@calvilasboasjr
Copy link

Guys, I don't know if you noticed that:

Versions 3.3.16 and 4.2.0 and using VPN on SOCKET5:

I noticed that in both versions, when I add a new torrent, the torrent DOES NOT AUTOMATICALLY START!

So when I click the PAUSE and START buttons a few times:
PAUSE, I wait 4 seconds ...
START, I wait 4 seconds ...
PAUSE, I wait 4 seconds ...
START

Result:
After doing this sequence, the VPN IP FINNALY APPEARS in the EXECUTION LOG TAB, and the torrent starts loading SEEDS and the download starts.

Please make this test and comment.

Thanks.

@arvidn
Copy link
Contributor

arvidn commented Dec 27, 2019

there's also no application layer timeout on the connection attempts to the socks5 proxy. If the other machine does not respond with port-unreachable and the network doesn't respond with host-unreachable, the connection attempt may take several minutes before failing. The test build only print socks5 errors to the logs, not attempts to connect (for instance). So make sure you give any test runs plenty of time to fail.

@calvilasboasjr
Copy link

Understand.

What I mean is, when I do this kind of action, PAUSE-START, the torrent starts faster.
Whenever I start a new torrent, it takes a long time for the SOCKET5 VPN IP to appear in the LOG TAB and the torrent only starts after this IP appears in the LOG.

@crafty35a
Copy link

22+ hours now on the latest test build and everything continues to work. I have two socks5 related semaphore timeout errors in the log, but I'm not seeing any adverse effects.

@FranciscoPombal
Copy link
Member

@xavier2k6 @amsterdampaul arvidn/libtorrent#4498 has landed

@xavier2k6
Copy link
Member

xavier2k6 commented Apr 15, 2020

New master TEST build with a fix UDP ASSOCIATE SOCKS5 connection retry from libtorrent.

qBittorrent master commit e030fc0 with libtorrent RC_1_2 commit ebc2bfc

@migasQ
Copy link

migasQ commented Apr 17, 2020

New master TEST build with a fix UDP ASSOCIATE SOCKS5 connection retry from libtorrent.

qBittorrent master commit e030fc0 with libtorrent RC_1_2 commit ebc2bfc

It's working well with SOCKS5. I will let it running for a couple of hours and see if there are any SOCKS5 reconnection issues. Also it was not necessary to specify the network interface, I could leave it on any interface in the Advanced settings.

@HnyBear
Copy link

HnyBear commented Apr 17, 2020

New master TEST build with a fix UDP ASSOCIATE SOCKS5 connection retry from libtorrent.

qBittorrent master commit e030fc0 with libtorrent RC_1_2 commit ebc2bfc

This is the only error I'm getting after running all night.

4/17/2020 6:20 AM - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: End of file ep: 109.201.154.132:1080

@migasQ
Copy link

migasQ commented Apr 17, 2020

After 12h of seeding/ downloading (also adding new magnet torrents after a couple of hours), I am only getting a SOCKS5 connection was closed error after it was seeding for a long time. But the SOCKS5 still works because after I added a new magnet torrent it directly started to find seeders and started downloading. Good job @arvidn, @sledgehammer999, @xavier2k6 and @FranciscoPombal ! I think the SOCKS5 related DHT, UDP trackers, meta data stalling, etc. erros I experienced in the past seem to be resolved!

@Cunningcory
Copy link

I've been having SOCKS5 issues for several years. I finally had to just set up a VM running a full proxy connection and a qbit babysitter to restart the app if and when the proxy disconnected. I'd love to be able to ditch the VM and go back to just a simple socks5. I've been following a few of these threads waiting for a solution. Gonna test this newest test build and cross my fingers!

@arvidn
Copy link
Contributor

arvidn commented Apr 18, 2020

as far as I can tell, the vast majority of issues are solved now. If the server disconnects, libtorrent will reconnect. This is expected to happen every now and then as the SOCKS5 connection is idle and long lived.

However, there are still a few failure cases where libtorrent will not try again, for example, if the hostname lookup fails for the proxy server, or if the socks5 server IP cannot be reached. To do this properly, there would need to be some kind of back-off timer, to avoid hammering some poor IP.

Fixing these cases is not very high priority right now, since I think they only affect very few people and not very often.

@FranciscoPombal
Copy link
Member

as far as I can tell, the vast majority of issues are solved now. If the server disconnects, libtorrent will reconnect. This is expected to happen every now and then as the SOCKS5 connection is idle and long lived.

However, there are still a few failure cases where libtorrent will not try again, for example, if the hostname lookup fails for the proxy server, or if the socks5 server IP cannot be reached. To do this properly, there would need to be some kind of back-off timer, to avoid hammering some poor IP.

Fixing these cases is not very high priority right now, since I think they only affect very few people and not very often.

I think as soon as 4.2.4 is released, we can close this thread and open a new one specifically to track infrequent SOCKS5 disconnects.

@sledgehammer999 what are your plans for the release date of 4.2.4? It seems all of the more important issues have been resolved (there are a couple of important PRs that have not yet been merged, but are almost there). Same on the libtorrent side. In fact, 1.2.6 should be nearing official release, but the remaining stuff in the milestone at this point is not that important.

@RabidWolf
Copy link

New master TEST build with a fix UDP ASSOCIATE SOCKS5 connection retry from libtorrent.

qBittorrent master commit e030fc0 with libtorrent RC_1_2 commit ebc2bfc

Is this 4.2.3 or 3.4.0alpha? I downloaded an earlier build and it was 4.3.0alpha.

@xavier2k6
Copy link
Member

xavier2k6 commented Apr 18, 2020

@RabidWolf it's an updated alpha build

@RabidWolf
Copy link

Thanks will wait for 3.2.4

@HnyBear
Copy link

HnyBear commented Apr 20, 2020

Back to not downloading after a day or so. Seeing this error.

4/18/2020 8:03 PM - SOCKS5 proxy error. Message: SOCKS5 error. op: handshake ec: The semaphore timeout period has expired ep: 109.201.154.207:1080
4/18/2020 8:03 PM - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 109.201.154.216:1080
4/18/2020 8:03 PM - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 46.166.186.196:1080
4/18/2020 8:02 PM - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 109.201.152.23:1080

@crafty35a
Copy link

Same here unfortunately, here is the log.

(W) 2020-04-19T16:01:06 - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 68.71.244.34:1085
(I) 2020-04-19T16:04:03 - Detected external IP: 68.71.244.38
(W) 2020-04-19T16:16:35 - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 68.71.244.38:1085
(I) 2020-04-19T16:21:09 - Detected external IP: 88.202.177.231
(W) 2020-04-19T16:28:20 - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 88.202.177.231:1085
(I) 2020-04-19T16:31:44 - Detected external IP: 96.44.147.106
(W) 2020-04-19T17:00:35 - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 96.44.147.106:1085
(I) 2020-04-19T17:05:54 - Detected external IP: 173.44.37.82
(W) 2020-04-19T17:34:21 - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 173.44.37.82:1085
(I) 2020-04-19T17:39:06 - Detected external IP: 194.59.250.234
(W) 2020-04-19T18:21:54 - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 194.59.250.234:1085
(W) 2020-04-19T18:22:01 - SOCKS5 proxy error. Message: SOCKS5 error. op: handshake ec: An existing connection was forcibly closed by the remote host ep: 88.202.177.238:1085

@Cunningcory
Copy link

Mine has also crapped out. What a bummer. I was hoping this was fixed. My log would get this message every few hours:

4/20/2020 6:32 AM - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 46.166.190.161:1080

This was followed five minutes later with a new IP detection:

4/20/2020 6:37 AM - Detected external IP: 109.201.152.234

This didn't seem to be an issue for a while, but most recently instead of getting a new IP detection, I instead got a new error message immediately following it:

4/20/2020 5:38 PM - SOCKS5 proxy error. Message: SOCKS5 error. op: sock_read ec: The semaphore timeout period has expired ep: 109.201.138.233:1080
4/20/2020 5:38 PM - SOCKS5 proxy error. Message: SOCKS5 error. op: handshake ec: End of file ep: 109.201.154.198:1080

The handshake error seems to be the one that permanently kills the connection.

@Fyb3roptik
Copy link

For whatever reason, this completely cleared up doing a fresh ubuntu install. I havent had to restart the service in about a week and a half! I sure hope you guys can get it figured out!

@coreyemtp
Copy link

coreyemtp commented Apr 21, 2020

An observation:

I have two torrents that will not work with SOCKS5 on. They were begun after qBittorrent sat idle for ~1 day. I've restarted, paused and unpaused, changed the host and put it back, unchecked authentication and rechecked, and every combo of these steps you can think of. No love.

However, if I pause the second one and turn off the proxy server, the first will start. Now if I enable the proxy server with authentication and "use proxy only for torrents" unchecked (my normal settings), then resume the second one, it will start. I haven't gone so far as to check the reported IP of the second torrent using the TorGuard torrent, but I will soon.

If anyone can test and confirm/deny this, it might help.

@coreyemtp
Copy link

I did run the CheckMyIPTorrent torrent, and it is indeed hiding my IP:

21.04.2020 06:42:23 | 109.201.138.225 | qBittorrent/4.3.0alpha1
21.04.2020 06:41:39 | 46.166.137.203 | qBittorrent/4.3.0alpha1
21.04.2020 06:41:37 | 46.166.137.203 | qBittorrent/4.3.0alpha1

Interesting that it switched IPs so quickly.

@xavier2k6
Copy link
Member

New "Windows x64" TEST build linked below.

Based from these commits:
qBittorrent master commit 8ed63d6 & libtorrent RC_1_2 commit arvidn/libtorrent@a996891

Test Build Link

@HnyBear
Copy link

HnyBear commented Apr 21, 2020

Is this the same 4.3.0alpha1 posted last week?

@xavier2k6
Copy link
Member

Is this the same 4.3.0alpha1 posted last week?

No, it's a new build based on latest commits...

@HnyBear
Copy link

HnyBear commented Apr 21, 2020

Is this the same 4.3.0alpha1 posted last week?

No, it's a new build based on latest commits...

Ok just wondering because it still shows as 4.3.0alpha1

@FranciscoPombal
Copy link
Member

Ok just wondering because it still shows as 4.3.0alpha1

Yeah that version string does not change between alpha builds.

@UltraHKR

This comment has been minimized.

@FranciscoPombal
Copy link
Member

FranciscoPombal commented Apr 23, 2020

It seems almost all of the issues have been addressed in the changes made in qBittorrent/libtorrent since this issue was opened. The remaining identified issues have to do with some rarer SOCKS5 proxy disconnects that have been acknowledged here: #11735 (comment).

Thus, now that 4.2.4 is released, bringing the fixes to all of the user base, I think it is time to close this, as it's getting too long and contains a lot of comments about stuff that is already fixed.
I will open a new issue report to track specifically the SOCKS5 disconnect issue (EDIT: here #12583).

Anyone having further connectivity issues not related to the aforementioned SOCKS5 issue, please open a separate issue report.

A big thank you to everyone who participated in testing, debugging, and discussing this issue.

@qbittorrent qbittorrent locked as resolved and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Network Issues related to network connectivity Proxy/VPN Issues related to the use of proxy/VPN
Projects
None yet
Development

No branches or pull requests