jpcsupplies / Economy_mod

Basic Economy System for Space Engineers
13 stars 12 forks source link

Economy causing client crash when buying ships #162

Open Zataralee opened 7 years ago

Zataralee commented 7 years ago

We have been having a issue on my server with your mod causing several clients to crash at one time when somebody buys a ship. Below is what my error log produces with the crash. Thanks, and I hope this helps. :D

2017-02-11 13:50:04.500 - Thread:   1 ->  Exception occured: VRage.Library.Collections.BitStreamException: Error when reading using BitReader ---> System.OverflowException: Error when deserializing variant uint32
   --- End of inner exception stack trace ---
   at VRage.Library.Collections.BitStream.ReadUInt32Variant()
   at VRage.Serialization.MySerializerArray`1.Read(BitStream stream, TItem[]& value, MySerializeInfo info)
   at VRage.Serialization.MySerializationHelpers.CreateAndRead[TMember](BitStream stream, TMember& result, MySerializer`1 serializer, MySerializeInfo info)
   at VRage.Network.MyEventTable.<>c__DisplayClass10`7.<CreateSerializer>b__f(T1 inst, BitStream stream, T2& arg2, T3& arg3, T4& arg4, T5& arg5, T6& arg6, T7& arg7)
   at VRage.Network.CallSite`7.Invoke(BitStream stream, Object obj, Boolean validate)
   at VRage.Network.MyReplicationLayer.Invoke(CallSite callSite, BitStream stream, Object obj, EndpointId source, MyClientStateBase clientState, Boolean validate)
   at VRage.Network.MyReplicationClient.ProcessEvent(BitStream stream, CallSite site, Object obj, IMyNetObject sendAs, EndpointId source)
   at VRage.Network.MyReplicationLayer.ProcessEvent(BitStream stream, NetworkId networkId, NetworkId blockedNetId, UInt32 eventId, EndpointId sender)
   at VRage.Network.MyReplicationClient.ProcessEvent(BitStream stream, NetworkId networkId, NetworkId blockedNetId, UInt32 eventId, EndpointId sender)
   at VRage.Network.MyReplicationLayer.ProcessEvent(BitStream stream, EndpointId sender)
   at VRage.Network.MyReplicationLayer.ProcessEvent(MyPacket packet)
   at Sandbox.Engine.Multiplayer.MyTransportLayer.ProcessMessage(Byte[] data, Int32 dataSize, UInt64 sender, MyTimeSpan timestamp, MyTimeSpan receivedTime)
   at Sandbox.Engine.Multiplayer.MyTransportLayer.HandleMessage(Byte[] data, Int32 dataSize, UInt64 sender, MyTimeSpan timestamp, MyTimeSpan receivedTime)
   at Sandbox.Engine.Networking.MyReceiveQueue.ProcessMessages(NetworkMessageDelegate handler, MyTimeSpan delay)
2017-02-11 13:50:04.500 - Thread:   1 ->  InnerException: 
2017-02-11 13:50:04.500 - Thread:   1 ->  Exception occured: System.OverflowException: Error when deserializing variant uint32
2017-02-11 13:50:04.502 - Thread:   1 ->  Exception occured: VRage.Library.Collections.BitStreamException: Error when reading using BitReader ---> System.OverflowException: Error when deserializing variant uint32
   --- End of inner exception stack trace ---
   at VRage.Library.Collections.BitStream.ReadUInt32Variant()
   at VRage.Serialization.MySerializerArray`1.Read(BitStream stream, TItem[]& value, MySerializeInfo info)
   at VRage.Serialization.MySerializationHelpers.CreateAndRead[TMember](BitStream stream, TMember& result, MySerializer`1 serializer, MySerializeInfo info)
   at VRage.Network.MyEventTable.<>c__DisplayClass10`7.<CreateSerializer>b__f(T1 inst, BitStream stream, T2& arg2, T3& arg3, T4& arg4, T5& arg5, T6& arg6, T7& arg7)
   at VRage.Network.CallSite`7.Invoke(BitStream stream, Object obj, Boolean validate)
   at VRage.Network.MyReplicationLayer.Invoke(CallSite callSite, BitStream stream, Object obj, EndpointId source, MyClientStateBase clientState, Boolean validate)
   at VRage.Network.MyReplicationClient.ProcessEvent(BitStream stream, CallSite site, Object obj, IMyNetObject sendAs, EndpointId source)
   at VRage.Network.MyReplicationLayer.ProcessEvent(BitStream stream, NetworkId networkId, NetworkId blockedNetId, UInt32 eventId, EndpointId sender)
   at VRage.Network.MyReplicationClient.ProcessEvent(BitStream stream, NetworkId networkId, NetworkId blockedNetId, UInt32 eventId, EndpointId sender)
   at VRage.Network.MyReplicationLayer.ProcessEvent(BitStream stream, EndpointId sender)
   at VRage.Network.MyReplicationLayer.ProcessEvent(MyPacket packet)
   at Sandbox.Engine.Multiplayer.MyTransportLayer.ProcessMessage(Byte[] data, Int32 dataSize, UInt64 sender, MyTimeSpan timestamp, MyTimeSpan receivedTime)
   at Sandbox.Engine.Multiplayer.MyTransportLayer.HandleMessage(Byte[] data, Int32 dataSize, UInt64 sender, MyTimeSpan timestamp, MyTimeSpan receivedTime)
   at Sandbox.Engine.Networking.MyReceiveQueue.ProcessMessages(NetworkMessageDelegate handler, MyTimeSpan delay)
   at Sandbox.Engine.Networking.MyReceiveQueue.Process(NetworkMessageDelegate handler, MyTimeSpan delay)
   at Sandbox.Engine.Networking.MyNetworkReader.Process(MyTimeSpan lag)
   at Sandbox.MySandboxGame.Update()
   at Sandbox.Engine.Platform.Game.UpdateInternal()
   at Sandbox.Engine.Platform.Game.RunSingleFrame()
   at Sandbox.Engine.Platform.FixedLoop.<>c__DisplayClass1.<Run>b__0()
   at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback)
   at Sandbox.Engine.Platform.Game.RunLoop()
   at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen)
   at SpaceEngineers.MyProgram.Main(String[] args)
2017-02-11 13:50:04.502 - Thread:   1 ->  InnerException: 
2017-02-11 13:50:04.502 - Thread:   1 ->  Exception occured: System.OverflowException: Error when deserializing variant uint32
2017-02-11 13:50:04.503 - Thread:   1 ->  Hiding window
2017-02-11 13:50:04.504 - Thread:  56 ->  External debugger: interrupted.
2017-02-11 13:50:04.710 - Thread:   1 ->  Network readers disposed
2017-02-11 13:50:04.915 - Thread:   1 ->  Hiding window done
2017-02-11 13:50:04.915 - Thread:   1 ->  Showing message
Zataralee commented 7 years ago

I just noticed there may be more to this. The server log has more info just before the above log from my client.

2017-02-11 13:49:55.316 - Thread:   6 ->  User left Senpai'sHolyBeyblade
2017-02-11 13:49:55.365 - Thread:   6 ->  User left MasterDabs
2017-02-11 13:49:55.375 - Thread:   6 ->  User left ShawnShepard
2017-02-11 13:49:55.383 - Thread:   6 ->  User left Thomas_McRae
2017-02-11 13:49:55.427 - Thread:   6 ->  User left Thavun
2017-02-11 13:49:55.432 - Thread:   6 ->  User left RkyMtnDude
2017-02-11 13:49:55.438 - Thread:   6 ->  User left Jake
2017-02-11 13:49:55.445 - Thread:   6 ->  User left Enderoth
2017-02-11 13:49:55.454 - Thread:   6 ->  User left zataralee
2017-02-11 13:49:55.461 - Thread:   6 ->  User left Mrs. Buttfucker
2017-02-11 13:49:55.642 - Thread:   6 ->  User left MaxMinecraft101e
2017-02-11 13:49:55.715 - Thread:   6 ->  User left Haredeenee
2017-02-11 13:50:00.233 - Thread:   6 ->  GC Memory: 2,271,153,728 B
2017-02-11 13:50:10.342 - Thread:   6 ->  Peer2Peer_ConnectionFailed 76561198059855323, Timeout
2017-02-11 13:50:11.359 - Thread:   6 ->  Peer2Peer_ConnectionFailed 76561198048505849, Timeout
2017-02-11 13:50:11.359 - Thread:   6 ->  Peer2Peer_ConnectionFailed 76561198003291273, Timeout
2017-02-11 13:50:11.359 - Thread:   6 ->  Peer2Peer_ConnectionFailed 76561198093908162, Timeout
2017-02-11 13:50:11.360 - Thread:   6 ->  Peer2Peer_ConnectionFailed 76561197994641119, Timeout
2017-02-11 13:50:11.360 - Thread:   6 ->  Peer2Peer_ConnectionFailed 76561198003175556, Timeout
2017-02-11 13:50:11.360 - Thread:   6 ->  Peer2Peer_ConnectionFailed 76561197970659169, Timeout
2017-02-11 13:50:11.360 - Thread:   6 ->  Peer2Peer_ConnectionFailed 76561198222555416, Timeout
2017-02-11 13:50:11.360 - Thread:   6 ->  Peer2Peer_ConnectionFailed 76561197989190024, Timeout

And if I go back to that same time on my client log, this is what I get...

2017-02-11 13:49:01.443 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:03.495 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:05.370 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:05.560 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:07.650 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:09.690 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:11.815 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:13.798 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:15.756 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:17.519 - Thread:   1 ->  HandleCancelTarget Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at NaniteConstructionSystem.Entities.NaniteConstructionBlock.<>c__DisplayClass75_1.<SyncCancelTarget>b__3(Object x)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at NaniteConstructionSystem.Entities.NaniteConstructionBlock.SyncCancelTarget(TargetData data)
   at NaniteConstructionSystem.Entities.NaniteConstructionManagerSync.HandleCancelTarget(Byte[] data)
2017-02-11 13:49:17.926 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:20.070 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:22.111 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:22.576 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:24.125 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:25.634 - Thread:   1 ->  GC Memory: 2,986,759,000 B
2017-02-11 13:49:26.009 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:26.105 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:28.295 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:29.353 - Thread:   1 ->  MyGuiScreenBase.UnloadContent - START
2017-02-11 13:49:29.354 - Thread:   1 ->  MyGuiScreenBase.UnloadContent - END
2017-02-11 13:49:29.400 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:30.283 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:32.320 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:34.333 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:36.064 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:36.311 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:38.355 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:40.214 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:42.254 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:42.481 - Thread:   1 ->  HandleCancelTarget Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at NaniteConstructionSystem.Entities.NaniteConstructionBlock.<>c__DisplayClass75_1.<SyncCancelTarget>b__3(Object x)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at NaniteConstructionSystem.Entities.NaniteConstructionBlock.SyncCancelTarget(TargetData data)
   at NaniteConstructionSystem.Entities.NaniteConstructionManagerSync.HandleCancelTarget(Byte[] data)
2017-02-11 13:49:42.702 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:44.238 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:46.080 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:46.178 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:48.319 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:49.339 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:50.252 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:52.265 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:52.741 - Thread:   1 ->  MyGuiScreenChat.ctor START
2017-02-11 13:49:52.741 - Thread:   1 ->  MyGuiScreenChat.ctor END
2017-02-11 13:49:54.451 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:55.692 - Thread:   1 ->  GC Memory: 2,986,032,352 B
2017-02-11 13:49:56.152 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:56.307 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:56.434 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:49:58.512 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:50:00.514 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:50:02.994 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
2017-02-11 13:50:03.494 - Thread:   1 ->  Failed to create replicable ! Type : Sandbox.Game.Replication.MyTerminalReplicable
midspace commented 7 years ago

It looks like the Nanite Construction mod actually caused the crash directly.

How much the Economy mod was involved however... We need a full copy of the server log, and a copy of the Economy server log. That will help in determining what did what to cause the Nanite Construction mod to crash.

Zataralee commented 7 years ago

Ok. Next crash I'll post the logs.

jpcsupplies commented 7 years ago

A number of people are reporting nanites as an abandoned project, it probably has several issues now. We had to drop it from our server a few months ago. It and pressurization and a few other things effect overall server performance - which hurts economy performance a lot. Never caused a crash before in any testing tho.

However in /theory/; if an economy transaction occurs while at the same time server sim has been tanked by nanites and/or pressurization, the wait for response in the server/client communication channel can cause a lock up long enough for a connection timeout as the server lacks enough sim to process the request in a timely fashion. I've seen similar effects to this on our own server when there is significant junk flying around eating into sim or there is a gun battle going on.

midspace commented 7 years ago

Question, which Nanite construction mod are you using?

Nanite Control Factory - Automated Construction http://steamcommunity.com/sharedfiles/filedetails/?id=655922051

[Works] DEV/STB 1.153 Nanite Control Factory http://steamcommunity.com/sharedfiles/filedetails/?id=781741065

Zataralee commented 7 years ago

So our sim speed isn't tanking. We don't use pressurization and our sim speed is consistently above .8 ... Check it out if you like. Server is Spokane Survivalists Society and the world is Pathfinders. The website while under construction , is Spokanesurvival.com ... The server IP is there. The nanite factory we use is NukeGuards.

Zataralee commented 7 years ago

I guess he's a dev on both. But it's this one. http://steamcommunity.com/sharedfiles/filedetails/?id=781741065

jpcsupplies commented 7 years ago

ya 655922051 is the one everyone says is abandoned. 781741065 looks to be a fork by a co-developer to get it working again