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

Strange missing redistributable VC++ runtime error #2297

Closed
kc9jud opened this issue Aug 24, 2019 · 16 comments · Fixed by #2325
Closed

Strange missing redistributable VC++ runtime error #2297

kc9jud opened this issue Aug 24, 2019 · 16 comments · Fixed by #2325
Assignees
Labels
Milestone

Comments

@kc9jud
Copy link

kc9jud commented Aug 24, 2019

Possibly related: #1790 and #1066

I'm getting odd errors about the Visual C++ Redistributable Packages not being found -- I can clearly see in Apps & features that it's installed:

image

However, I'm getting the following errors in KSP.log:

[LOG 02:21:38.443] [UIMasterController]: HideUI
[LOG 02:21:38.857] Loading Depletion Nodes
[LOG 02:21:38.857] DepNodeCount:  0
[LOG 02:21:38.857] Loading Biome Nodes
[LOG 02:21:38.857] BiomeNodeCount:  0
[LOG 02:21:38.857] Loading Planet Nodes
[LOG 02:21:38.857] PlanetNodeCount:  0
[LOG 02:21:38.868] [ScenarioDestructibles]: Loading... 0 objects registered
[EXC 02:21:38.902] DllNotFoundException: GameData/Principia/x64/principia.dll
	principia.ksp_plugin_adapter.Log.InitGoogleLogging ()
	principia.ksp_plugin_adapter.Loader.LoadPrincipiaDllAndInitGoogleLogging ()
	UnityEngine.Debug:LogException(Exception)
	principia.ksp_plugin_adapter.Loader:LoadPrincipiaDllAndInitGoogleLogging()
	principia.ksp_plugin_adapter.PrincipiaPluginAdapter:.ctor()
	UnityEngine.GameObject:AddComponent(Type)
	ScenarioRunner:AddModule(String)
	ScenarioRunner:AddModule(ConfigNode)
	ProtoScenarioModule:Load(ScenarioRunner)
	ScenarioRunner:LoadModules(List`1)
	ScenarioRunner:SetProtoModules(List`1)
	Game:Load()
	<Start>c__Iterator0:MoveNext()
	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
[ERR 02:21:38.902] The Principia DLL failed to load.
Dependencies, namely the Visual C++ Redistributable Packages for Visual Studio 2017 on x64, were not found.

[ERR 02:21:39.016] Exception loading ScenarioModule PrincipiaPluginAdapter: System.DllNotFoundException: GameData/Principia/x64/principia.dll
  at (wrapper managed-to-native) principia.ksp_plugin_adapter.Interface:SetBufferedLogging (int)
  at principia.ksp_plugin_adapter.Log.SetBufferedLogging (Int32 max_severity) [0x00000] in <filename unknown>:0 
  at principia.ksp_plugin_adapter.MainWindow.Load (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at BaseFieldList.Load (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at ScenarioModule.Load (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at ScenarioRunner.AddModule (.ConfigNode node) [0x00000] in <filename unknown>:0 

System info:
Windows 10, build 1803
KSP Version 1.7.3.2594

@pleroy pleroy added the bug label Aug 24, 2019
@pleroy pleroy self-assigned this Aug 24, 2019
@pleroy pleroy added this to the del Ferro milestone Aug 24, 2019
@pleroy
Copy link
Member

pleroy commented Aug 24, 2019

I suspect that your installation is broken somehow. The following message is telling us that Windows is failing to load the DLL, which might indicate that the file is corrupted, or a permission problem, or some other badness:

[EXC 02:21:38.902] DllNotFoundException: GameData/Principia/x64/principia.dll

When such an error happens, we try to see if the Visual C++ Redistributable is properly installed, and that check doesn't work anymore with the unified 2015-2019 redistributable. I am fixing it, but the effect will be that the message will change to "An unknown error occurred".

You should also have gotten a modal window reporting the error, which would be nicer than having to dig through the logs. Apparently that stopped working a few months back. I am fixing it too.

@kc9jud
Copy link
Author

kc9jud commented Aug 24, 2019

I actually did see the modal window, but I went digging through the log to see if I could find anything useful.

I've just done a "fresh install" of sorts -- I've deleted the entire GameData/Principia directory and re-extracted it from a fresh download, but the problem persists. Is there any chance you could give me a SHA1 or SHA256 for a known good GameData/Principia/x64/principia.dll?

@kc9jud
Copy link
Author

kc9jud commented Aug 24, 2019

Is there a blacklist of DLLs somewhere? I accidentally tried to launch 1.7.3 with Fermat a few times (causing obvious crashes) before I realized that KSP had updated and I needed to update to Ferrari. Could principia.dll have been added to such a blacklist?

@eggrobin
Copy link
Member

eggrobin commented Aug 24, 2019

[A bunch of attempts at getting it to work] but the problem persists

Again, possibly an issue with file permissions?

Is there any chance you could give me a SHA1 or SHA256 for a known good GameData/Principia/x64/principia.dll?

There is an MD5 and SHA1 for the archive on the forum thread (and yes, MD5 is insecure and SHA1 is not ideal, but if someone is in the business of constructing collisions and then messing with bit.ly to make you believe that you downloaded a different version of Principia from the one you got, you have much bigger fish to fry).

I accidentally tried to launch 1.7.3 with Fermat a few times (causing obvious crashes) [...] Is there a blacklist of DLLs somewhere [...] Could principia.dll have been added to such a blacklist?

I don't think the KSP developers have time to waste building such mechanisms. We experience crashes all the time while developing (that is the point of having checks), so they obviously have no long-term consequences, and, in general, Principia Ferrari works with the versions of KSP that it targets (people are using it).

@kc9jud
Copy link
Author

kc9jud commented Aug 26, 2019

Permissions are an unlikely problem -- they seem to be normal, and running KSP as an administrator doesn't fix anything. I'm really stumped as I can see KSP try to load it directly (BadImageFormatException). Any ideas other than permissions?

@pleroy
Copy link
Member

pleroy commented Aug 26, 2019

I think we'll need more information to figure out what's happening. It would be good if you could:

  1. Download and install Process Monitor from the Microsoft site.
  2. Start it.
  3. Start KSP.
  4. Use the Process menu in Process Monitor to filter Process Name contains KSP.
  5. Save the events in a file and send it to us.

@kc9jud
Copy link
Author

kc9jud commented Aug 28, 2019

@pleroy Thanks, I'll do that. I probably won't be able to get to it until this weekend, however.

@kc9jud
Copy link
Author

kc9jud commented Aug 31, 2019

@pleroy
Copy link
Member

pleroy commented Aug 31, 2019

We found something puzzling in these logs. One of our DLLs is named libprotobuf.dll. It appears that when searching for that DLL it finds:

C:\Program Files\NVIDIA Corporation\NvContainer\libprotobuf.dll

Obviously we have no reason to believe that the Nvidia DLL and ours are compatible in any way. While I have Nvidia software on my machine I don't have NvContainer (whatever that is) so that would explain why it works for me.

We'll keep investigating.

@ghost
Copy link

ghost commented Sep 4, 2019

AFAIK, NvContainer.exe is Geforce Experience.

@pleroy
Copy link
Member

pleroy commented Sep 5, 2019

@kc9jud: I have created a new binary, principia test for 1.7.3.zip, which is expected to fix this problem. Since the bug only shows up on your machine, could you please try it and report? Thanks.

@Erumaaro
Copy link

Erumaaro commented Sep 8, 2019

Hello.
I just had a similar problem:

KSP 1.7.3 (x64),
Principia del ferro,
VC++ 14.22.27821 x86 freshly installed
on W7 ultimate x64,
Geforce Experience running in the background:
-> Principia dll couldn't load, dependency missing: VC++ 14.22.27821 x86 ... (╯°□°)╯︵ ┻━┻

What i did afterwards:
I uninstalled all other VC++ versions, and installed these "hotfixes"? for both the x86 and x64 version of VC++ 14.22.27821.
Now principia loads just fine. ¯\__(ツ)_/¯

I hope any of this is potentially helpfull.
Regards.

@ghost
Copy link

ghost commented Sep 8, 2019

@pleroy I was having the same problem, using the version you provided fixed it, thanks.

@pleroy
Copy link
Member

pleroy commented Sep 9, 2019

@Erumaaro: It seems that in some cases our error message incorrectly mentions the x86 runtime. You actually need the x64 one.
@breach-candy: Thanks for reporting; I am going to assume that this problem is fixed for good now.

@kc9jud
Copy link
Author

kc9jud commented Sep 11, 2019

@pleroy: The test build fixed my issue. Thanks!

@BBrutal
Copy link

BBrutal commented Sep 23, 2019

Hi I was in IRC earlier today. I had the following error:

"The Principia DLL failed to load.
An unknown error occurred; detected OS Microsoft Windows NT 10.0.18362.0 64-bit; tried loading dll at 'GameData\Principia\x64\principia.dll'. Note that the Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.22.27821 are required."

The "principia test for 1.7.3.zip" file fixed that error for me.

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

Successfully merging a pull request may close this issue.

5 participants