rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.22k stars 416 forks source link

Hundreds of errors with handshake_manager #972

Open jkmers opened 4 years ago

jkmers commented 4 years ago

Hi,

From some days ago, without changing anything in config file and no updated to new version or something similar, I saw that the connection to my server was really slow, like if it's been receiving tons of connection request and it fails to work well.

In the server only have rtorrent + rutorrent so that should be the problem... When I checked the log, I saw hundreds of error like this:

1583965277 I handshake_manager->1XXX.203.56.XX: Adding incoming connection: fd:1550.
1583965277 I handshake_manager->1XXX.203.56.XX: Received error: message:6 unknown download.
1583965277 I handshake_manager->95.211.XXX.XXX: Adding incoming connection: fd:1550.
1583965277 I handshake_manager->95.211.XXX.XXX: Received error: message:6 unknown download.
1583965277 I handshake_manager->2.139.3.XXX: Adding incoming connection: fd:1550.
1583965277 I handshake_manager->2.139.3.XXX: Received error: message:6 unknown download.
1583965277 I handshake_manager->94.XXX.203.XXX: Adding incoming connection: fd:1550.
1583965277 I handshake_manager->94.XXX.203.XXX: Adding incoming connection: fd:1551.
1583965277 I handshake_manager->94.XXX.203.XXX: Received error: message:6 unknown download.
1583965277 I handshake_manager->94.XXX.203.XXX: Adding incoming connection: fd:1551.
1583965277 I handshake_manager->94.XXX.203.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->47.184.46.XXX: Adding incoming connection: fd:1551.
1583965278 I handshake_manager->83.46.82.XXX: Adding incoming connection: fd:1552.
1583965278 I handshake_manager->62.210.129.XXX: Adding incoming connection: fd:1553.
1583965278 I handshake_manager->79.158.9.XXX: Adding incoming connection: fd:1554.
1583965278 I handshake_manager->83.46.82.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->62.210.129.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->192.99.9.XXX: Adding incoming connection: fd:1552.
1583965278 I handshake_manager->79.158.9.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->192.99.9.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->79.152.96.XXX: Adding incoming connection: fd:1552.
1583965278 I handshake_manager->79.152.96.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->47.184.46.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->84.253.241.XXX: Adding incoming connection: fd:1551.
1583965278 I handshake_manager->84.253.241.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->37.120.205.XXX: Adding incoming connection: fd:1551.
1583965278 I handshake_manager->37.120.205.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->88.88.65.XXX: Adding incoming connection: fd:1551.
1583965278 I handshake_manager->88.88.65.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->163.172.40.XXX: Adding incoming connection: fd:1551.
1583965278 I handshake_manager->163.172.40.XXX: Received error: message:6 unknown download.
1583965278 I handshake_manager->95.211.XXX.XXX: Adding incoming connection: fd:1551.
1583965278 I handshake_manager->95.211.XXX.XXX: Received error: message:6 unknown download.
1583965278 I Upload unchoked slots adjust; currently:15 adjust:1
1583965278 I handshake_manager->98.XXX.81.9: Adding incoming connection: fd:1551.
1583965278 I handshake_manager->98.XXX.81.9: Received error: message:6 unknown download.
1583965278 I handshake_manager->89.136.XXX.99: Adding incoming connection: fd:1551.
1583965278 I handshake_manager->89.136.XXX.99: Received error: message:6 unknown download.
1583965278 I Upload unchoked slots adjust; currently:16 adjust:1
1583965278 I handshake_manager->94.XXX.203.XXX: Adding incoming connection: fd:1551.

Any idea what's happening?

kannibalox commented 4 years ago

As indicating by the I, those aren't really errors, and are more just indications that peers are asking your client about a torrent you no longer have.

L041S commented 1 year ago

Sorry to dig up this old topic but I have the same issue. How come someone can request a torrent if I don't have it anymore, is it possible to get removed from peers or should I have to use something like fail2ban to block incoming request ?

kannibalox commented 1 year ago

When you remove a torrent from rtorrent, it can take a good while longer for peers to get an updated peerlist that doesn't include you, particularly when DHT is involved. In the meanwhile, anyone that knows your IP/port can request any torrent hash from you, and rtorrent will simply drop any connections that request a hash it doesn't currently have (which is what those "unknown download" lines are indicating). That kind of traffic should clear up over time, so unless it's illegitimate or actively causing issues there's no need to use fail2ban.

Also. I've talking about rTorrent specifically, but this is how all clients behave, and it's an expected part of the protocol.

L041S commented 1 year ago

Thank you for your answer !