midspace / midspace/Space-Engineers-Admin-script-mod

Exception when creating Permissions file.

Open
#135 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
43
Forks
12
PR merge metrics
No merged PRs in 30d

Description

This is exception shows when starting up and creating the permissions file.
Not reading.
I can't reproduce this, not without perhaps more details from the rest of the log, like Localization.

Wolverine:
2015-12-06 15:32:30.244 - Thread:   1 ->  Exception occured: System.InvalidOperationException: There was an error generating the XML document. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.XSArrayInfo.get_Item(Object a, Int32 i)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.Write6_Permissions(String n, String ns, Object o, Boolean needType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.Write7_Permissions(Object o)
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
   at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces)
   at Sandbox.ModAPI.MyAPIUtilities.Sandbox.ModAPI.IMyUtilities.SerializeToXML[T](T objToSerialize)
   at midspace.adminscripts.ServerConfig.SavePermissionFile(String customSaveName)
   at midspace.adminscripts.ServerConfig.LoadOrCreatePermissionFile()
   at midspace.adminscripts.ServerConfig..ctor(List`1 commands)
   at midspace.adminscripts.ChatCommandLogic.InitServer()
   at midspace.adminscripts.ChatCommandLogic.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.FixedLoop.<>c__DisplayClass2.<Run>b__1()
   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.RunInternal(String[] args)
   at SpaceEngineers.MyProgram.Main(String[] args)
2015-12-06 15:32:30.244 - Thread:   1 ->  InnerException:
2015-12-06 15:32:30.244 - Thread:   1 ->  Exception occured: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.XSArrayInfo.get_Item(Object a, Int32 i)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.Write6_Permissions(String n, String ns, Object o, Boolean needType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.Write7_Permissions(Object o)
2015-12-06 15:32:30.247 - Thread:   1 ->  Hiding window
2015-12-06 15:32:30.248 - Thread:   1 ->  Network readers disposed
2015-12-06 15:32:31.031 - Thread:   1 ->  Hiding window done
2015-12-06 15:32:31.031 - Thread:   1 ->  Showing message

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ServerConfig.LoadOrCreatePermissionFile() and SavePermissionFile(), then inspect the Permissions serialization path shown in the stack trace. Reproduce startup with the relevant localization and remaining log details if possible; done means the permissions file is created without the XmlSerializer or NullReferenceException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.