SpigotMC / BungeeCord

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.
https://www.spigotmc.org/go/bungeecord
Other
1.56k stars 1.1k forks source link

HAProxy 2.0+ Proxy Protocol Spam - InitialHandler - NativeIoException: recvAddress(..) failed: Connection reset by peer #3608

Closed Imptovskii closed 4 months ago

Imptovskii commented 7 months ago

Bungeecord version

git:BungeeCord-Bootstrap:1.20-R0.3-SNAPSHOT:c69acf7:1791

Server version

This server is running Pufferfish version git-Pufferfish-22 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: 42ef3dc on HEAD)

Client version

HAProxy

Bungeecord plugins

AuthMeBungee, LuckPerms, 2LS Antibot, PistonMOTD, SkinsRestorer

The bug

There is no such problem with HAProxy 1.8. When using a version higher than 2.0, a problem with constant warning spam begins. HAProxy 1.8 is currently EOL

Currently installed version 2.6.12 from the Debian 12 repositories.

HAProxy CFG:

listen minecraft
        bind :25565
        mode tcp
        option tcp-check
        balance roundrobin
        server minecraft1 1.1.1.1:11111 check-send-proxy check send-proxy-v2
        server minecraft2 2.2.2.2:22222 check-send-proxy check send-proxy-v2 backup

Log output (links)

15:34:51 [WARNING] [/1.1.1.1:11111] <-> InitialHandler - NativeIoException: recvAddress(..) failed: Connection reset by peer
15:34:52 [WARNING] [/2.2.2.2:22222] <-> InitialHandler - NativeIoException: recvAddress(..) failed: Connection reset by peer
15:34:53 [WARNING] [/3.3.3.3:33333] <-> InitialHandler - NativeIoException: recvAddress(..) failed: Connection reset by peer

1

Checking

md-5 commented 7 months ago

What is check-send-proxy? Is your configuration the same for each version? What if you disable the proxy protocol?

Imptovskii commented 7 months ago

What is check-send-proxy? Is your configuration the same for each version? What if you disable the proxy protocol?

check-send-proxy

This option forces emission of a PROXY protocol line with outgoing health checks, regardless of whether the server uses send-proxy or not for the normal traffic. By default, the PROXY protocol is enabled for health checks if it is already enabled for normal traffic and if no "port" nor "addr" directive is present. However, if such a directive is present, the "check-send-proxy" option needs to be used to force the use of the protocol. See also the "send-proxy" option for more information.

Is your configuration the same for each version? Yes

What if you disable the proxy protocol? InitialHandler - encountered exception: net.md_5.bungee.util.QuietException: Unexpected packet received during login process! 0a0d0a000d0a515549540a2000

md-5 commented 7 months ago

What if you disable the proxy protocol?

You need to disable it on both bungee and haproxy

Imptovskii commented 7 months ago

You need to disable it on both bungee and haproxy

listen minecraft-testing
        bind :25575
        mode tcp
        option tcp-check
        balance roundrobin
        server minecraft1 1.1.1.1:11111 check

I made another test section. Disabled the proxy protocol. Configured basic TCP balancing. And there are no errors. But the real client IP is not forwarded, and this is a problem.