KSP-CKAN / CKAN

The Comprehensive Kerbal Archive Network
https://forum.kerbalspaceprogram.com/index.php?/topic/197082-*
Other
1.96k stars 349 forks source link

[Bug]: Repository updated failed because of SquadExpansion created by buying/installing/leaving activating one DLC #4100

Closed mizar1 closed 3 months ago

mizar1 commented 3 months ago

Is there an existing issue for this?

Operating System

Windows 11 23H2

CKAN Version

1.34.4

Games

KSP 1

Game Version

1.12.5.3190

Did you make any manual changes to your game folder (i.e., not via CKAN)?

No, possible I moved my KSP install from the HD (G) to my SSD (E) via Steam.

Describe the bug

When I launched KCAN it said there was a new version, apparently that is when it installed 1.34.4. It immediately says Repository updated failed! and shows no installed mods. The green bar is continually running. Quitting and relaunching changed nothing.

CKAN downloads folder has 232 items in it. The folder steamapps\common\Kerbal Space Program\CKAN\Plugins is empty. The folder steamapps\common\Kerbal Space Program\GameData has 118 items which must be my installed mods. Game Instance points to the correct location (drive E).

Checking KCAN settings default archive is https://github.com/KSP-CKAN/CKAN-meta/archive/master.tar.gz and no others.

If I paste "https://github.com/KSP-CKAN/CKAN-meta/archive/master.tar.gz" into Firefox it downloaded the master.tar.gz file. If Firefox can download the file, CKAN should be able to as well.

Checking as many related bugs as I could:

1) My hosts file is default, aka all commented out

2) Regarding DLC issue, I have Breaking Ground Expansion enabled and was enabled last time I played KSP via CKAN and is enabled now. But I do not have any other DLC.

3) Regarding "SquadExpansion" folder, in gamedata I have an empty folder "SquadExpansion\Serenity\Ships\VAB", intermediate folders created 4/14/24. Regarding issue #4068, this is not an issue of disabling a DLC, this was automatiucally created by either CKAN, Steam, or KSP. Deleted "SquadExpaqnsion" folder after recording the debug log below. This fixed the problem; however, this is a bug in CKAN as this folder is autogenerated by Steam or KSP in response to buying one DLC and/or installing that one DLC or some other activity.

Steps to reproduce

Perhaps use Steam to move KSP from on disk to another or something else generates the SquadExpansion folder without actually disabling any DLC in Steam for KSP. Perhaps even buying and installing one DLC generates this folder. Then update to CKAN to 1.34.4, probably also problem in 1.32 but did not risk that test.

Run CKAN...

Relevant log output

4) Using the log4net.xml from issue 3950. I get a 25 kB CKAN.log, interesting parts: ... 261 INFO CKAN.GameInstance Initialising E:/SteamLibrary/steamapps/common/Kerbal Space Program/CKAN 264 INFO CKAN.GameInstance Initialised E:/SteamLibrary/steamapps/common/Kerbal Space Program/CKAN 327 INFO CKAN.GUI.Main Starting the GUI 641 DEBUG CKAN.GameInstance Checking if KSP is in my current dir: C:\Users\Michael2\Applications 641 DEBUG CKAN.GameInstance Checking if KSP is in my exe dir: C:\Users\Michael2\Applications 641 DEBUG CKAN.GameInstance Checking if KSP2 is in my current dir: C:\Users\Michael2\Applications 642 DEBUG CKAN.GameInstance Checking if KSP2 is in my exe dir: C:\Users\Michael2\Applications ... 2173 INFO CKAN.RegistryManager Loaded CKAN registry at E:/SteamLibrary/steamapps/common/Kerbal Space Program/CKAN\registry.json 2223 INFO CKAN.GUI.Main Making auto-update call 2224 DEBUG CKAN.Net About to download https://api.github.com/repos/KSP-CKAN/CKAN/releases/latest 2413 DEBUG CKAN.Net Response from https://api.github.com/repos/KSP-CKAN/CKAN/releases/latest: ..lots of stuff downloaded... 2641 DEBUG CKAN.GUI.Main Current instance updated, scanning 2684 DEBUG CKAN.GUI.Main Scanning before repo update 2686 INFO CKAN.RegistryManager Scanning for installed mods... 2686 DEBUG CKAN.CkanTransaction Trying to set max timeout to 49:17:02:47.294 2688 DEBUG CKAN.CkanTransaction Failed to set s_cachedMaxTimeout 2688 DEBUG CKAN.CkanTransaction Failed to set s_maximumTimeout 2688 DEBUG CKAN.CkanTransaction Starting transaction with timeout 49:17:02:47.294 2829 DEBUG CKAN.RegistryManager Registering DLLs: GameData/999_Scale_Redist.dll, ...lots more .dll files from GameData and then GameData/[x]_Science!/Plugins/[x]_Science!.dll 2837 ERROR CKAN.GUI.Main Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at CKAN.Extensions.DictionaryExtensions.<>c__DisplayClass0_02.<DictionaryEquals>b__1(K k) at System.Linq.Enumerable.All[TSource](IEnumerable1 source, Func2 predicate) at CKAN.Registry.SetDlcs(Dictionary2 dlcs) at CKAN.RegistryManager.ScanUnmanagedFiles() at CKAN.GUI.Main.UpdateRepo(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

HebaruSan commented 3 months ago

Duplicate of #4000

HebaruSan commented 3 months ago

Hi @mizar1, based on previous investigations of this, your <KSP>/GameData/SquadExpansion folder (you can click FileOpen game directory in CKAN to get there) has an empty folder in it that causes this crash. You can remove that empty folder to work around this issue.

HebaruSan commented 3 months ago

It is already fixed in #4002.