someaddons / connectivity

Minecraft mod connectivity which fixes connection issues
9 stars 0 forks source link

[Bug]: Players cant rejoin, massive netty epoll spam whenever attempted. #54

Closed JustAnotherGhostName closed 1 year ago

JustAnotherGhostName commented 1 year ago

Describe the bug you're experiencing

Uncertain what is the trigger, however, it is not a fresh server so its hard to say what data causes it. The server is currently running ATM8 on version 1.0.10.

After a certain point, players can no longer rejoin the server (or just join once this mystery incident occurs) and console gets massively spammed with [Netty Epoll Server IO #3/WARN] [com.connectivity.Connectivity/]: io.netty.channel.StacklessClosedChannelException about 100+ times. Whenever a player attempts to join, this occurs. See screenshot: image

In addition to the spam, a generic disconnect message is sent when they exit, although it has varied a bit between players.

Rollbacking the world folder on the server fixes this until it may eventually occur again (I've had this happen 2 times today).

Interestingly enough, I isolated the data to be in the ./serverfiles/world/data/scoreboard.dat file under the Teams section. I am not certain if connectivity causes it directly, or if its the interaction between two mods. The scoreboard data file with only the teams data is attached here: scoreboard.zip

Reproducability

1) Start server with the bad scoreboard data. 2) Wait for the server to fully launch 3) Join the server 4) Receive massive console spam 5) Exit server unwillingly

Mod up to date

Minecraft version

1.19

Modloader version

Forge

Logs

https://gist.github.com/JustAnotherGhostName/ef01387ae432ccdc6fd86778a700dab4

soup587 commented 1 year ago

occurs for me as well, when a player leaves the log gets spammed with the same error and won't allow any new players to connect

JustAnotherGhostName commented 1 year ago

occurs for me as well, when a player leaves the log gets spammed with the same error and won't allow any new players to connect

Is it in ATM8 1.0.10 too? Debating about making another report there and linking this one, in case it is something that's specifically due to the interaction between mods.

soup587 commented 1 year ago

using a kitchen sink modpack i've made

i did some more testing, the errors stop after a few minutes and players can join again (but can't rejoin but i believe that's unrelated to connectivity)

the log does seem to give random read/writeaddress errors every few hours when no one's connected though

someaddons commented 1 year ago

hm not an actual connectivity bug, it just displays the error in the log, I guess some message hit size limits for some reasons: [05Feb2023 18:23:51.864] [Netty Epoll Server IO #2/WARN] [com.connectivity.Connectivity/]: io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: unable to fit 2098417 into 3 Too bad the error doesnt mention anything else

someaddons commented 1 year ago

@JustAnotherGhostName regarding your scoreboard, it seems that one mod flooded it with entries:

image

Appears to be some kind of performance/clear lag mod, though I'm not sure which one it is

JustAnotherGhostName commented 1 year ago

Hm, I will investigate that in my end. Cant guarantee how prompt it will be, but ill be sure to post an update here if I confirm anything with that. Currently the only clear lag operation I have running on my server is my own, which just uses built in Minecraft commands every so often and isnt even written in java, so im not certain what is causing that.

someaddons commented 1 year ago

try updating cofh, probably caused this: https://github.com/CoFH/CoFHCore/pull/37

JustAnotherGhostName commented 1 year ago

try updating cofh, probably caused this: CoFH/CoFHCore#37

Ill check that out then when I get the chance and report back. My server had a map reset, so I need to see if I still got a copy of the world with the error since I saved this 2 weeks ago. Nice catch though, would be nice if that's the fix.

Mistmage commented 1 year ago

I have a bit similar problem - well, not really, but i have [Netty Epoll Server IO #2/WARN] [com.connectivity.Connectivity/]: io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: unable to fit 2098417 into 3 Each time i try to connect to my own dedicated server.

I checked Scoreboard, and it does not look like there is a problem - i did not see spam anyway

Version 1.19.2 The only other clue i have is these:

[minecraft/ServerLoginPacketListenerImpl]: com.mojang.authlib.GameProfile@653f775d[id=456114e6-e973-4b3b-a5f2-bd36f426de72,name=mistmage,properties={textures=[com.mojang.authlib.properties.Property@2b979155]},legacy=false] (/[0:0:0:0:0:0:0:1]:49293) lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: unable to fit 2789424 into 3

Oh yea, it is a fresh new server.

(i have none problems in entering singleplayer)

Mistmage commented 1 year ago

Okay. I fixed that problem – as i understand. "3" is a recipe index. And after i removed everyCompat that bug were fixed. But now I do have spam as

[05Mar2023 22:56:31.033] [Netty Server IO #2/WARN] [com.connectivity.Connectivity/]: io.netty.channel.StacklessClosedChannelException

Do i understand correctly that CoFH core problem is still not fixed?

JustAnotherGhostName commented 1 year ago

Apologies for the late response, haven't had the issue replicate again until now, same issue, and we are on the latest version of CoFH core.

JustAnotherGhostName commented 1 year ago

Another weird thing is this time, it... it somehow resolved itself after a bit of time? It still caused a time frame of about 5-10 min. Something I can also note when this occurs, which really surprises me, is that cpu usage for the PROCESS, aka core of minecraft, not the rest of the server, jumps to ~60-70% usage.

I currently allocate my server 6 threads, so realistically it only ever is at ~20% usage as it fills up 1 thread and does a bit in another thread. Knowing minecraft is HEAVILY single threaded, this kinda is expected for it to be at 20% ish. The fact that this bug somehow causes multiple allocated threads to max out / become high in usage is surprising to me.

This means 4-5 threads were being close to maxed out whenever this bug occurs. Threads dedicated to the core process, not odd ball threads that some mods, such as say spark, would allocate itself.

Mistmage commented 1 year ago

yea, i have the same thing - and for some weird reason it happens only for me (at least for now) and other two players are fine. It also always does not appear on first time i enter server, and may or may not happen on any of consecutive. And after in happens once i need to restart Minecraft - it do not fix itself.

katubug commented 1 year ago

Same issue here!

Kiwicast commented 1 year ago

I had a similar issue, i couldnt join my dedicated server, connectivity was spamming my server on forge 1.19.3. As soon as I removed connectivity I accessed my server and no further issues.

XFactHD commented 1 year ago

[05Feb2023 18:23:51.864] [Netty Epoll Server IO #2/WARN] [com.connectivity.Connectivity/]: io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: unable to fit 2098417 into 3

This error is very simple to explain. Minecraft has three packet size limits:

  1. A custom payload packet may not be larger than 1 MB
  2. Any uncompressed packet may not be larger than 8 MB
  3. Any compressed packet may not be larger than 2 MB

The important one for that error is the third one: at the end of the pipeline, Minecraft prepends the packet buffer with its own length encoded as a var-int. That var-int is limited to 3 bytes, which limits the size of the compressed packet to 2 MB.

someaddons commented 1 year ago

fixed

MrSandvik commented 1 year ago

Throwing this observation in for good measure. I had this same issue, and it seemed to have been caused by installing a Chem Turret from Immersive Engineering. I am guessing this caused a tremendous amount of traffic between server and client - eventually leading to connectivity issues. Once I managed to remove it, the problem disappeared.

I have not yet experienced the same problem with the Gun Turret. I only have one, but I imagine this could become an issue if I set up several.

JustAnotherGhostName commented 1 year ago

Definately a different issue than what I had. Issue is this message is generic.

On Sun, May 21, 2023, 12:42 AM AS Godtnok.com @.***> wrote:

Throwing this observation in for good measure. I had this same issue, and it seemed to have been caused by installing a Chem Turret from Immersive Engineering. I am guessing this caused a tremendous amount of traffic between server and client - eventually leading to connectivity issues. Once I managed to remove it, the problem disappeared.

I have not yet experienced the same problem with the Gun Turret. I only have one, but I imagine this could become an issue if I set up several.

— Reply to this email directly, view it on GitHub https://github.com/someaddons/connectivity/issues/54#issuecomment-1556089558, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5ISQG2EYKTL5NMW7QDMWPDXHGTOBANCNFSM6AAAAAAUSCYWNI . You are receiving this because you were mentioned.Message ID: @.***>