Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUPPORT page for PwdIsNotOrigin Fatal Error. #12

Open
Lisias opened this issue Apr 7, 2021 · 19 comments
Open

SUPPORT page for PwdIsNotOrigin Fatal Error. #12

Lisias opened this issue Apr 7, 2021 · 19 comments
Assignees
Labels
support support (no bug)

Comments

@Lisias
Copy link
Collaborator

Lisias commented Apr 7, 2021

If you reach this page, something (probably your OS's Shell or a custom Launcher) has called KSP on a weird way.

Screen Shot 2021-04-06 at 22 22 40

A thingy called "Current Working Directory" (pwd on Unices) must be set to the same directory where your KSP.exe or KSP.app (or whatever is called the executable that starts KSP), but on your rig this didn't happened.

Since this is not related to any Add'On, but to something wrong on your rig, there's no dedicated Thread to support you on this problem so I created this Issue for this task.

Please provide your KSP.log as instructed here. I will also need to know your OS and how you summoned KSP, so we can diagnose your launcher/shell.

You can, alternatively, open a Question on Forum but please remember to mention @Lisias or I will miss your post!!

Screen Shot 2021-04-06 at 22 25 10

@Lisias
Copy link
Collaborator Author

Lisias commented Apr 7, 2021

@njsilvadyne
Copy link

njsilvadyne commented Apr 11, 2021

KSP.log
I'm running windows 10 and launching KSP through CKAN. I installed an experimental version of module manager and it said I needed this as a dependency, but as soon as I installed it I've had this error come up constantly, stopping me from playing the game. However, the game seems to launch normally when I start it up through steam.

@Lisias
Copy link
Collaborator Author

Lisias commented Apr 11, 2021

Hi, @NamedomRan .

On at first glance, what's apparently is happening is that CKAN's is not setting the Current Directory on the same place where the KSP.exe is, otherwise this error would not had happened.

HOWEVER...

This is what your log gives me:

[LOG 14:38:26.480] [KSPe] Fatal Error PwdIsNotOrigin was shown. pwd = c:\program files (x86)\steam\SteamApps\common\Kerbal Space Program\ ; origin = C:\Program Files (x86)\Steam\steamapps\c
ommon\Kerbal Space Program\ . Please visit https://github.com/net-lisias-ksp/KSPAPIExtensions/issues/12

I forgot that paths are case insensitive on Windows. (sigh). I will need to rework this piece of code.

In the mean time, please use the Latest (real) Release, https://github.com/net-lisias-ksp/KSPAPIExtensions/releases/tag/RELEASE%2F2.2.3.0 .

The releases that launch this are all Pre Releases, so I expect this to fix your issue on the short run. I will fix this bug and I will issue a new KSPe release in the next few hours.

@Lisias
Copy link
Collaborator Author

Lisias commented Apr 11, 2021

@NamedomRan , a new PreRelease with this issue handled out is available at:

https://github.com/net-lisias-ksp/KSPAPIExtensions/releases/tag/PRERELEASE%2F2.3.0.2

However, keep in mind that Pre Releases are exactly what the name says: Pre Releases, not ready to be used on "Production". Unless you are willing to help me on ironing out mishaps on KSPe, you will be probably best served using a proper Release, currently:

https://github.com/net-lisias-ksp/KSPAPIExtensions/releases/tag/RELEASE%2F2.2.3.0

Nothing on my net-lisias-ksp hierarchy relies on Beta Releases (unless they are Beta Release themselves)

Cheers!

@Nightsbane520
Copy link

Nightsbane520 commented Jul 5, 2021

Hi @Lisias, I am running windows 10 atm and have been trying to get mods to work with CKAN and I am stumped can you help me? I have a lot of mods so I am not quite sure what's going wrong.
KSP.log

@Lisias
Copy link
Collaborator Author

Lisias commented Jul 7, 2021

Whoopsy, sorry the late answer @Nightsbane520 - my machine had a disk crash, I'm using an older spare one with no email client, so I missed the notification of your question.

I detected two problems on your GameData:

  1. MiniAVC. Please, remove all MiniAVC.dll from your rig. Every single one of them.
  2. Interstellar is borking due Reflection Errors.

Fixing them is simple. For 1, use the Windows Explorer and search for all files named "MiniAVC.dll" and them delete these damned things.

For the 2, the problem is that you are using a too much recent Interstellar version. You are using KSP 1.7.2 (any reason not to use the 1.7.3? There're some important bug fixes on it) but your Interstellar binary was compiled to use Unity 2019, present only on KSP 1.8.0 and newer.

Go to SpaceDock (using this link), click on 'Change Log", and scroll down until you find the text "Version 1.25.11.1 for Kerbal Space Program 1.7.3" . Click on the Download Link from it. (try this link, but I'm unsure it will work).

You will want too to use the most recent TweakScale, as it works fine on 1.7.3 (I still play on 1.7.x too!!) and have important improvements.

https://github.com/net-lisias-ksp/TweakScale/releases

You should remove the old GameData/TweakScale from your rig and install the new one after installing Interstellar.

Let me know if it works for you.

Cheers!

@Nightsbane520
Copy link

Nightsbane520 commented Jul 8, 2021

@Lisias Sorry for the late response as well. Thank you for responding I'll try it out now!

@Nightsbane520
Copy link

Nightsbane520 commented Jul 8, 2021

@Lisias It Worked Thank you so much! I'm also wondering how to get planet shine to work?

@Lisias
Copy link
Collaborator Author

Lisias commented Sep 24, 2021

@Lisias It Worked Thank you so much! I'm also wondering how to get planet shine to work?

Sorry, @Nightsbane520 , but planet shine is out of scope of this issue. Do you have an account on Forum? We can try to figure it out there, usually other people with the same problem will be engaged - and it raises the chances of finding an answer. Ping me there (my name there is the same as here, @Lisias ).

(and sorry for being so late on this answer, since it was out of scape, at that time I decided to answer it later due pressuring things on RL, and.. .well, I forgot. :( )

@StevenLi-phoenix
Copy link

@Lisias

MacOSX System
MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports)
2 GHz 4core Intel Core i5
16 GB 3733 MHz LPDDR4X
Intel Iris Plus Graphics 1536 MB

Only modify to app package and changed the names to Chrome to pretend that it is an eduacation application. while This happens.
What I modified and what's original.(.bk is orginal)
modified.zip

PWD not match ERROE

Between last changes I download CKSP and Mono environment on MacOSX.

Then I install a bunch of mods like mj2 and TS and BD ...
And This happend.

LOG:
KSP.log

@StevenLi-phoenix
Copy link

Noting wrong NOW!!!
This failure occure when I accidently move TweakScale to ./ksp.app/Resource/Data/GameDate.

I had not properly install TweakScale and all the mods are messed up.
Thus KSP told me that I should move the mod TWEAKSCALE to ksp.app/Resource/Data/GameData.
What I found is that there is not a dictonary called Gamedata.
so I create it.
And move mods in.

While After a few month I found CKSP for as a better installer for mods. So, I delete all mods but forget to delete this one.
Which cause a miss match of pwd problem.
Also why ask people to install mods in ksp.app/contents/Resource/Gamedata/ folder?
The pwd is also confusing: ksp.app/contents/Resource/../../Gamedata ?

@Lisias

@Lisias
Copy link
Collaborator Author

Lisias commented Sep 28, 2021

Hi, @StevenLi-phoenix !

This is not exactly a bug on KSP neither TweakScale, but it ended up being TweakScale that detected the bork.

This is what happens:

When you launch an Application from the UI, the Finder/WindowsExplorer/GnomeDesktop/whatever must set a thingy called current directory (pwd on unix) before launching the application binary.

On MacOS, the pwd must be the same place where KSP.app is. On Windows, where KSP.EXE is, etc. And the application relies on this in order to work fine.

If the pwd is set to anywhere else, EVERYTHING will loose track of the KSP's root directory, and so everything will have the pathnames messed up! And so TweakScale, that needs things perfectly matched otherwise the patches will fail (and then the savegames will be corrupted), yells about the problem.

One way to really mess things up (don't do it on a KSP where you have valiuable savegames) is to open your terminal and:

cd ~/whatever/your/KSP/is
cd KSP.app/Contents/MacOS
./KSP

This will fire up KSP with the PWD set to inside the APP folder, and you will have problems like you had before.

To exemplify how things should be done, the following commends will fire uo KSP from the terminal correctly:

cd ~/whatever/your/KSP/is
./KSP.app/Contents/MacOS/KSP

See the diference? On this second set of commands, the current directory is set to where it must be , on this example ~/whatever/your/KSP/is .

On the previous, WRONG way, the pwd would be set to ~/whatever/your/KSP/is/KSP.app/Contents/MacOS and things will get horribly screwed up.

@maxiking01
Copy link

HI @Lisias !
I've got problem o Fedora 35 x64. I have laptop with Optimus graphics (integrated + discrete). Integrated is Intel and discrete one is GeForce 1060. When I've got enabled Optimus I run KSP by clicking its icon and select run discrete GPU. Beneath it is using prefix " __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia" game exe. When I launch error in log appears.
KSP log Optimus active.zip

However when I launch game only on discrete GPU( my laptop has such ability) and click on game's icon, KSPAPIExtensions searches through whole filesystem and crashes on accessing to restricted folder.
KSP log run on discreete GPU.zip

@Lisias
Copy link
Collaborator Author

Lisias commented Dec 8, 2021

Hi, @maxiking01 .

Sorry to be the source of your troubles. There's something different than what I used to get on your Distro, and I probably was too naive on some critical code - otherwise you would not had this problem.

I'm investigating your logs.

@Lisias
Copy link
Collaborator Author

Lisias commented Dec 8, 2021

Oukey. The first problem is easy:

[EXC 21:22:08.500] IsolatedStorageException: partialPathname cannot have relative paths leading outside the sandboxed file system! [Gry/Kerbal Space Program/Gry/K
erbal Space Program/GameData/DistantObject/Plugins/PluginData]
        KSPe.IO.Hierarchy.Calculate (System.Boolean createDirs, System.String fname, System.String& partialPathname, System.String& fullPathname) (at <9f7cd9a5291
94dc4a60f3cf218f8503b>:0)
        KSPe.IO.Hierarchy.SolveFull (System.Boolean createDirs, System.String fname, System.String[] fnames) (at <9f7cd9a529194dc4a60f3cf218f8503b>:0)
        KSPe.Util.SystemTools+Assembly+Loader`1[T].TryPath (System.String path, System.String[] subdirs) (at <9f7cd9a529194dc4a60f3cf218f8503b>:0)
        KSPe.Util.SystemTools+Assembly+Loader`1[T]..ctor (System.String[] subdirs) (at <9f7cd9a529194dc4a60f3cf218f8503b>:0)
        DistantObject.Startup.Awake () (at <e30ec9083ad44f3d8c362bd51ed054ea>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.GameObject:AddComponent(Type)
        AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
        AddonLoader:StartAddons(Startup)
        <LoadObjects>d__90:MoveNext()
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        <CreateDatabase>d__71:MoveNext()
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        GameDatabase:StartLoad()
        <LoadSystems>d__11:MoveNext()
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        LoadingScreen:Start()

This happens when the current directory is set to outside the KSP running directory. On Linux and other UNICEs, when you launch a program from the Desktop the program is ran using the current directory, and not the directory where the executable is (what's completely different from Windows, where the O.S. sets the current directory to the same place where the EXE is). This happens because on UNIX the current directory is meaningful - you can run different programs on the same set of data by setting the current directory to your data, and then clicking the programs to be run, without the need to set the directory each time as we need to do on Windows.

The way to fix this is to set the properties of the launch icons and tell it to ser the current directory to be one where the executable is.

KSPe yells on the problem because when then current directory is set to any other place then the directory where the KSP executable is, a lot of add'ons will try to read and write data on the wrong places - at best, they will not work and at worse, you will lose data.

I will check the second log now.

@Lisias
Copy link
Collaborator Author

Lisias commented Dec 8, 2021

About your second log, this is the real deal. You found a problem on KSPe - to tell you the true, you found a problem on Mono's runtime library, KSPe is only the trigger for it here...

[LOG 20:49:35.839] [AddonLoader]: Instantiating addon 'Startup' from assembly 'DistantObject'
[EXC 20:49:41.098] UnauthorizedAccessException: Access to the path '/home/dkrol/.local/share/Steam/steamapps/compatdata/1493710/pfx/dosdevices/z:/boot/efi' is denied.
        System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) (at <9577ac7a62ef43179789031239ba8798>:0)
        System.IO.FileSystemEnumerableIterator`1[TSource].HandleError (System.Int32 hr, System.String path) (at <9577ac7a62ef43179789031239ba8798>:0)
        System.IO.FileSystemEnumerableIterator`1[TSource].AddSearchableDirsToStack (System.IO.Directory+SearchData localSearchData) (at <9577ac7a62ef43179789031239ba8798>:0)
        System.IO.FileSystemEnumerableIterator`1[TSource].MoveNext () (at <9577ac7a62ef43179789031239ba8798>:0)
        System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) (at <9577ac7a62ef43179789031239ba8798>:0)
        System.IO.Directory.InternalGetFileDirectoryNames (System.String path, System.String userPathOriginal, System.String searchPattern, System.Boolean includeFiles, System.Boole
an includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <9577ac7a62ef43179789031239ba8798>:0)
        System.IO.Directory.InternalGetDirectories (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) (at <9577ac7a62ef43179789031239ba8798>:0)
        System.IO.Directory.GetDirectories (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) (at <9577ac7a62ef43179789031239ba8798>:0)
        KSPe.IO.Path.Origin () (at <9f7cd9a529194dc4a60f3cf218f8503b>:0)
        KSPe.Util.Installation.CheckForWrongDirectoy (System.Type type, System.String name, System.String folder, System.String vendor) (at <9f7cd9a529194dc4a60f3cf218f8503b>:0)
        KSPe.Util.Installation.Check[T] (System.String name, System.String folder, System.String vendor, System.Boolean unique) (at <9f7cd9a529194dc4a60f3cf218f8503b>:0)
        KSPe.Util.Installation.Check[T] (System.Type versionClass, System.Boolean unique) (at <9f7cd9a529194dc4a60f3cf218f8503b>:0)
        KSPe.Util.Installation.Check[T] (System.Boolean unique) (at <9f7cd9a529194dc4a60f3cf218f8503b>:0)
        KSPe.Util.Installation.Check[T] () (at <9f7cd9a529194dc4a60f3cf218f8503b>:0)
        DistantObject.Startup.Awake () (at <e30ec9083ad44f3d8c362bd51ed054ea>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.GameObject:AddComponent(Type)
        AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
        AddonLoader:StartAddons(Startup)
        <LoadObjects>d__90:MoveNext()
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        <CreateDatabase>d__71:MoveNext()
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        GameDatabase:StartLoad()
        <LoadSystems>d__11:MoveNext()
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        LoadingScreen:Start()

This is problematic because a lot of my add'ons rely on this code to make sure things are thigh (KSP-Recall and TweakScale are also borking on this… damn).

I will need some time to tackle this down, day job is bitting hard (sorry).

In the mean time, I think that moving the Kerbal Space Program from the steam folder directly into a folder on your home will work around this.

Since this is a bug on the mono's runtime and not on KSPe, I can't tell you how much time I will need to fix this - I will need to find a workaround for this MS's blunder….

@maxiking01
Copy link

Hi! Regarding the error. I ran KSP from command line but before that I navigated to KSP folder. For both situations (on enabled Optimus and discrete GPU) the game started properly. Now I have to update shortcut to change current directory before starting KSP ... . Thanks for help!

@StevenLi-phoenix
Copy link

Hi, @StevenLi-phoenix !

This is not exactly a bug on KSP neither TweakScale, but it ended up being TweakScale that detected the bork.

This is what happens:

When you launch an Application from the UI, the Finder/WindowsExplorer/GnomeDesktop/whatever must set a thingy called current directory (pwd on unix) before launching the application binary.

On MacOS, the pwd must be the same place where KSP.app is. On Windows, where KSP.EXE is, etc. And the application relies on this in order to work fine.

If the pwd is set to anywhere else, EVERYTHING will loose track of the KSP's root directory, and so everything will have the pathnames messed up! And so TweakScale, that needs things perfectly matched otherwise the patches will fail (and then the savegames will be corrupted), yells about the problem.

One way to really mess things up (don't do it on a KSP where you have valiuable savegames) is to open your terminal and:

cd ~/whatever/your/KSP/is
cd KSP.app/Contents/MacOS
./KSP

This will fire up KSP with the PWD set to inside the APP folder, and you will have problems like you had before.

To exemplify how things should be done, the following commends will fire uo KSP from the terminal correctly:

cd ~/whatever/your/KSP/is
./KSP.app/Contents/MacOS/KSP

See the diference? On this second set of commands, the current directory is set to where it must be , on this example ~/whatever/your/KSP/is .

On the previous, WRONG way, the pwd would be set to ~/whatever/your/KSP/is/KSP.app/Contents/MacOS and things will get horribly screwed up.

While what I had done is naviagte to ~WhereMyKSPIs/ in folder and open it using double click. I understand my question and the answer. Thanks for replying my issue.

Also, on MacOS do open command mess up with current pwd settings?

like:

cd WhereMyKSP~IS/
open KSP.app

@Lisias
Copy link
Collaborator Author

Lisias commented Dec 8, 2021

About my last statement:

Since this is a bug on the mono's runtime and not on KSPe, I can't tell you how much time I will need to fix this - I will need to find a workaround for this MS's blunder….

Yeah, it's kinda a bug - screwing up all the traversing because a access error on some inner directory should be something System.IO.Directory.GetDirectories should allow us to do. But the workaround is simple enough (this stunt is bitting a lot of people around the Globe, this is already solved a dozen times).

So the next release of everything will have this fixed: https://github.com/net-lisias-ksp/KSPAPIExtensions/issues/21

@maxiking01 ,

Hi! Regarding the error. I ran KSP from command line but before that I navigated to KSP folder. For both situations (on enabled Optimus and discrete GPU) the game started properly. Now I have to update shortcut to change current directory before starting KSP ... . Thanks for help!

Nevertheless, the next release of TweakScale and DOE (that you are using) will have this fixed, so you will have the option to move it back to Steam if you want - but I think it's a bad idea allow Steam to manage a modded installment!

Welcome!

@StevenLi-phoenix ,

While what I had done is naviagte to ~WhereMyKSPIs/ in folder and open it using double click. I understand my question and the answer.

So perhaps you have the same problem as maxiking01? Are you using Steam?

Thanks for replying my issue.

Welcome!!

Also, on MacOS do open command mess up with current pwd settings?

like:

cd Where-My-KSP-IS
open KSP.app

Nope, it wont mess up. This will work, including on a shell executable file.

I start my Testing Bed this way:

#!/usr/bin/env bash

KSP_DEV=/Users/lisias/Workspaces/KSP/runtime/$1/
export MONO_THREADS_PER_CPU=1

echo "Running ${KSP_DEV}"
cd ${KSP_DEV}
open ${KSP_DEV}/KSP.app

So I can fire up a specific KSP from any place on the command line.

I think that open will set automatically the current directory for you (I think I remember a shell file without the cd command where it worked, but I'm not 100% sure).

Cheers for all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support support (no bug)
Projects
None yet
Development

No branches or pull requests

5 participants