adde0109 / Ambassador

This is a Velocity plugin that makes it possible to host a modern forge server behind a Velocity proxy!
GNU Lesser General Public License v2.1
85 stars 18 forks source link

Ambassador incompatible with Velocity 3.2.0 Build 269+ #43

Closed Kaydax closed 11 months ago

Kaydax commented 11 months ago

Connecting to a velocity server with ambassador installed when using velocity builds 269 or higher causes the client to fail to connect, stating there was an issue with packets

[19:39:24] [main/INFO] [com.velocitypowered.proxy.VelocityServer]: Booting up Velocity 3.2.0-SNAPSHOT (git-904e81db)...
[19:39:24] [main/INFO] [com.velocitypowered.proxy.VelocityServer]: Loading localizations...
[19:39:24] [main/INFO] [com.velocitypowered.proxy.network.ConnectionManager]: Connections will use epoll channels, libdeflate (Linux x86_64) compression, OpenSSL 3.0.x (Linux x86_64) ciphers
[19:39:24] [main/INFO] [com.velocitypowered.proxy.VelocityServer]: Loading plugins...
[19:39:24] [main/INFO] [com.velocitypowered.proxy.plugin.VelocityPluginManager]: Loaded plugin ambassador 1.4.2-beta by adde0109
[19:39:24] [main/INFO] [com.velocitypowered.proxy.VelocityServer]: Loaded 1 plugins
[19:39:24] [Velocity Async Event Executor - #0/WARN] [com.velocitypowered.proxy.network.ConnectionManager]: The server channel initializer has been replaced by org.adde0109.ambassador.Ambassador.inject(Ambassador.java:107)
[19:39:24] [Velocity Async Event Executor - #0/WARN] [com.velocitypowered.proxy.network.ConnectionManager]: The backend channel initializer has been replaced by org.adde0109.ambassador.Ambassador.inject(Ambassador.java:110)
[19:39:24] [Netty epoll Boss #0/INFO] [com.velocitypowered.proxy.network.ConnectionManager]: Listening on /[0:0:0:0:0:0:0:0%0]:25566
[19:39:24] [main/INFO] [com.velocitypowered.proxy.Velocity]: Done (0.47s)!
[19:39:26] [Netty epoll Worker #0/INFO] [com.velocitypowered.proxy.connection.client.AuthSessionHandler]: [connected player] Kaydax (/10.0.0.1:49796) has connected
[19:39:26] [Netty epoll Worker #0/INFO] [com.velocitypowered.proxy.connection.MinecraftConnection]: [server connection] Kaydax -> main has connected
[19:39:32] [Netty epoll Worker #0/ERROR] [com.velocitypowered.proxy.connection.MinecraftConnection]: [server connection] Kaydax -> main: exception encountered in com.velocitypowered.proxy.connection.backend.BackendPlaySessionHandler@4121f843
io.netty.handler.codec.CorruptedFrameException: Error decoding class com.velocitypowered.proxy.protocol.packet.AvailableCommands Direction CLIENTBOUND Protocol 1.16.4 State PLAY ID 10
    at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.handleDecodeFailure(MinecraftDecoder.java:131) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:86) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.channelRead(MinecraftDecoder.java:61) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:333) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:454) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.IllegalArgumentException: Argument type identifier null unknown.
    at com.velocitypowered.proxy.protocol.packet.brigadier.ArgumentPropertyRegistry.deserialize(ArgumentPropertyRegistry.java:90) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at com.velocitypowered.proxy.protocol.packet.AvailableCommands.deserializeNode(AvailableCommands.java:210) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at com.velocitypowered.proxy.protocol.packet.AvailableCommands.decode(AvailableCommands.java:88) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:84) ~[velocity-proxy-3.2.0-SNAPSHOT-all.jar:3.2.0-SNAPSHOT (git-904e81db)]
    ... 30 more
[19:39:32] [Netty epoll Worker #0/INFO] [com.velocitypowered.proxy.connection.client.ConnectedPlayer]: [connected player] Kaydax (/10.0.0.1:49796) has disconnected: velocity.error.connected-server-error
[19:39:32] [Netty epoll Worker #0/INFO] [com.velocitypowered.proxy.connection.MinecraftConnection]: [server connection] Kaydax -> main has disconnected
[19:40:06] [Thread-4/INFO] [com.velocitypowered.proxy.VelocityServer]: Shutting down the proxy...
[19:40:06] [Thread-4/INFO] [com.velocitypowered.proxy.network.ConnectionManager]: Closing endpoint /0.0.0.0:25566

The build that seems to work without this issue is 3.2.0 Build 261, so after that build seems to add a breaking change that makes ambassador break

adde0109 commented 11 months ago

Build from the 1.20.2 branch

Kaydax commented 11 months ago

I wasn't using a server that was 1.20.2, so the branch being called that really didn't make me think to use it. Secondly this is an issue with the release on the modrinth page, so it being marked 1.13-1.20.2 doesn't explain much in what versions of velocity it supports, this this issue being created.

KastenKlicker commented 11 months ago

I'm having the same issue: latest.log.

I updated my velocity to 3.2.0-275. I can't connect to my forge and paper servers. Neither my forge nor my paper servers are logging any connection attempts.

Building from the 1.20.2 branch failed, because of the following issues:

getActiveSessionHandler() doesn't exists, but getSessionHandler() https://github.com/adde0109/Ambassador/blob/594aa4ccea6138bbea62da873f114dd37e83dd14/src/main/java/org/adde0109/ambassador/forge/VelocityForgeBackendConnectionPhase.java#L115

StateRegistry.CONFIG doesn't exists. https://github.com/adde0109/Ambassador/blob/594aa4ccea6138bbea62da873f114dd37e83dd14/src/main/java/org/adde0109/ambassador/forge/VelocityForgeClientConnectionPhase.java#L64

Both issues seem to be introduced by the latest commit https://github.com/adde0109/Ambassador/commit/594aa4ccea6138bbea62da873f114dd37e83dd14.

After changing those lines, the build was successful, but the issue still persists.

adde0109 commented 11 months ago

I'm having the same issue: latest.log.

I updated my velocity to 3.2.0-275. I can't connect to my forge and paper servers. Neither my forge nor my paper servers are logging any connection attempts.

Building from the 1.20.2 branch failed, because of the following issues:

getActiveSessionHandler() doesn't exists, but getSessionHandler()

https://github.com/adde0109/Ambassador/blob/594aa4ccea6138bbea62da873f114dd37e83dd14/src/main/java/org/adde0109/ambassador/forge/VelocityForgeBackendConnectionPhase.java#L115

StateRegistry.CONFIG doesn't exists.

https://github.com/adde0109/Ambassador/blob/594aa4ccea6138bbea62da873f114dd37e83dd14/src/main/java/org/adde0109/ambassador/forge/VelocityForgeClientConnectionPhase.java#L64

Both issues seem to be introduced by the latest commit 594aa4c.

After changing those lines, the build was successful, but the issue still persists.

The velocity submodule isn't up to date. You need the set it the the commit specified in in the branch.

KastenKlicker commented 11 months ago

I reset my local branch and tried to build it again, no clue why, but this time it worked. Now my servers are reachable again. Thank you for your help!

adde0109 commented 11 months ago

Fixed with the release of v1.4.3-beta