Space Engineers

Space Engineers

[OBSOLETE] Planetary Cargo Ships
Crash on DS
Happened upon spawning in a respawn ship.
The DS is running Torch, but it looks like it was inside of ModAPI.

21:59:10.6865 [FATAL] Torch: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Sandbox.ModAPI.Interfaces.TerminalPropertyExtensions.Cast[TValue](ITerminalProperty property)
at MeridiusIX.PlanetaryCargoShips.PrefabSpawningWatcher()
at MeridiusIX.PlanetaryCargoShips.UpdateBeforeSimulation()
at Sandbox.Game.World.MySession.UpdateComponents()
at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime)
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 VRage.Dedicated.DedicatedServer.RunInternal()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Torch.Server.TorchServer.Start()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Last edited by PhoenixTheSage; 22 Aug, 2017 @ 7:16pm
< >
Showing 1-13 of 13 comments
Meridius_IX / Lucas  [developer] 23 Aug, 2017 @ 7:21am 
Howdy,

Was this a one-off crash, or has it happened multiple times? From what you posted, it looks like its a null reference somewhere, but I'm having a tough time seeing where it could be.
PhoenixTheSage 23 Aug, 2017 @ 12:08pm 
It was repeatable, yes. Happened a few seconds after anytime a player would select a respawn ship and spawn over a planet with that prefab. So I assume it was checking whether or not the prefab they spawned in was a cargo ship?
Last edited by PhoenixTheSage; 23 Aug, 2017 @ 12:09pm
Meridius_IX / Lucas  [developer] 23 Aug, 2017 @ 1:51pm 
Very odd. The method that appears in your error report only runs when a cargo ship is spawning (it's not running at all times).

Regardless, I added some extra precautionary stuff in there to see if we can tackle the issue, those changes should be live now. Give it another shot and let me know if you run into it again!
PhoenixTheSage 23 Aug, 2017 @ 2:48pm 
Alright thanks, will do in a bit.
PhoenixTheSage 23 Aug, 2017 @ 8:17pm 
So, it doesn't crash on non-DS hosted multiplayer (didn't before the update either). After you added whatever checks you did, it didn't crash immediately on player spawn.

However, after some time the event triggered again and here was the only output:

2017-08-23 23:11:27.449 - Thread: 10 -> Planetary Cargo Ships: Atmospheric Cargo Ship Spawning Started. Next Spawning Event Starts in 335 Seconds.
2017-08-23 23:11:27.459 - Thread: 10 -> Planetary Cargo Ships: No Custom Faction Detected for SpawnGroup. Faction assigned to SPRT
2017-08-23 23:11:27.460 - Thread: 10 -> Planetary Cargo Ships: Atmospheric Cargo Ship Prefab ::(NPC-ATM) Transport Courier:: Is Being Spawned.
2017-08-23 23:11:27.461 - Thread: 10 -> Planetary Cargo Ships: Spawning Coordinates: GPS:SpawningCoords:379905.546474622:-152825.111443508:-823420.689538211:
2017-08-23 23:11:27.461 - Thread: 10 -> Planetary Cargo Ships: Despawning Coordinates: GPS:DespawningCoords:388376.92096959:-142559.259896961:-821373.325421804:
2017-08-23 23:11:27.584 - Thread: 10 -> Clusters reordered
2017-08-23 23:11:27.804 - Thread: 10 -> Network readers disposed
2017-08-23 23:11:27.808 - Thread: 10 -> Logging off Steam...
2017-08-23 23:11:27.808 - Thread: 10 -> Shutting down server...
2017-08-23 23:11:27.848 - Thread: 10 -> Done


Edit: Got this further up in the log right after the world finished loading -
2017-08-23 23:04:09.390 - Thread: 10 -> No definition 'MyObjectBuilder_GlobalEventBase/SpawnAtmoCargoShip'. Maybe a mistake in XML?

Funny, since it works fine on hosted multiplayer...just not the DS.
Last edited by PhoenixTheSage; 23 Aug, 2017 @ 8:32pm
PhoenixTheSage 23 Aug, 2017 @ 9:36pm 
Hmm, nevermind, I got the server started again after some socket trouble and all seems well now. It may have crashed this time due to a lost of binding to Steam. Will still keep an eye out. I guess it's safe to ignore the XML error, the ships are spawning fine so far now. Whatever catches you put in place seem to be working.

Thanks a lot dude, mod is great especially with the distant atmospheric sounds mod. Really adds to the immersion.
Meridius_IX / Lucas  [developer] 24 Aug, 2017 @ 9:55am 
Good to hear it's working so far!

That XML error should be harmless too. The reason it appears is because the mod looks for a custom GlobalEvent to handle separate Spawn Timings of the Atmo Cargo Ships (if you wanted the spawns to occur at different timings than the Space Cargo Ships). For Air Traffic, I decided to just use the same timings as found in Space.

I hadn't heard about the Distance Atmospheric Sounds mod, but from what I've seen in the preview, it looks (or sounds) awesome!
PhoenixTheSage 24 Aug, 2017 @ 3:49pm 
Sorry, looks like it's still happening :)
Just had a user repeatedly crash the server with the same error while I was away...

17:23:21.6551 [INFO] MultiplayerManager: Player superanchors joined (76561198001998943)
17:29:45.9538 [FATAL] Torch: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Sandbox.ModAPI.Interfaces.TerminalPropertyExtensions.Cast[TValue](ITerminalProperty property)
at MeridiusIX.PlanetaryCargoShips.PrefabSpawningWatcher()
at MeridiusIX.PlanetaryCargoShips.UpdateBeforeSimulation()
at Sandbox.Game.World.MySession.UpdateComponents()
at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime)
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 VRage.Dedicated.DedicatedServer.RunInternal()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Torch.Server.TorchServer.Start()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Meridius_IX / Lucas  [developer] 24 Aug, 2017 @ 5:27pm 
I tried adding a 15 second timeout to the Method that keeps coming up. The only guess I have left is maybe something with Torch is not playing nicely when ships try to spawn (maybe concealment of grids or something along those lines).

Let me know if this update makes any difference for ya. If you still get a crash, see if you can include any log events from the mod as well - even if they're from a while before. If a timeout is triggered, it should note that on the log as well.
PhoenixTheSage 24 Aug, 2017 @ 5:43pm 
Alright, I'll also try to talk to Jim about it..
billw 25 Sep, 2017 @ 12:33pm 
I also have this issue running via torch. I started single player and it was fine, however moving that game to my dedicated server and now I get that exact call stack always 10 seconds after spawning in. I will try disable concealment.
XG 29 Sep, 2017 @ 3:57am 
happend on me too
Meridius_IX / Lucas  [developer] 30 Sep, 2017 @ 12:09pm 
Sorry I've been silent on this. I've been working on a rewrite of the entire spawning system for this mod to get it to be as efficient as possible.

Should be released sometime in the near future.
< >
Showing 1-13 of 13 comments
Per page: 1530 50