Jump to content

How to read your log files


Recommended Posts

(this a how-to, not a question - hope that's ok, or I can move this elsewhere!)
If your game is crashing or hanging, or if anything else isn't working correctly, the log files usually have the answer.  But reading them is a bit of a black art.
Where are the logs?

Spoiler

There are a number of log files:

  • ksp.log is the main log file and it can be found next to your ksp executable.  If you're on windows and have file extensions hidden, then the file will just be named "KSP" and have a type of "text document"
  • player.log is the log file created by the unity engine.  This is generally a superset of the ksp.log and has a lot of extra useless junk in it.  However, if your game is crashing to desktop, this is likely more useful than ksp.log because the last few lines of output aren't always saved in the event of a crash.  It will also have more technical details about the crash itself.  The location of the player.log file depends on your operating system:
    • windows: %USERPROFILE%\AppData\LocalLow\Squad\Kerbal Space Program\
      (copy-paste this into the address of an explorer window, or press windows key + R and paste it there)
    • mac: ~/Library/Logs/Unity/Player.log
    • linux: ~/.config/unity3d/Squad/Kerbal Space Program/Player.log
  • modulemanager.configcache is not actually a log file, but it is the configuration node database for everything in the game after ModuleManager has applied all the patches to them.  This can be useful to see how a config actually ended up when it's being loaded by the game.  This file can be found next to ModuleManager's DLL in the GameData folder. NOTE: if there are any patching errors, this file will not be created. You need to fix those first.  See the files in logs\modulemanager.
  • logs\kopernicus contains detailed information about each body that kopernicus knows about.  Often if there are problems loading a solar system with kopernicus, you can find out why in here.

What program should I use?

Spoiler

https://textanalysistool.github.io/

TextAnalysisTool is amazing for reading log files.  It has great filtering and search options, and can deal with the massive log files that KSP produces.

Some quick tips:

  • Press ctrl-N to create a filter.  Lines that don't match a filter will show up in gray
  • Press ctrl-H to toggle showing or hiding lines that don't match any filters

What should I look for?

Spoiler

If your game is crashing to desktop, you need to look at player.log and scroll to the bottom.  Untangling this mess is complicated, and I'll write some more on this topic later.

Otherwise, open ksp.log in TextAnalysisTool and use find or filters to look for these common issues:

ReflectionTypeLoadException

This is always the first thing that I search for when looking at someone's logs.  This means that a mod's DLL was compiled for an older version of KSP.  More rarely, it can mean that a DLL is missing some other mod that it has a hard dependency on.  Sometimes MechJeb or ModuleManager will intercept this exception and tell you exactly what DLL threw it.  **THIS PROBLEM MUST BE FIXED BEFORE YOU DO ANYTHING ELSE**.  A mod that has this problem will cause other mods to break because they can't iterate over all the loaded types.

Multiple ModuleManager DLLs

Many mods will bundle ModuleManager, and someone that isn't being careful can easily end up with multiple copies because they have the version number baked into the file name.  This can cause issues, especially if one of the versions is very old.  You will usually see these loaded near the top of the log file, or you can search for "won the election against" which is a string that one of the DLLs will output when it detects multiple versions.

GameData inside GameData

A common mistake is to unzip the entire contents of a mod into the GameData folder.  Many mod releases contain a GameData folder which you are supposed to merge with your own GameData folder.  You can find incorrectly installed mods if you add a filter for GameData.*GameData with regular expressions enabled:
      44 [LOG 13:28:07.864] AssemblyLoader: Loading assembly at D:\Game install\Kerbal Space Program Shared Horizons\GameData\AirplanePlus_26.5 (1)\GameData\ModuleManager.4.1.3.dll

Downloading the Source Code

If someone installs a mod from github, they occasionally download a snapshot of the branch instead of an actual release file.  If you see any source-related files indicated in the log, like .gitignore, a src folder, a -master folder, etc then this is likely what happened.

MiniAVC

This was a common bundled DLL for checking version compatibility.  However it's not compatible with newer versions of KSP and it can cause problems.  You should delete all instances of MiniAVC.dll, or install ZeroMiniAVC which will do it for you.  Details here: 

[EXC
Finally, I suggest adding this as a filter in TextAnalysisTool.  This tag will be output when exceptions are thrown.  Not every exception is a problem that needs to be fixed, but these are good places to start.
Example:


180122 [EXC 12:38:14.084] NullReferenceException: Object reference not set to an instance of an object
180123     ModuleResourceIntake.GetInfo () (at <3e135473f56a45478d738eb041ebd6cb>:0)
180124     PartLoader.CompilePartInfo (AvailablePart newPartInfo, Part part) (at <3e135473f56a45478d738eb041ebd6cb>:0)
180125     PartLoader+<CompileParts>d__56.MoveNext () (at <3e135473f56a45478d738eb041ebd6cb>:0)
180126     UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
180127     UnityEngine.DebugLogHandler:LogException(Exception, Object)
180128     ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
180129     UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)


[ERR
Like [EXC, this tag indicates an error message.  Not all errors are problems that need to be fixed, but when all else fails, look at these.
Example:
 


180094 [ERR 12:38:13.900] [ShipTemplate]: No Resource definition found for RESOURCE
180097 [ERR 12:38:13.906] Module ModuleEngines threw during OnLoad: System.NullReferenceException: Object reference not set to an instance of an object
180098   at ModuleEngines.SetupPropellant () [0x000a4] in <3e135473f56a45478d738eb041ebd6cb>:0 
180099   at ModuleEngines.OnLoad (ConfigNode node) [0x000d7] in <3e135473f56a45478d738eb041ebd6cb>:0 
180100   at PartModule.Load (ConfigNode node) [0x001ab] in <3e135473f56a45478d738eb041ebd6cb>:0 

 


B9PartSwitch Errors

Spoiler

Usually this is caused by missing dependencies of some mod, or using mods that aren’t compatible with each other. Sometimes it’s an unknown bug caused by having a certain combination of mods together (that is, something that is functionally incompatible but not intentionally incompatible, and you may be able to fix it/get the mod creator to fix it)

1. Open KSP.log in TextAnalysisTool
2. add a filter with the tank type name that’s missing and hide non-matches
3. Read the list of filtered lines..did this tank type exist, and then something removed it? Was it conditional based on some other mod existing? Did it just never exist?  Etc.
4. Remove the filters and find the error message
5. Figure out what part it was compiling at the time
6. Create a filter with that part name and hide things that don’t match the filter
7. Grab all the lines that involve “applying patch” or similar and save these somewhere - this is the list of patches that affected the part 
8. Open each of those patches and figure out which one added the tank subtype
9. Look at the patch’s needs/etc clauses and figure out what interrelationships might have been involved
10. Read that mod’s documentation - does it have dependencies you’re missing?  Are they up to date?  Does it list any mods that are not compatible? Etc.

 

...more to come...

 

Edited by JonnyOThan
Link to comment
Share on other sites

  • 7 months later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...