GeyserMC / Geyser

A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock Edition.
https://geysermc.org
MIT License
4.75k stars 686 forks source link

Server unreachable when use-proxy-protocol is true #4652

Closed InTheProcess closed 5 months ago

InTheProcess commented 6 months ago

Describe the bug

The server becomes unreachable when I set enable-proxy-protocol to true. I am using a reverse proxy, so this needs to be enabled.

To Reproduce

  1. Install Floodgate and Geyser for Velocity
  2. Enable in the Geyser config: enable-proxy-protocol
  3. Have a reverse proxy port forwarding the Geyser port on the UDP protocol (I use LocalXpose)
  4. Try to join with any bedrock client

Expected behaviour

I expect my Minecraft server to be reachable for bedrock players when I am using a reverse proxy.

Screenshots / Videos

No response

Server Version and Plugins

Geyser Dump

https://dump.geysermc.org/NxxQB7WZ1MEb354ht8WqsT5nzwdQXjNM

Geyser Version

Velocity 2.3.0-SNAPSHOT

Minecraft: Bedrock Edition Device/Version

1.20.81, Windows 10 Edition

Additional Context

This is the error when I set enable-proxy-protocol to false (repeats until I have to manually kill the server process):


java.lang.IndexOutOfBoundsException: index: 0, length: 1 (expected: range(0, 0))
at io.netty.buffer.AbstractByteBuf.checkRangeBounds(AbstractByteBuf.java:1390) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.buffer.AbstractByteBuf.checkIndex0(AbstractByteBuf.java:1397) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.buffer.PooledSlicedByteBuf.getByte(PooledSlicedByteBuf.java:128) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.buffer.AbstractByteBuf.getUnsignedByte(AbstractByteBuf.java:368) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at org.cloudburstmc.netty.handler.codec.raknet.common.ConnectedPingHandler.acceptInboundMessage(ConnectedPingHandler.java:40) ~[?:?]
at org.cloudburstmc.netty.handler.codec.raknet.AdvancedChannelInboundHandler.channelRead(AdvancedChannelInboundHandler.java:44) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at org.cloudburstmc.netty.handler.codec.raknet.common.RakSessionCodec.checkForOrdered(RakSessionCodec.java:336) ~[?:?]
at org.cloudburstmc.netty.handler.codec.raknet.common.RakSessionCodec.handleDatagram(RakSessionCodec.java:327) ~[?:?]
at org.cloudburstmc.netty.handler.codec.raknet.common.RakSessionCodec.channelRead(RakSessionCodec.java:218) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:102) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at org.cloudburstmc.netty.handler.codec.raknet.server.RakServerRouteHandler.channelRead(RakServerRouteHandler.java:60) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:102) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at org.cloudburstmc.netty.handler.codec.raknet.AdvancedChannelInboundHandler.channelRead(AdvancedChannelInboundHandler.java:48) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at org.cloudburstmc.netty.handler.codec.raknet.server.RakServerRateLimiter.channelRead0(RakServerRateLimiter.java:148) ~[?:?]
at org.cloudburstmc.netty.handler.codec.raknet.server.RakServerRateLimiter.channelRead0(RakServerRateLimiter.java:35) ~[?:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at org.geysermc.geyser.network.netty.handler.RakConnectionRequestHandler.channelRead(RakConnectionRequestHandler.java:80) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at org.cloudburstmc.netty.handler.codec.raknet.ProxyInboundRouter.channelRead(ProxyInboundRouter.java:66) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:97) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[waterfall.jar:3.3.0-SNAPSHOT (git-bf507dc0-b380)]
at java.base/java.lang.Thread.run(Thread.java:833) [?:?]```

Here is the dump: https://dump.geysermc.org/HvCPdeMVHOuTEWsqkKG1BrOhGXXy0UG7
onebeastchris commented 6 months ago

Does LocalXpose support the HAProxy protocol for UDP/RakNet? Based on the error, it doesn't look like it is actually sending HAProxy headers.

If you are unsure if it does support it, please contact the support of LocalXpose and see if they support it.

InTheProcess commented 6 months ago

I have contacted their support team. I will let you know what they say once they respond.

onebeastchris commented 5 months ago

Closing due to no further response.