CyclopsMC / IntegratedTerminals

Terminals for managing and overviewing Integrated Dynamics networks
MIT License
5 stars 6 forks source link

Using Integrated terminal causes client side disconnects after terminals have been in use for a while (PacketCodecException) #112

Closed Panthe1 closed 7 months ago

Panthe1 commented 8 months ago

Issue type:


Short description:

Accessing an integrated terminal that is connected to a logic cable/ logic network results in an error along with the user begin disconnected from server. Terminal has to be connected and in use for some time ( time it takes to actually produce error is a constant variable. )

Steps to reproduce the problem:

  1. In and world, place down a logic cable and a terminal and right click it, when clicking it you will get a cyclops error and disconnected.

Time it takes to reproduce this error is a variable and I did not take a count of how long it takes, I can provide world file if that would help

Expected behaviour:

When right clicking the storage terminal it should open and show inventory.


Versions:

Log file:

Client log files: https://mclo.gs/vHdMjMm Server Log file: https://mclo.gs/pNki2ne

rubensworks commented 8 months ago

Could you share the error message? I don't see it anywhere in the logs.

Panthe1 commented 8 months ago

Error message on server: https://imgur.com/a/gWOI0oO Client side error message: https://imgur.com/a/UROlgOX

Thank you!

On Wed, Nov 22, 2023 at 10:11 AM Ruben Taelman @.***> wrote:

Could you share the error message? I don't see it anywhere in the logs.

— Reply to this email directly, view it on GitHub https://github.com/CyclopsMC/IntegratedTerminals/issues/112#issuecomment-1823250943, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASTSYVSI5N3MULEMNENO73DYFY53ZAVCNFSM6AAAAAA7WTZESSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRTGI2TAOJUGM . You are receiving this because you authored the thread.Message ID: @.***>

rubensworks commented 8 months ago

Ok, that's the one I need! :-)

Do you have a log file where you see more details of this error message (PacketCodecException)? Your earlier logfile only contained partial information. There should be a full stacktrace somewhere.

katomaro commented 8 months ago

Chippin in after a player on a server I host for friends made the terminal and would crash when trying to use it.

Our server is a custom instance of ATM 9 xxx.21 (some added mods really, nothing that should really interact with it).
It is claim independent and always happens on SERVERS, not too familiar with how Minecraft's "Internal Server" works, but I asked him to try messing around with the mod on Singleplayer and it worked fine.

I did some digging on server files and found this SERVER/config/integratedterminals-common.toml: #The maximum number of terminal storage instances that can be sent in a single packet. Reduce this when you have packet overflows. terminalStoragePacketMaxInstances = 1024

Since the error just reads Internal Exception: org.cyclops.cyclopscore.network.PacketHandler$PacketCodecException: An exception occurred during decoding of packet org.cyclops.integratedterminals.network.packet.TerminalStorageIngredientCraftingOptionsPacket@79242032 I figured it had to do with packets so I changed the value on the config from 1024 to 128 (@Panthe1 try this), and it seems to work fine, my friend is able to now use his terminal and link up stuff and all.

There's really no StackTraces anywhere, looked on all server logs and also on client logs to try and add to this issue, best I could get after I right clicked and got the insta-kick was the generic disconnect due packet decoding or whatever. Hope this helps in some way, not sure of the implications of my temporary fix yet, but it is working, this came out after a lot of testing between other mods and all of that.

rubensworks commented 8 months ago

Thanks for sharing your insights @katomaro! I'll look into lowering the default value for terminalStoragePacketMaxInstances.

@katomaro If you lower it to a higher value, e.g. 512, does it still work on your end?

LyraelRayne commented 8 months ago

I am having the same issue on an ATM9 server. I was fine using integrated terminals for quite a while, but recently I added the following setup (not sure if it caused the issue, but I had the crash immediately upon trying to test this setup):

image

And now I can't interact with any terminal, otherwise I get the PacketCodecException. This includes a terminal on a network by itself with no interfaces

image

I am not an operator on the server, so I can't immediately test the new setting, but I'll ask the owner later on whether they'll test it with 512.

katomaro commented 8 months ago

@rubensworks Good morning!
I just woke up and asked players if I could do a quick restart to try changing the value for terminalStoragePacketMaxInstances from 128 to 512 as asked, and asked the player in question to try adding stuff and removing things, after a 5 minutes testing session of opening stuff and adding resources and all of that, it seems like it works fine, if crashes happens I guess I will lower it to 258...?

Again, I am really not sure what are the implications of this change, but hey, seems like a fix in my eyes for the time being.

I should note that our server is still quite small as its a "friends" thing (albeit public), but I am not sure if errors would start showing up on with more and more items added to chests/network, I expect it to at least have some freezing happening in the long run, but honestly, to be expected since we are playing with ATM. Again, thanks for the mod and attention.

rubensworks commented 8 months ago

Thanks for checking @katomaro! I'll look into changing the default value of terminalStoragePacketMaxInstances to 512 in the next update.

Again, I am really not sure what are the implications of this change, but hey, seems like a fix in my eyes for the time being.

The only impact will be that when opening terminals over very large networks, slightly more network packets will be sent. But players should experience no changes because of this.

LyraelRayne commented 7 months ago

The owner of the server I was running on set theirs to 256 which also fixed the issue (as we'd expect, knowing that 128 and 512 both work)

katomaro commented 7 months ago

Got the ping on my e-mail, a couple days ago I updated our ATM9 server to .24 which adds a couple more items and recipes and the issue is back, changing terminalStoragePacketMaxInstances to 128 even didn't fix. I didn't mess around with it anymore as people decided to use another storage mod rather than relying on brain work to try and fix it, but I suspect that the issue now might be related to terminalStoragePacketMaxRecipes, by logic, I think increasing the value might fix it (since basically what changed was the addition of recipes), but I haven't had time to test it myself as people are playing all the time and I can't just restart the server at will. Same behavior as before, works fine on single player, on multiplayer gives the generic disconnect. Needs to be looked into further @rubensworks. If I get some free window with no one playing I will try to check it out, but so far, this is all the info I got. Nothing really useful on logs.