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

[BUG] Many Incoming Encryption fail with InvalidMessage #199

Open
pyckle opened this issue Oct 19, 2021 · 1 comment
Open

[BUG] Many Incoming Encryption fail with InvalidMessage #199

pyckle opened this issue Oct 19, 2021 · 1 comment
Labels

Comments

@pyckle
Copy link
Collaborator

pyckle commented Oct 19, 2021

Describe the bug
While testing on a public torrent, many incoming connection negotiations fail with the following error:

[19/Oct/2021:23:23:32,279] TRACE MSEHandshakeProcessor: Negotiated encryption policy: REQUIRE_ENCRYPTED, peer: InetPeer{address=/104.x.x.x, port=63721}
[19/Oct/2021:23:23:32,279] TRACE InboundMessageProcessor: 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  Debug message: Unknown message type ID: -45
  Peer: InetPeer{address=/104.x.x.x, port=63721}
  Buffer: java.nio.DirectByteBuffer[pos=5 lim=68 cap=1048576]
  Region A: Region{offset=0, limit=0}
  Region B: null
  Decoding params: DecodingBufferView{unconsumedOffset=0, undecodedOffset=68, undecodedLimit=68}
  First undisposed data offset: -1
  Message queue size: 0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[19/Oct/2021:23:23:32,279] DEBUG PeerConnectionFactory: Failed to establish connection with peer: InetPeer{address=/104.x.x.x, port=63721}. Reason: java.lang.RuntimeException (bt.protocol.InvalidMessageExce
ption: Unknown message type ID: -45)
[19/Oct/2021:23:23:32,280] TRACE PeerConnectionFactory: Failed to establish connection with peer InetPeer{address=/104.x.x.x, port=63721}
java.lang.RuntimeException: bt.protocol.InvalidMessageException: Unknown message type ID: -45
        at bt.net.pipeline.InboundMessageProcessor.processInboundData(InboundMessageProcessor.java:92)
        at bt.net.pipeline.DefaultChannelPipeline.fireDataReceived(DefaultChannelPipeline.java:78)
        at bt.net.pipeline.DefaultChannelPipeline.<init>(DefaultChannelPipeline.java:65)
        at bt.net.pipeline.ChannelPipelineFactory$1.doBuild(ChannelPipelineFactory.java:60)
        at bt.net.pipeline.ChannelPipelineBuilder.build(ChannelPipelineBuilder.java:98)
        at bt.net.PeerConnectionFactory.createPipeline(PeerConnectionFactory.java:216)
        at bt.net.PeerConnectionFactory._createConnection(PeerConnectionFactory.java:171)
        at bt.net.PeerConnectionFactory.createConnection(PeerConnectionFactory.java:128)
        at bt.net.PeerConnectionFactory.createOutgoingConnection(PeerConnectionFactory.java:106)
        at bt.net.ConnectionSource.lambda$createPendingConnFuture$0(ConnectionSource.java:135)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: bt.protocol.InvalidMessageException: Unknown message type ID: -45
        at bt.protocol.StandardBittorrentProtocol.readMessageType(StandardBittorrentProtocol.java:226)
        at bt.protocol.StandardBittorrentProtocol.decode(StandardBittorrentProtocol.java:247)
        at bt.net.pipeline.MessageDeserializer.deserialize(MessageDeserializer.java:50)
        at bt.net.pipeline.InboundMessageProcessor.consumeA(InboundMessageProcessor.java:203)
        at bt.net.pipeline.InboundMessageProcessor.processA(InboundMessageProcessor.java:125)
        at bt.net.pipeline.InboundMessageProcessor.processInboundData(InboundMessageProcessor.java:86)
        ... 13 more

Expected behaviour
The negotiation to complete correctly.

To Reproduce
How can another person reproduce the bug?

Enable tracing and look at the logs in just about any torrent. Here is one for example:

magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c&dn=Big+Buck+Bunny&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fbig-buck-bunny.torrent

Screenshots
N/A

Desktop (please complete the following information):

  • Device: Dell Laptop
  • OS:
pickle@radish:~/test2$ cat /etc/debian_version 
11.1
  • Java version:
pickle@radish:~/test2$ java -version
openjdk version "11.0.12" 2021-07-20 LTS
OpenJDK Runtime Environment Corretto-11.0.12.7.1 (build 11.0.12+7-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.12.7.1 (build 11.0.12+7-LTS, mixed mode)
  • NAT/Firewall/VPN etc.: OpenWRT router, port forwarding setup

Additional context
Add any other context about the problem here.

@pyckle pyckle added the bug label Oct 19, 2021
@pangoo-reuse
Copy link

pangoo-reuse commented Apr 20, 2022

Help

How can I limit the upload while downloading? For example, I need an account password to connect to the seed file I am downloading now,please.
like Private Tracker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants