Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server join broken #7

Closed
f4n74z14 opened this issue Apr 7, 2023 · 12 comments
Closed

Server join broken #7

f4n74z14 opened this issue Apr 7, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@f4n74z14
Copy link

f4n74z14 commented Apr 7, 2023

Hello! After the latest changes, joining the game broke for me.

Stacktrace:

[10:45:03] [Netty Server IO #1/WARN]: java.lang.reflect.InvocationTargetException
[10:45:03] [Netty Server IO #1/WARN]: 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[10:45:03] [Netty Server IO #1/WARN]: 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[10:45:03] [Netty Server IO #1/WARN]: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[10:45:03] [Netty Server IO #1/WARN]: 	at java.lang.reflect.Method.invoke(Method.java:498)
[10:45:03] [Netty Server IO #1/WARN]: 	at dev.thomazz.pledge.util.ChannelHelper.encodeAndCompress(ChannelHelper.java:19)
[10:45:03] [Netty Server IO #1/WARN]: 	at dev.thomazz.pledge.network.handler.PacketFrameOutboundHeadHandler.flush(PacketFrameOutboundHeadHandler.java:88)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:115)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.channel.AbstractChannelHandlerContext.access$1500(AbstractChannelHandlerContext.java:38)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.channel.AbstractChannelHandlerContext$16.run(AbstractChannelHandlerContext.java:756)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
[10:45:03] [Netty Server IO #1/WARN]: 	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
[10:45:03] [Netty Server IO #1/WARN]: 	at java.lang.Thread.run(Thread.java:750)
[10:45:03] [Netty Server IO #1/WARN]: Caused by: java.lang.ClassCastException: io.netty.buffer.PooledUnsafeDirectByteBuf cannot be cast to net.minecraft.server.v1_12_R1.Packet
[10:45:03] [Netty Server IO #1/WARN]: 	at net.minecraft.server.v1_12_R1.PacketEncoder.encode(PacketEncoder.java:17)
[10:45:03] [Netty Server IO #1/WARN]: 	... 19 more

Tested on: git-Paper-1618 (MC: 1.12.2) ; git-Paper-498 (MC: 1.19.4)

Also the problem persists with and w/o ViaVersion, ProtocolLib.

Thanks!

@ScatDev
Copy link

ScatDev commented Apr 12, 2023

I also started getting this on 1.8

@ThomasOM
Copy link
Owner

I am currently working on a fix for this, you can use version 2.2 for the moment

@ThomasOM
Copy link
Owner

As it stands now I am unable to reproduce it, on paper current paper version, no plugins with only pledge active

@ThomasOM
Copy link
Owner

I force deployed a new build to the maven repository, let me know if this fixes it.
If not please provide me with the following information:

  • Bungeecoord enabled / disabled
  • Compression threshold
  • Last server log file

@ThomasOM ThomasOM added the bug Something isn't working label Apr 14, 2023
@ThomasOM
Copy link
Owner

I've confirmed this as fixed on the latest build with another user, let me know if this is also resolved on the latest build

@f4n74z14 f4n74z14 reopened this Apr 19, 2023
@f4n74z14
Copy link
Author

f4n74z14 commented Apr 19, 2023

Hello! Sorry, misclick.

I've tested on the lastest build (2.3 from repo) and the problem still persists for me

  1. BungeeCord mode is disabled.
  2. network-compression-threshold=0
  3. The lastest log: https://mclo.gs/nCGvg9O

@ThomasOM
Copy link
Owner

Hello, this should be resolved in update 2.4. Let me know if you're still experiencing issues.

@f4n74z14
Copy link
Author

f4n74z14 commented Apr 21, 2023

Yup, now it works but incompatible with ProtocolLib. 😵
Edit: sometimes it cannot make handler even w/o ProtocolLib

[05:31:01 ERROR]: Could not pass event PlayerLoginEvent to PledgeTest v1.0
org.bukkit.event.EventException: null
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:72) ~[patched_1.12.2.jar:git-Paper-1620]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:513) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.PlayerList.attemptLogin(PlayerList.java:565) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.LoginListener.b(LoginListener.java:152) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.LoginListener.e(LoginListener.java:68) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.NetworkManager.a(NetworkManager.java:273) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.ServerConnection.c(ServerConnection.java:150) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:948) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-1620]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.RuntimeException: Could not get channel for player: f4n74z14
        at dev.thomazz.pledge.channel.ReflectiveChannelAccess.getChannel(ReflectiveChannelAccess.java:68) ~[?:?]
        at dev.thomazz.pledge.PledgeImpl.onPlayerLogin(PledgeImpl.java:213) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor11.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:70) ~[patched_1.12.2.jar:git-Paper-1620]
        ... 13 more
Caused by: java.lang.NoSuchFieldException: Could not find field in class net.minecraft.server.v1_12_R1.HandshakeListener with names [EntityPlayer]
        at dev.thomazz.pledge.util.ReflectionUtil.getFieldByClassNames(ReflectionUtil.java:21) ~[?:?]
        at dev.thomazz.pledge.channel.ReflectiveChannelAccess.getChannel(ReflectiveChannelAccess.java:57) ~[?:?]
        at dev.thomazz.pledge.PledgeImpl.onPlayerLogin(PledgeImpl.java:213) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor11.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:70) ~[patched_1.12.2.jar:git-Paper-1620]
        ... 13 more

Edit 2: This happens if player kicked on login state

  [03:49:58 WARN]: [io.netty.util.concurrent.AbstractEventExecutor] A task raised an exception. Task: dev.thomazz.pledge.PlayerHandler$$Lambda$1066/0x00000008015cecd8@2516655c
  java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "io.netty.channel.ChannelHandlerContext.pipeline()" because "ctx" is null
    at dev.thomazz.pledge.PlayerHandler.lambda$tickEnd$1(PlayerHandler.java:131) ~[?:?]
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[patched_1.12.2.jar:git-Paper-1620]
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[patched_1.12.2.jar:git-Paper-1620]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[patched_1.12.2.jar:git-Paper-1620]
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) ~[patched_1.12.2.jar:git-Paper-1620]
    at java.lang.Thread.run(Thread.java:833) [?:?]
    Caused by: java.lang.NullPointerException: Cannot invoke "io.netty.channel.ChannelHandlerContext.pipeline()" because "ctx" is null
    at dev.thomazz.pledge.network.PacketFrameOutboundHeadHandler.drain(PacketFrameOutboundHeadHandler.java:109) ~[?:?]
    at dev.thomazz.pledge.PlayerHandler.lambda$tickEnd$1(PlayerHandler.java:129) ~[?:?]
    ... 5 more

@ThomasOM
Copy link
Owner

First exception seems very weird since it seems like a handshake listener instead of a login listener is found even though the login listener is called? The second issue should be fixed in 8e0dff8, feel free to verify if your issue is resolved.

@f4n74z14
Copy link
Author

First exception seems very weird since it seems like a handshake listener instead of a login listener is found even though the login listener is called?

Yes, that weird, but sometimes it happens.

@ThomasOM
Copy link
Owner

@gbomexify Create a new issue for this

@ThomasOM
Copy link
Owner

Closing this now, if any other problems are encountered feel free to create another issue

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants