EXC Memory stream is not expandable - A20.4 b42 - Dedicated Server Fix

The issue appears to come from the way that data is saved to a player profile. Somehow they got the beans above the frank in A20.4 b42 and messed up their serialization code. When a player's profile is read, it cant read the new serialization value and causes a Run Time Error on the client side. It looks like this is just in relation to drones, but have seen it caused by accessing a gyrocopter (couldn't replicate it though).

Look familiar?
 

Code:
2022-04-29T12:32:37 666.749 EXC Memory stream is not expandable.
  at System.IO.MemoryStream.set_Capacity (System.Int32 value) [0x0003d] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.IO.MemoryStream.EnsureCapacity (System.Int32 value) [0x00061] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.IO.MemoryStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x000b3] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at StreamUtils.StreamCopy (System.IO.Stream _source, System.IO.Stream _destination, System.Byte[] _tempBuf, System.Boolean _bFlush) [0x00029] in :0 
  at PlayerDataFile.Write (PooledBinaryWriter _bw) [0x003b3] in :0 
  at NetPackagePlayerId.write (PooledBinaryWriter _writer) [0x00020] in :0 
  at NetConnectionSimple.taskSerialize (ThreadManager+ThreadInfo _threadInfo) [0x004f3] in :0 
UnityEngine.StackTraceUtility:ExtractStringFromException(Object)
Log:Exception(Exception)
NetConnectionSimple:taskSerialize(ThreadInfo)
ThreadManager:myThreadInvoke(Object)
System.Threading.ThreadHelper:ThreadStart_Context(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object)
System.Threading.ThreadHelper:ThreadStart(Object)


So how do you fix it?
If your hosting provider allows you, change the server to BETA version Alpha 20.3. 
*your clients will need to do this too
Once thats been done, restore the affected player's profile (~/Save/../Player/<steam_id>.ttp) from the .bak version.

Delete drone.dat and drone.bak to force a recreation with an accurate serialization object stream
Bounce the box
Have affected user log in
Go to the Winchester have a nice cold pint 

 
iv the same problem

1.when u change back ur server the BETA, ur savegame wont work (on gportal servers)

2.the problem is NOT THE DRONE !..its the combination with something else...(in my case its the motorbike/minibike and a block in 1 house)

when i use the bike , i can play hours and hours with drone ...when we get near motorbike=crash

 
Last edited by a moderator:
Until your profile exceeds 2048kb. Fix it to move your profile to SP, it will get cleaned up and move back to dedicated server. 

 
iv the same problem

1.when u change back ur server the BETA, ur savegame wont work (on gportal servers)

2.the problem is NOT THE DRONE !..its the combination with something else...(in my case its the motorbike/minibike and a block in 1 house)

when i use the bike , i can play hours and hours with drone ...when we get near motorbike=crash
So it is the drone - but its tricky because some logs have basically shown that you do not even have to use it. A user recently showed me an example of logs with drone but he never once even used or summoned one. If you are right and it is not the drone ai or subroutine please show me a log of next time you get the error. It very well may not be 100% the drone but I need a log that has proof to believe that.

 
Last edited by a moderator:
Thanks MilordWizardKing for posting your fix as well - This enabled me to start playing again! Was worried I'd have a corrupt save or something for a moment there.

I encountered this when standing 'near' my motorcycle, with my drone active, more specifically, it happened when I upgraded a 'Ladder' block, and mistakenly upgraded the bottom half of the ladder before the top, which caused the ladder to fall, and when the ladder fell, it triggered the error.

From there, relog/restart server did nothing to fix the errors, and my profile would no longer save. 

"EDIT":

Actually I may have spoken too soon. My drone disappeared, but to no surprise considering deleting 'drones.dat/.bak' was part of the fix, but I got spare drone out of one of my storage boxes, and that triggered the error again.... I guess i just have to not use drones if i want to play? :(

 
Last edited by a moderator:
I am having the EXACT same issue. I am stuck in a death loop because the games goes into it's crash mode and won't load the next chunk so I fall through the world forever. It definitely coincides with using the motorcycle and a drone as previously I was using the 4x4 and drone with no issues but decided to change to my motorcycle to make a speed run into the wasteland for some loot. Hope this gets fixed because I can no longer play multiplayer with my friends until it does.

 
As soon as you get in the game, press F1 and type "tp 0 0 0". Do it as fast as possible. Maybe even practice first.


No need to practice LOL

You can bring up the console while the game is still loading. Enter dm in the console to allow teleport.

Have the teleport command loaded and hit Enter to send it, as soon as you spawn.

 
So it is the drone - but its tricky because some logs have basically shown that you do not even have to use it. A user recently showed me an example of logs with drone but he never once even used or summoned one. If you are right and it is not the drone ai or subroutine please show me a log of next time you get the error. It very well may not be 100% the drone but I need a log that has proof to believe that.
https://pastebin.com/z2eDFbi3

heres my FULL logs..we cant play the game anymore, because it is horror to play

first i get to the destroyed area (perhaps u read this in the logs) then itunes a half broke house, then ONE block was with error...after THEN the problem begun

go near motorbike = crash...then i opened the cheat menu and get the big motorbike for usw = same problem

we stopped playing after circa 10x relogin to check this...

what makes ME CURIOS is...the time when i take the screenshot LOG, and the time were i copied the text log...

20220427_213658.jpg

 
Yeah but according to your log nothing abnormal about vehicles but you said you had no drones while drone subroutines are running anyways. Not disregarding possible vehicle issues but I have been able to create the bug with just drones. (No vehicles.) mind you too that Vehicle scripts never ran because I didn't use vehicles.

 
I had this happen to me on my fiance's game.  The fix is confusing me and I'm not sure how to tell him how to fix it.  I'm able to play somewhat but the lag gets super bad in city and when I spawn into the game I'm not where I was when I left his game.  I don't think it's a dedicated server, I can only access the game when he's in it.

 
Last edited by a moderator:
As soon as you get in the game, press F1 and type "tp 0 0 0". Do it as fast as possible. Maybe even practice first.
I'll give it a go, but this is in a multiplayer game so I have to get the server admin to enable DM mode. Guess I'll be abandoning my motorcycle and never returning to that area or else I'll start crashing again?

 
Has anyone had this cause them not to be able to log into any online servers. We started experiencing this as soon as we got the Robotic Drone on the server. First another character started experiencing it almost as soon as he found his first Robotic Drone. He was in a Rotocopter when it happened. I experienced it not long after placed the drone down. I only had the 4x4 as vehicles placed in the world. After we figured out it was the drone causing it we picked the drones up and that seemed to fix it. I could not just leave it alone though. So I tried experimenting with different locations, mods on the drone, etc. Long story short I have this bug combined with the lost drone/to many drones deployed (my drone is in my backpack, but game thinks it is still in the world). Now I can not get into any online servers at all. It gets hung on the creating character step for both my server and other servers that I have tried. Do the developers have a clue as to this bug and when might they fix it?

 
Do the developers have a clue as to this bug and when might they fix it?
The community has diagnosed it as an issue with the player ttp files becoming stuffed with erroneous (repetitive) bytes towards the end of file which causes the file to swell above the limit of 2MB. Supposedly you can delete a bunch of the bytes from the file (server-side) and it temporarily fixes the problem, but people are having a hard time figuring out which exact bytes need to be deleted (and if you guess wrong it just uses the borked .bak file). Without an ICD from the devs it's trial and error to edit these by hand. I would think a game-breaking issue like this would top priority and it appears to be relatively easy to solve but haven't seen any progress from the devs.

 
Last edited by a moderator:
I have little to no experience in editing config and save files. I did find where the launcher will let you "clean" game files. If I used this, would it have any effect on the server and would I delete my character on the server? The interaction between single player and multiplayer is about as clear to me as frosted glass, but I was under the impression that all of the player's data when playing online was stored by the server. I have the option to FTP into the server files, but when I try it just wants to open it in browser where I can not edit the character files.

What is a good program to open the FTP site with and edit the files?

 
The launcher will only edit the files on your computer. As for ftp to server, only the server owner can do that so if you know who that is you can ask them to supply you with your profile files.

 
Happened to someone on my server. I tried to profile fix as stated. We will see what happens. I had done a map reset on 20.3 but kept the data when i updated to 20.4. Need to do another reset anyway but this would be nice if it works. Thanks everyone for the feedback. I also recently had to disable EAC since the update otherwise no one could get in. Most likely doesn't help that this same world has been through 3 updates.

 
Why is there no hot fix for this yet? I cannot play multiplayer at all with my friends (unless I am willing to do a workaround to cleanse my profile or start a new character) as long as this error exists. The player-base has pretty much figured out what the problem is. This may be the first time I truly feel let down by the dev team. ETA on fix???

 
Back
Top