sonar icon indicating copy to clipboard operation
sonar copied to clipboard

Bug Report: HAProxy is not supported.

Open cygbs opened this issue 4 months ago • 9 comments

General information

The player in Sonar connected via HAProxy is from 127.0.0.1.

Steps to reproduce

  1. Set <server>config/paper-global.yml -> proxies.proxy-protocol to true.
  2. In frpc.toml set transport.proxyProtocolVersion="v2").
  3. Restart server and frpc.
  4. Worked fine, the server thought the player was joining from their real IP address.
  5. Sonar print every player's IP is 127.0.0.1.

Sonar dump

sonar dump [00:47:14 INFO]: [Sonar] 生成信息: {"memory":{"total":"8 GiB","max":"32 GiB","free":"4 GiB","used":"4 GiB"},"runtime":{"virtualCores":24,"jvmArguments":["-XX:ThreadPriorityPolicy\u003d1","-XX:+UnlockExperimentalVMOptions","-XX:+EnableJVMCIProduct","-XX:-UnlockExperimentalVMOptions","-Xms8G","-Xmx32G"],"vmName":"Java HotSpot(TM) 64-Bit Server VM","vmVendor":"Oracle Corporation","vmVersion":"24.0.2+11-jvmci-b01"},"os":{"name":"Windows Server 2025","arch":"amd64","version":"10.0"},"sonar":{"version":"2.1.35 (3ca1852e)","platform":"BUKKIT","gitBranch":"main","gitCommit":"3ca1852e"}}

Additional information

The full server log is here:

https://mclo.gs/6tDsnye

cygbs avatar Aug 03 '25 16:08 cygbs

This is important... The server now appears to be under attack. Because the IP address is not correctly identified, I can only temporarily disable the blacklist first and always use CAPTCHA.

cygbs avatar Aug 03 '25 16:08 cygbs

Here is the log from frpc:

https://mclo.gs/AQ7PU0o

cygbs avatar Aug 03 '25 17:08 cygbs

I am currently on vacation, so I am unable to look into this issue for now.

@FallenCrystal If you've got time and want to help with this, please help me investigate this until I'm back. Any other help would also be appreciated.

The simplest solution for now would just be to use a proxy in front of your Paper server (Velocity, for example).

jonesdevelopment avatar Aug 03 '25 17:08 jonesdevelopment

HAProxy is supported in Sonar, but I think the way Paper manages it is different from Velocity and BungeeCord...

jonesdevelopment avatar Aug 03 '25 17:08 jonesdevelopment

HAProxy is supported in Sonar, but I think the way Paper manages it is different from Velocity and BungeeCord...

Thanks for the quick reply! Does this mean that if I use Velocity, it will work fine?

cygbs avatar Aug 03 '25 17:08 cygbs

HAProxy is supported in Sonar, but I think the way Paper manages it is different from Velocity and BungeeCord...

Thanks for the quick reply! Does this mean that if I use Velocity, it will work fine?

After testing, I added a Velocity and it works fine. Thanks for your help.

cygbs avatar Aug 03 '25 18:08 cygbs

After testing, I added a Velocity and it works fine. Thanks for your help.

Great to hear. We'll still continue to look into fixing HAProxy support on Bukkit platforms.

jonesdevelopment avatar Aug 03 '25 18:08 jonesdevelopment

I have HaProxy enabled on Velocity, but for some reason Transfer with HaProxy does not work on Sonar. However, when I use this feature on the server for the same domain with HaProxy, everything works fine. The problem is specifically with Sonar.

It returns an error: cannot assign requested address: connect

The transfer to Velocity is included. The servers are operated by Cloudnet.

Dangles avatar Sep 05 '25 19:09 Dangles

I have HaProxy enabled on Velocity, but for some reason Transfer with HaProxy does not work on Sonar. However, when I use this feature on the server for the same domain with HaProxy, everything works fine. The problem is specifically with Sonar.

It returns an error: cannot assign requested address: connect

The transfer to Velocity is included. The servers are operated by Cloudnet.

Which IP/domain are you providing in the transfer mode? If your players join through mc.example.com:25565, make sure to set the IP/port to exactly what they're joining with. If you have any more questions, please join the Discord server and provide more information about your issue there. https://jonesdev.xyz/discord

jonesdevelopment avatar Sep 05 '25 19:09 jonesdevelopment