samolego / FabricTailor

A server-side or singleplayer skin changing mod for fabric.
https://modrinth.com/mod/FabricTailor
GNU Lesser General Public License v3.0
109 stars 17 forks source link

[BUG] When installed on server doesn't let users connect #31

Closed 27rogi closed 3 years ago

27rogi commented 3 years ago

Describe the bug When mod installed client-side everything works, but commands on server don't work. When mod installed on both client and server when attempting to connect to the server you get disconnected when World starts to load with current message playername lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException: Cannot invoke "String.getBytes(java.nio.charset.Charset)" because "☃" is null

To Reproduce Steps to reproduce the behavior:

  1. Install mod on server and client
  2. Try to join server with mod

Logs

[17:47:47] [Server thread/INFO]: Voknehzyr[/95.25.127.68:58719] logged in with entity id 106 at (-804.6999999880791, 66.0, -441.1428548783112)
[17:47:47] [Server thread/WARN]: Player class_3222['Voknehzyr'/106, l='ServerLevel[world]', x=-804.70, y=66.00, z=-441.14] could not be synced because server networking isn't set up yet.
[17:47:47] [Server thread/INFO]: Voknehzyr joined the game
[17:47:47] [Netty Epoll Server IO #2/ERROR]: java.lang.NullPointerException: Cannot invoke "String.getBytes(java.nio.charset.Charset)" because "☃" is null
[17:47:48] [Netty Epoll Server IO #2/ERROR]: java.lang.NullPointerException: Cannot invoke "String.getBytes(java.nio.charset.Charset)" because "☃" is null
[17:47:48] [Server thread/INFO]: [STDOUT]: 1 air
[17:47:48] [Server thread/INFO]: Voknehzyr lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException: Cannot invoke "String.getBytes(java.nio.charset.Charset)" because "☃" is null
[17:47:48] [Server thread/INFO]: Voknehzyr left the game
[17:47:48] [Server thread/WARN]: handleDisconnection() called twice

**Are you using any other mods? Deleting the mod from server side fixes the problem, so there's no need to check compatability.

samolego commented 3 years ago

Hi, thanks for reporting, could you install https://github.com/Tom-The-Geek/WDMNF and post the log again?

arville27 commented 3 years ago

I'm facing the same problem, so I take the log with WDMNF installed, Log

Hope this help

samolego commented 3 years ago

Are you sure it FabricTailor's problem?

Log reports at de.maxhenkel.voicechat.voice.common.PlayerState.toBytes, does that occur when ft is not present>

arville27 commented 3 years ago

Are you sure it FabricTailor's problem?

Yes, I did test without any mod installed except FabricTailor and FabricAPI

I redo the log, without voice chat mod installed, Log.

samolego commented 3 years ago

This must be mod conflict as I can join a server normally (when running only fabrictailor) ...

patrickpissurno commented 3 years ago

So, I had the very same issue yesterday and fixed it by going back to 1.5.1.

My server is in offline mode, and I could join it without any issues, but my friend could not. I have a skin configured on minecraft.net, but she’s using a random username. I think it might have something to do with that, because everything is the same for both of us (mods, fabric, etc), as I myself configured both instances, and the server.

Your mod is installed both in the server and in both our clients. I get that issue on 1.5.4, but not on 1.5.1, and that’s why I downgraded it back to 1.5.1.

We’re on MC 1.7, and sadly I can’t get you some logs right now, as I’m on mobile.

limelier commented 3 years ago

I can confirm, I also encounter this problem on 1.17. I use an offline mode dedicated server as well, and version 1.6.0 of the mod.

Server logs:

[00:46:15] [Server thread/INFO]: limelier[/127.0.0.1:64206] logged in with entity id 147 at (-3088.3574331321943, 68.0, 734.4516529214944)
[00:46:15] [Server thread/INFO]: limelier joined the game
[00:46:15] [Netty Server IO #6/ERROR]: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "seq" is null
[00:46:15] [Netty Server IO #6/ERROR]: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "seq" is null
[00:46:15] [Server thread/INFO]: limelier lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "seq" is null
[00:46:15] [Server thread/INFO]: limelier left the game
[00:46:16] [Server thread/WARN]: handleDisconnection() called twice  

On the client, what happens is "Connection Lost" screen shows up, but the "Back to Server List" button does nothing, forcing the user to close the entire client.

Edit: The bug also does not occur with 1.5.1. Furthermore, using 1.6.0 on the client and 1.5.1 on the server seems to be a valid workaround, save for the fact that skin changes will not be remembered.

27rogi commented 3 years ago

Same problem on 1.6.0, there's Netty log.

[13:19:21] [Netty Epoll Server IO #2/ERROR]: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "seq" is null
[13:19:21] [Netty Epoll Server IO #2/FATAL]: Exception occurred in netty pipeline
io.netty.handler.codec.EncoderException: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "seq" is null
    at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:125) ~[intermediary-server.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) [intermediary-server.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730) [intermediary-server.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.access$1900(AbstractChannelHandlerContext.java:38) [intermediary-server.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:1081) [intermediary-server.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:1128) [intermediary-server.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:1070) [intermediary-server.jar:?]
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [intermediary-server.jar:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) [intermediary-server.jar:?]
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:313) [intermediary-server.jar:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [intermediary-server.jar:?]
    at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "seq" is null
    at io.netty.buffer.ByteBufUtil.utf8Bytes(ByteBufUtil.java:591) ~[intermediary-server.jar:?]
    at net.minecraft.class_2540.method_10788(class_2540.java:2555) ~[intermediary-server.jar:?]
    at net.minecraft.class_2540.method_10814(class_2540.java:486) ~[intermediary-server.jar:?]
    at net.minecraft.class_2703$class_5893$1.method_34153(class_2703.java:95) ~[intermediary-server.jar:?]
    at net.minecraft.class_2540.method_34062(class_2540.java:121) ~[intermediary-server.jar:?]
    at net.minecraft.class_2703$class_5893$1.method_34151(class_2703.java:93) ~[intermediary-server.jar:?]
    at net.minecraft.class_2540.method_34062(class_2540.java:121) ~[intermediary-server.jar:?]
    at net.minecraft.class_2703.method_11052(class_2703.java:49) ~[intermediary-server.jar:?]
    at net.minecraft.class_2545.method_10838(class_2545.java:47) ~[intermediary-server.jar:?]
    at net.minecraft.class_2545.encode(class_2545.java:15) ~[intermediary-server.jar:?]
    at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[intermediary-server.jar:?]
    ... 11 more
[13:19:21] [Server thread/INFO]: Voknehzyr lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "seq" is null
[13:19:21] [Server thread/INFO]: Voknehzyr left the game
samolego commented 3 years ago

I think I've got it, skin loading occurs even if data is null. Simple if should hopefully do the job :)

arville27 commented 3 years ago

Thank you for your hard work, in the last three days I was trying to reproduce the crash, but I cannot get what was the condition to reproduce it. I hope this issue will be fixed in the next update.

27rogi commented 3 years ago

I think I've got it, skin loading occurs even if data is null. Simple if should hopefully do the job :)

Kinda strange, because I can't log in using official account that has skin, but maybe the problem is that I'm using online-mode=false