adde0109 / Proxy-Compatible-Forge

Works with: 1.16.5 - 1.18.2 - 1.19.x - 1.20.x
Other
34 stars 14 forks source link

Can't connect to backed - different errors on backend after each attempt to log in #12

Closed unilock closed 1 year ago

unilock commented 1 year ago

I'm trying to use Ambassador + Proxy Compatible Forge with a modded Minecraft 1.18.2 server of mine running behind Velocity.

Minecraft: 1.18.2, mod list (warning: it's 492 mods; don't judge me) Velocity: velocity-3.2.0-SNAPSHOT-230.jar (modern forwarding mode) Ambassador: v1.2.0-beta Proxy Compatible Forge: 1.18.2-v1.0.0

When I attempt to connect to the Forge server through Velocity, I receive one of several different error messages in the Forge server's log:

[Server thread/INFO] [minecraft/ServerLoginPacketListenerImpl]: com.mojang.authlib.GameProfile@69dfc448[id=<null>,name=PLAYER_NAME,properties={},legacy=false] (/127.0.0.1:53876) lost connection: Internal Exception: net.minecraft.ResourceLocationException: Non [a-z0-9_.-] character in namespace of location: B��������I��1�0�~U�:^v0:0:0:0:0:0:

(with everying after location: being mostly random gibberish)

or

[Server thread/INFO] [minecraft/ServerLoginPacketListenerImpl]: com.mojang.authlib.GameProfile@5dae59ec[id=<null>,name=PLAYER_NAME,properties={},legacy=false] (/127.0.0.1:53871) lost connection: Internal Exception: java.lang.IndexOutOfBoundsException: index: 2, length: 3468 (expected: range(0, 1257))

(with the length: value being a seemingly random number)

or

[Server thread/INFO] [minecraft/ServerLoginPacketListenerImpl]: com.mojang.authlib.GameProfile@538bf488[id=<null>,name=PLAYER_NAME,properties={},legacy=false] (/127.0.0.1:53960) lost connection: Internal Exception: io.netty.handler.codec.DecoderException: The received encoded string buffer length is longer than maximum allowed (741548 > 131068)

(i only saw this error once)

More errors would likely pop up if I keep trying to log in, but I think you get the idea.

There doesn't appear to be any particular reason why one error message is shown as opposed to any other.

In the Velocity log, I only ever get the following:

[12:22:32 ERROR]: [connected player] PLAYER_NAME (/[0:0:0:0:0:0:0:1]:53985): disconnected while connecting to default: disconnect.genericReason

(default being the name of the server in velocity.toml)

I would do a binary search through the mods on the backend, but, y'know... 492 mods...

It's also worth noting that Ambassador v1.1.7-alpha + Proxy Compatible Forge 1.18.2-v0.2.1 worked fine (and still do!).

adde0109 commented 1 year ago

I have seen this before. I will try to reproduce using ATM7

adde0109 commented 1 year ago

I suspect the modern forwarding mixin to be at fault because this only happens with large modpacks and with modern forwarding.

adde0109 commented 1 year ago

As I suspected, it was a old bug that appeared again after the branch got merged. Should now be fixed with 1.0.1

unilock commented 1 year ago

That appears to have fixed it, yep. However, I'm now getting a different error message (in the Velocity logs) when trying to log in:

[17:46:22 INFO]: [connected player] PLAYER_NAME (/192.168.0.1:54918) has connected
[17:46:23 INFO]: [server connection] PLAYER_NAME -> unipack has connected
[17:46:59 INFO]: PLAYER_NAME joined the network
[17:47:00 ERROR]: [server connection] PLAYER_NAME -> unipack: exception encountered in com.velocitypowered.proxy.connection.backend.BackendPlaySessionHandler@598ce0e4
io.netty.handler.codec.CorruptedFrameException: Error decoding class com.velocitypowered.proxy.protocol.packet.AvailableCommands Direction CLIENTBOUND Protocol 1.18.2 State PLAY ID 12
    at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.handleDecodeFailure(MinecraftDecoder.java:131) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:86) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.channelRead(MinecraftDecoder.java:61) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$1.run(AbstractEpollChannel.java:425) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:403) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    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:86) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at com.velocitypowered.proxy.protocol.packet.AvailableCommands.deserializeNode(AvailableCommands.java:210) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at com.velocitypowered.proxy.protocol.packet.AvailableCommands.decode(AvailableCommands.java:88) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:84) ~[velocity-3.2.0-SNAPSHOT-230.jar:3.2.0-SNAPSHOT (git-9149ed33-b230)]
    ... 31 more
[17:47:00 INFO]: [connected player] PLAYER_NAME (/192.168.0.1:54918) has disconnected: Your connection to unipack encountered a problem.
[17:47:00 INFO]: [server connection] PLAYER_NAME -> unipack has disconnected

I assume this is because the "command argument wrapper" was removed in PCF v1.0.0, which is typically required with modded Fabric backends in the form of CrossStitch. (specifically in CommandTreeSerializationMixin.java)

Should I open a new issue?