"Error while processing packet."

So we’ve been receiving reports about one of our games crashing the entire server, there’s no “You have lost connection to the game.” messages and the game doesn’t CTD, it just stops, some controls still work, particle effects remain active and after using the new log system to find the problem we’ve encountered this.

Can anyone help me understand what this error is and how we can prevent it from happening?

Also to clarify, this error occurs during ‘natural’ playing of the game, there’s nothing we can do specifically to replicate it.

The game in question is located here and it seems specific.

The reports we get suggest the server crashes simultaneously for all players, yet the error is client only, however we are not sure if this is the case as some servers seem to remain functioning after a crash occurs.

Crashes started occurring after the graphics engine change, however this particular crash has only been discovered in the past week.

Crashes occur between 10 and 30 minutes on average.

1 Like

The game runs very smooth before, there is no build up or anything, and it cant be caused by a common event because it is very sudden and seems to happen at once without warning. Everyones guis are removed and they can still walk around, but the server is gone. All we get is “error while processing packet”

I also found this in the log files, but the only string I ever send wouldn’t ever exceed 1k characters, so it must be talking about a C sided packet.

14:26:41.30952 (1678.9914580) Error: Error while processing packet.
14:26:41.30952 (1678.9914580) Warning: Error while processing packet: BitStream >> std::string: Bad string length (packet id: 131, packet length: 1294)

You can thank exploiters for this error, I believe. At least, that is what I would say except it happens to your servers every time.

First thing I’d try is to upload it (discretely) to a hidden alt account. Since exploiters can target a single game without every joining it, from what I understand, you can use this to see if it’s an exploiter screwing with you.

Given it still crashes, which I expect it to do, it’s probably something you’re doing with Remote functions or events.

What are you doing? Do you have FilteringEnabled on?

I don’t have filteringenabled on, the crashes are sudden and all remoteevents would have fired collectively around a thousand times in a 30 minute period, so it’s not a specific one of them, they just transfer ints back and forth.

From what I know the crashing is consistent enough that it probably isn’t an exploiter, especially on gametest.

We still haven’t been able to figure anything out about all this, and a few developers have also said they are experiencing this bug. I checked to make sure, since it said bad string length, that the only C Sided thing I was doing with strings (saving inventories) was fine. I tried saving fifty Blue Dinosaur Hides in an effort to overload the size of the strings, but it worked fine.

Try disabling the sending of string-based packets (RemoteEvents, RemoteFunctions, StringValues etc) and check if the error still occurs. If it doesn’t happen, slowly turn on things which send strings until it starts happening again. When it starts happening again, you should know what’s causing the server to crash.

Assuming it’s replication of strings which is causing it, of course.

The things that do send strings via remote events send two string; “Idle” or “Hunt” and they do so at a very constant rate an average of around three or four thousand times before the server crashes, and they had been doing so since before the crashing began. I’m absolutely convinced that it’s not any of the remoteevents. The only other C sided thing I could think of that used strings was data saving, so I made sure that wasn’t it by saving a 1000 line inventory string, and it worked fine. There is literally nothing in the game that would happen around once every thirty minutes that I could replicate to a T, we tested it for 45 and it did not crash, it only seems to crash when a lot of players are there, without any specific trigger.

Also, nothing is ever sent to all players at once via a C sided function, IE there’s never any invokeClient going on, so I’ve no idea what I could be doing to cause something like this anything other than indirectly.

I’m having the same problem at one of my games - upon using admin commands to kick or ban someone (anyone, really), after a varying delay it will do the same thing. All players will be disconnected, but it will not say “You have lost connection to the server.” Moving still works in small steps to an extent.

This didn’t occur from something that I did, because it started while I was away for a week and could not update my game anyway.

This has to be an error C side. It makes no sense that your scripts can run as you say thousands of times before encountering such an error in fact it seems very unrealistic.

Have you tried isolating the problem to figure out what exactly is causing this?

There have also been reports of this happening to users participating in the egg hunt. Same thing with packet 131 and all.

Surely we can’t be the only people with this issue…

1 Like

I really do wish an administrator would step in regarding it and explain what causes this error, I cant find anything on it.

Word from an employee would be nice

This is a tricky issue, but rest assured we are trying to track it down.

The reason why it’s so tricky is because usually the error message, such as “bad string length”, is not accurate. This is because somehow reading of bitstream got out of order, and we are trying to deserialize the bitstream as a string when it’s actually something else.

We have plans to add more useful debug information. In mean time, if you guys can repro this issue or have any information that you think might be helpful, such as last thing you were doing or stuff happening in the place right before disconnect, please let us know.

[quote] This is a tricky issue, but rest assured we are trying to track it down.

The reason why it’s so tricky is because usually the error message, such as “bad string length”, is not accurate. This is because somehow reading of bitstream got out of order, and we are trying to deserialize the bitstream as a string when it’s actually something else.

We have plans to add more useful debug information. In mean time, if you guys can repro this issue or have any information that you think might be helpful, such as last thing you were doing or stuff happening in the place right before disconnect, please let us know. [/quote]

This occurs at my place every time the :Kick() function is called.

Could you show the code as to when it is called?

[code]function Commands.kick(args,sender)
MinimumPermission(2,sender)
assert(args[1],“Player to kick is missing”)
local banned = GetPlayersFromString(args[1],sender)

for _,i in pairs(banned) do
	if avoidantibans then
		Instance.new("Model",Players).Name = i.Name
	end
	i:Kick()
end

Tell(sender,"Kicked "..tostring(comunpack(banned))..".",3)

end[/code]
-RyanDolan123’s Admin Commands

It occurs when using Person299’s as well:

if string.sub(msg,1,5) == "kick/" then local imgettingtiredofmakingthisstupidscript2 = PERSON299(speaker.Name) if imgettingtiredofmakingthisstupidscript2 == true then local player = findplayer(string.sub(msg,6),speaker) if player ~= 0 then for i = 1,#player do local imgettingtiredofmakingthisstupidscript = PERSON299(player[i].Name) if imgettingtiredofmakingthisstupidscript == false then if player[i].Name ~= eloname then player[i]:Kick() end end end end end end