rapiz1 / rathole

A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.
Apache License 2.0
8.8k stars 440 forks source link

Unable to connect - Failed to deserialize hello: invalid value: integer `100466709`, expected variant index 0 <= i < 2 #347

Closed theHimanshuShekhar closed 2 months ago

theHimanshuShekhar commented 3 months ago

Describe the bug

Failed to connect to rathole that is pointing to a Minecraft server hosted on my home lab behind CG-NAT Client and server establish connection but not able to connect via the game.

To Reproduce Steps to reproduce the behavior:

  1. Setup and run both client and server rathole. Successful connection
  2. Try to connect from game or ping using service like mcstatus.io

Configuration Configuration used to reproduce the behavior:

#server.toml
[server]
bind_addr = "0.0.0.0:25565"

[server.services.bhayanak_minecraft]
token = "bhayanak_minecraft"
bind_addr = "0.0.0.0:25566"
#client.toml
[client]
remote_addr = "<CORRECT_IP>:25565"
default_token = "bhayanak_minecraft"

[client.services.bhayanak_minecraft]
local_addr = "10.0.0.205:25566"

Logs

#SERVER
2024-03-21T17:28:25.047145Z  INFO rathole::server: Listening at 0.0.0.0:25565
2024-03-21T17:28:25.047269Z  INFO config_watcher{path="server.toml"}: rathole::config_watcher: Start watching the config
2024-03-21T17:28:25.756968Z  INFO connection{addr=49.36.11.50:46066}: rathole::server: Try to handshake a control channel
2024-03-21T17:28:25.764168Z  INFO connection{addr=49.36.11.50:46066}: rathole::server: Control channel established service=bhayanak_minecraft
2024-03-21T17:28:25.764312Z  INFO connection{addr=49.36.11.50:46066}:handle{service=bhayanak_minecraft}:run_tcp_connection_pool: rathole::server: Listening at 0.0.0.0:25566
2024-03-21T17:29:34.075760Z ERROR connection{addr=49.36.11.50:51954}: rathole::server: Failed to deserialize hello: invalid value: integer `100466709`, expected variant index 0 <= i < 2
2024-03-21T17:30:35.912452Z ERROR connection{addr=49.36.11.50:52036}: rathole::server: Failed to deserialize hello: invalid value: integer `100466709`, expected variant index 0 <= i < 2
#CLIENT
2024-03-21T17:36:00.107648Z  INFO handle{service=bhayanak_minecraft}: rathole::client: Starting 8df4a4179c07afbf20d97c732a1cc715dbeaa1aa8261d393887217f18fea7d3e
2024-03-21T17:36:00.107804Z  INFO config_watcher{path="client.toml"}: rathole::config_watcher: Start watching the config
2024-03-21T17:36:00.130580Z  INFO handle{service=bhayanak_minecraft}:run: rathole::client: Control channel established 

Environment:

sunnypatell commented 2 months ago

Hello @theHimanshuShekhar,

Thank you for reporting this issue and providing detailed logs and configuration settings. I appreciate your effort to outline the steps you’ve taken, which helps us understand the context and specifics of the error.

Analysis of the Issue

The error message Failed to deserialize hello: invalid value: integer '100466709', expected variant index 0 <= i < 2 suggests that during the deserialization process, the value 100466709 was encountered where a smaller integer (in the range of 0 to 1) was expected. This typically indicates a mismatch in the expected data format between the client and server.

Possible Causes

Suggested Next Steps

  1. Verify Compatibility: Ensure that both the client and server are running the same version of rathole. Since you are using v0.5.0, please confirm if this is the latest stable release.
  2. Review Configuration: Double-check the bind_addr and remote_addr settings in both configurations to ensure they accurately reflect the intended setup.
  3. Disable Intermediaries: Temporarily disable any proxies or firewalls that could modify the traffic to rule out external modifications.

Request for Additional Information

Could you please provide the following additional details to help further diagnose the issue?

theHimanshuShekhar commented 2 months ago

closing this issue as I have used alternative tunnelling solution frp which worked for my setup and config.