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

[Bug]: NRE, Repository update failed #4000

Closed
1 task done
TunedRockets opened this issue Jan 15, 2024 · 6 comments · Fixed by #4002
Closed
1 task done

[Bug]: NRE, Repository update failed #4000

TunedRockets opened this issue Jan 15, 2024 · 6 comments · Fixed by #4002
Labels
Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Needs more info We need more info

Comments

@TunedRockets
Copy link

TunedRockets commented Jan 15, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Operating System

Windows

CKAN Version

1.34.4

Games

KSP 1

Game Version

1.12.3.3173

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

not that i am aware of. (except insofar as trying to solve the problem, though nothing i haven't reset)

Describe the bug

When trying to open ckan, it tries to refresh, but only outputs this:

Scanning for DLCs and manually installed modules...
Object reference not set to an instance of an object.
Repository update failed!

no downloaded or possible to download mods show up.
i have tried to reinstall a fresh ksp instance, and a fresh CKAN instance, but neither fix the problem.

Steps to reproduce

run the ckan.exe

Relevant log output

This code came form an error when trying to close the ckan window, though i have not encountered it again so it may be irrelevant:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at CKAN.GUI.Main.OnFormClosed(FormClosedEventArgs e)
   at System.Windows.Forms.Form.WmClose(Message& m)
   at CKAN.GUI.Main.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
@HebaruSan HebaruSan added Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Needs more info We need more info labels Jan 17, 2024
@HebaruSan
Copy link
Member

Hi @TunedRockets, thanks for the report! This log doesn't give us enough information to identify the cause of this problem, so we'll need to gather more information to figure it out.

If you unzip this log4net.xml file into the directory where your ckan.exe file lives and then run CKAN, it will generate a CKAN.log file that you can share here.

@TunedRockets
Copy link
Author

Hi. While trying some more stuff i did a complete uninstall of KSP and CKAN and that fixed the problem.
So unfortunately (or fortunately really) i don't get the bug anymore and cannot help track it down.

@HebaruSan HebaruSan changed the title [Bug]: Repository update failed [Bug]: NRE, Repository update failed Jan 17, 2024
@HebaruSan
Copy link
Member

A user on Discord reported the same issue and gathered logs for us:

    67 INFO  CKAN.CmdLine.MainClass  CKAN started.
   212 INFO  CKAN.CmdLine.MainClass  CKAN exiting.
   226 INFO  CKAN.CmdLine.MainClass  CKAN exiting.
   303 INFO  CKAN.GameInstanceManager  Loading KSP instances
   304 DEBUG CKAN.GameInstanceManager  Loading Auto KSP from c:/program files (x86)/steam/SteamApps/common/Kerbal Space Program
   316 DEBUG CKAN.Games.KerbalSpaceProgram.GameVersionProviders.KspBuildMap  Getting cached build map
   320 DEBUG CKAN.GameInstance  Found version 1.12.5.3190
   322 INFO  CKAN.GameInstance  Initialising c:/program files (x86)/steam/SteamApps/common/Kerbal Space Program/CKAN
   325 INFO  CKAN.GameInstance  Initialised c:/program files (x86)/steam/SteamApps/common/Kerbal Space Program/CKAN
   379 INFO  CKAN.GUI.Main  Starting the GUI
   731 DEBUG CKAN.GameInstance  Checking if KSP is in my current dir: C:\Users\blake\Desktop\Games Launchers Etc\Launchers
   731 DEBUG CKAN.GameInstance  Checking if KSP is in my exe dir: C:\Users\blake\Desktop\Games Launchers Etc\Launchers
   731 DEBUG CKAN.GameInstance  Checking if KSP2 is in my current dir: C:\Users\blake\Desktop\Games Launchers Etc\Launchers
   732 DEBUG CKAN.GameInstance  Checking if KSP2 is in my exe dir: C:\Users\blake\Desktop\Games Launchers Etc\Launchers
   753 DEBUG CKAN.GUI.Util  Found screen: {X=0,Y=0,Width=1536,Height=824}
   753 DEBUG CKAN.GUI.Util  Clamped location: {X=232,Y=0}
   786 INFO  CKAN.GUI.URLHandlers  Adding URL handler to registry
   786 INFO  CKAN.GUI.URLHandlers  URL handler already exists with the same path
   817 INFO  CKAN.GUI.Main  GUI started
   890 DEBUG CKAN.RegistryManager  Preparing to load registry at c:/program files (x86)/steam/SteamApps/common/Kerbal Space Program/CKAN
   892 DEBUG CKAN.RegistryManager  Checking for stale lock file at c:/program files (x86)/steam/SteamApps/common/Kerbal Space Program/CKAN\registry.locked
   892 DEBUG CKAN.RegistryManager  Trying to create lock file: c:/program files (x86)/steam/SteamApps/common/Kerbal Space Program/CKAN\registry.locked
   892 DEBUG CKAN.RegistryManager  Lock file created: c:/program files (x86)/steam/SteamApps/common/Kerbal Space Program/CKAN\registry.locked
   894 DEBUG CKAN.RegistryManager  Trying to load registry from c:/program files (x86)/steam/SteamApps/common/Kerbal Space Program/CKAN\registry.json
   989 DEBUG CKAN.RegistryManager  Registry JSON loaded; parsing...
  2520 DEBUG CKAN.RegistryManager  Registry loaded and parsed
  2521 INFO  CKAN.RegistryManager  Loaded CKAN registry at c:/program files (x86)/steam/SteamApps/common/Kerbal Space Program/CKAN\registry.json
  2576 INFO  CKAN.GUI.Main  Making auto-update call
  2577 DEBUG CKAN.Net  About to download https://api.github.com/repos/KSP-CKAN/CKAN/releases/latest
  2845 DEBUG CKAN.Net  Response from https://api.github.com/repos/KSP-CKAN/CKAN/releases/latest:

Vary: Accept, Accept-Encoding, Accept, X-Requested-With
X-GitHub-Media-Type: github.v3; format=json
x-github-api-version-selected: 2022-11-28
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1705539588
X-RateLimit-Resource: core
X-RateLimit-Used: 2
Transfer-Encoding: chunked
X-GitHub-Request-Id: E761:4BE3:3DF8674:7F91F80:65A86A38
Accept-Ranges: bytes
Cache-Control: public, max-age=60, s-maxage=60
Content-Type: application/json; charset=utf-8
Date: Thu, 18 Jan 2024 00:00:56 GMT
ETag: W/"37e6dc99bb728dff5d04fa00416ac54508aaeecd369ee1955aed57b5dab411eb"
Last-Modified: Thu, 04 Jan 2024 18:38:40 GMT
Server: GitHub.com


{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/releases/135871692","assets_url":"https://api.github.com/repos/KSP-CKAN/CKAN/releases/135871692/assets","upload_url":"https://uploads.github.com/repos/KSP-CKAN/CKAN/releases/135871692/assets{?name,label}","html_url":"https://github.com/KSP-CKAN/CKAN/releases/tag/v1.34.4","id":135871692,"author":{"login":"HebaruSan","id":1559108,"node_id":"MDQ6VXNlcjE1NTkxMDg=","avatar_url":"https://avatars.githubusercontent.com/u/1559108?v=4","gravatar_id":"","url":"https://api.github.com/users/HebaruSan","html_url":"https://github.com/HebaruSan","followers_url":"https://api.github.com/users/HebaruSan/followers","following_url":"https://api.github.com/users/HebaruSan/following{/other_user}","gists_url":"https://api.github.com/users/HebaruSan/gists{/gist_id}","starred_url":"https://api.github.com/users/HebaruSan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HebaruSan/subscriptions","organizations_url":"https://api.github.com/users/HebaruSan/orgs","repos_url":"https://api.github.com/users/HebaruSan/repos","events_url":"https://api.github.com/users/HebaruSan/events{/privacy}","received_events_url":"https://api.github.com/users/HebaruSan/received_events","type":"User","site_admin":false},"node_id":"RE_kwDOAV-5Ys4IGTzM","tag_name":"v1.34.4","target_commitish":"master","name":"Niven","draft":false,"prerelease":false,"created_at":"2024-01-04T18:27:52Z","published_at":"2024-01-04T18:35:53Z","assets":[{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/releases/assets/143805739","id":143805739,"node_id":"RA_kwDOAV-5Ys4Ikk0r","name":"AutoUpdater.exe","label":"","uploader":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"content_type":"application/vnd.microsoft.portable-executable","state":"uploaded","size":423936,"download_count":9861,"created_at":"2024-01-04T18:38:39Z","updated_at":"2024-01-04T18:38:40Z","browser_download_url":"https://github.com/KSP-CKAN/CKAN/releases/download/v1.34.4/AutoUpdater.exe"},{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/releases/assets/143805736","id":143805736,"node_id":"RA_kwDOAV-5Ys4Ikk0o","name":"ckan-1.34.4-1.noarch.rpm","label":"","uploader":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"content_type":"application/x-rpm","state":"uploaded","size":1529275,"download_count":207,"created_at":"2024-01-04T18:38:38Z","updated_at":"2024-01-04T18:38:39Z","browser_download_url":"https://github.com/KSP-CKAN/CKAN/releases/download/v1.34.4/ckan-1.34.4-1.noarch.rpm"},{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/releases/assets/143805731","id":143805731,"node_id":"RA_kwDOAV-5Ys4Ikk0j","name":"CKAN.dmg","label":"","uploader":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"content_type":"application/x-apple-diskimage","state":"uploaded","size":5013504,"download_count":434,"created_at":"2024-01-04T18:38:37Z","updated_at":"2024-01-04T18:38:37Z","browser_download_url":"https://github.com/KSP-CKAN/CKAN/releases/download/v1.34.4/CKAN.dmg"},{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/releases/assets/143805726","id":143805726,"node_id":"RA_kwDOAV-5Ys4Ikk0e","name":"ckan.exe","label":"","uploader":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"content_type":"application/vnd.microsoft.portable-executable","state":"uploaded","size":4875264,"download_count":17636,"created_at":"2024-01-04T18:38:36Z","updated_at":"2024-01-04T18:38:36Z","browser_download_url":"https://github.com/KSP-CKAN/CKAN/releases/download/v1.34.4/ckan.exe"},{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/releases/assets/143805734","id":143805734,"node_id":"RA_kwDOAV-5Ys4Ikk0m","name":"ckan_1.34.4_all.deb","label":"","uploader":{"login":"github-actions[bot]","id":41898282,"node_id":"MDM6Qm90NDE4OTgyODI=","avatar_url":"https://avatars.githubusercontent.com/in/15368?v=4","gravatar_id":"","url":"https://api.github.com/users/github-actions%5Bbot%5D","html_url":"https://github.com/apps/github-actions","followers_url":"https://api.github.com/users/github-actions%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-actions%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-actions%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-actions%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-actions%5Bbot%5D/received_events","type":"Bot","site_admin":false},"content_type":"application/vnd.debian.binary-package","state":"uploaded","size":1052296,"download_count":200,"created_at":"2024-01-04T18:38:38Z","updated_at":"2024-01-04T18:38:38Z","browser_download_url":"https://github.com/KSP-CKAN/CKAN/releases/download/v1.34.4/ckan_1.34.4_all.deb"}],"tarball_url":"https://api.github.com/repos/KSP-CKAN/CKAN/tarball/v1.34.4","zipball_url":"https://api.github.com/repos/KSP-CKAN/CKAN/zipball/v1.34.4","body":"[![Niven ring](https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Ringworld_drawing.jpg/640px-Ringworld_drawing.jpg)](https://en.wikipedia.org/wiki/Known_Space)\r\n\r\n---\r\n\r\n## Changes since v1.34.2\r\n\r\n### Features\r\n\r\n- [CLI] Pause after administrator error message (#3966 by: HebaruSan; reviewed: techman83)\r\n- [Multiple] Put auto-installed mods in ignored modpack group by default (#3978 by: HebaruSan)\r\n- [GUI] Add links to hidden tags and labels below mod list (#3979, #3980 by: HebaruSan)\r\n- [Core] Detect and use Windows KSP2 executable on Linux (#3984 by: JackOfHertz; reviewed: HebaruSan)\r\n\r\n### Bugfixes\r\n\r\n- [Core] Oops, `HttpClient` actually sucks (#3960 by: HebaruSan; reviewed: techman83)\r\n- [Multiple] Usability improvements for adding game instance (#3964 by: HebaruSan; reviewed: JonnyOThan)\r\n- [Core] Fix NullReferenceException in csv/tsv export (#3967 by: HebaruSan)\r\n- [Core] Fix cache timestamp comparisons (#3974 by: HebaruSan)\r\n- [GUI] Fix compatible popup messing with max game version column (#3976 by: HebaruSan)\r\n- [Core] Fix Audit Recommendations option (#3988 by: HebaruSan)\r\n- [Multiple] Installation message usability improvements (#3989 by: HebaruSan)\r\n\r\n### Internal\r\n\r\n- [Netkan] Re-sort module properties after merging (#3957 by: HebaruSan)\r\n- [Netkan] Update and optimize meta tester and inflator images (#3958, #3968 by: HebaruSan; reviewed: techman83)\r\n- [Netkan] Generate schema compliant game versions from swinfo.json (#3969 by: HebaruSan)\r\n- [Core] Save and load game version for fake KSP2 instances (#3986 by: HebaruSan)\r\n- [Netkan] Resolve compatibility conflicts after multi-host merge (#3991 by: HebaruSan)\r\n\r\n## Notes\r\n\r\n- CKAN releases are built in clean-room conditions to protect against viruses. If your virus scanner reports a problem, it's almost certainly a false positive. Please report such problems to the company that produces your virus scanner so they can update their whitelisting.\r\n- This release of the CKAN has not been tested on Mono releases prior to 6.8. We highly recommend that Mac and Linux users upgrade to the latest stable release of Mono from [mono-project.com](http://www.mono-project.com/). You will need the equivalent of the mono-complete package for your OS.\r\n\r\n## How should I install?\r\n\r\nOS | Description\r\n:-- | :--\r\nWindows | Download **ckan.exe** and run it. Make sure you have [.NET 4.8](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net48) or later installed.\r\nmacOS | Get the **.dmg**, open it, copy **CKAN.app** somewhere and run it\r\nDebian, Ubuntu, Linux Mint | [Install from our APT repo for automated updates](https://github.com/KSP-CKAN/CKAN/blob/master/doc/apt-repo.md), or get the **.deb** file and install it with dpkg-install/apt-get/apt\r\nFedora, openSUSE | [Install from our RPM repo for automated updates](https://github.com/KSP-CKAN/CKAN/blob/master/doc/rpm-repo.md), or get the **.rpm** file and install it with rpm/yum/dnf/zypper\r\nArch, Manjaro | CKAN is in the [Arch User Repository](https://aur.archlinux.org/packages/ckan/). If Arch's MSBuild breaks again, get ckan.exe and run it with Mono.\r\nOther | Get **ckan.exe** and run it with Mono\r\n\r\n**Nobody** needs to download AutoUpdate.exe.\r\n\r\n---\r\n\r\nRelease image under CC-BY-3.0, [courtesy of Eric M. Jones](https://commons.wikimedia.org/wiki/File:Ringworld_drawing.jpg)\r\n"}
  3143 DEBUG CKAN.GUI.Main  Current instance updated, scanning
  3200 DEBUG CKAN.GUI.Main  Scanning before repo update
  3202 INFO  CKAN.RegistryManager  Scanning for installed mods...
  3203 DEBUG CKAN.CkanTransaction  Trying to set max timeout to 49:17:02:47.294
  3204 DEBUG CKAN.CkanTransaction  Failed to set s_cachedMaxTimeout
  3204 DEBUG CKAN.CkanTransaction  Failed to set s_maximumTimeout
  3205 DEBUG CKAN.CkanTransaction  Starting transaction with timeout 49:17:02:47.294
  3379 DEBUG CKAN.RegistryManager  Registering DLLs: GameData/ModuleManager.4.2.3.dll, GameData/000_ClickThroughBlocker/Plugins/ClickThroughBlocker.dll, GameData/000_Harmony/0Harmony.dll, GameData/000_Harmony/HarmonyInstallChecker.dll, GameData/000_Toolbar/Plugins/aaa_Toolbar.dll, GameData/001_ToolbarControl/Plugins/ToolbarControl.dll, GameData/B9PartSwitch/Plugins/B9PartSwitch.dll, GameData/BetterBurnTime/BetterBurnTime.dll, GameData/BetterTimeWarp/Plugins/BetterTimeWarpCont.dll, GameData/DistantObject/Plugins/DistantObject.dll, GameData/DistantObject/Plugins/KSPe.Light.DOE.dll, GameData/DistantObject/Plugins/PluginData/MeshEngine.dll, GameData/DistantObject/Plugins/PluginData/MeshEngineStock.dll, GameData/DistantObject/Plugins/PluginData/MeshEngineTweakScale.dll, GameData/EnvironmentalVisualEnhancements/Plugins/Atmosphere.dll, GameData/EnvironmentalVisualEnhancements/Plugins/CelestialShadows.dll, GameData/EnvironmentalVisualEnhancements/Plugins/CityLights.dll, GameData/EnvironmentalVisualEnhancements/Plugins/EVEManager.dll, GameData/EnvironmentalVisualEnhancements/Plugins/PartFX.dll, GameData/EnvironmentalVisualEnhancements/Plugins/PQSManager.dll, GameData/EnvironmentalVisualEnhancements/Plugins/ShaderLoader.dll, GameData/EnvironmentalVisualEnhancements/Plugins/Terrain.dll, GameData/EnvironmentalVisualEnhancements/Plugins/TextureConfig.dll, GameData/EnvironmentalVisualEnhancements/Plugins/Utils.dll, GameData/EnvironmentalVisualEnhancements/Plugins/_BuildManager.dll, GameData/KerbalEngineer/KerbalEngineer.dll, GameData/KerbalRenamer/plugins/Renamer.dll, GameData/Kopernicus/Plugins/Kopernicus.dll, GameData/KSPCommunityFixes/Plugins/0_MultipleModuleInPartAPI.dll, GameData/KSPCommunityFixes/Plugins/KSPCommunityFixes.dll, GameData/MechJeb2/Plugins/MechJeb2.dll, GameData/MechJeb2/Plugins/System.Buffers.dll, GameData/ModularFlightIntegrator/ModularFlightIntegrator.dll, GameData/PlanetShine/Plugins/PlanetShine.dll, GameData/RealSolarSystem/Plugins/RealSolarSystem.dll, GameData/ReStock/Plugins/Restock.dll, GameData/RocketSoundEnhancement/Plugins/RocketSoundEnhancement.dll, GameData/RSSDateTime/Plugins/RSSTimeFormatter.dll, GameData/RSSVE/Plugins/RSSVE.dll, GameData/Scatterer/Scatterer.dll, GameData/SpaceTuxLibrary/Plugins/ButtonManager.dll, GameData/SpaceTuxLibrary/Plugins/KSP_ColorPicker.dll, GameData/SpaceTuxLibrary/Plugins/KSP_Log.dll, GameData/SpaceTuxLibrary/Plugins/KSP_PartHighlighter.dll, GameData/SpaceTuxLibrary/Plugins/SpaceTuxUtility.dll, GameData/SpaceTuxLibrary/Plugins/VesselModuleSave.dll, GameData/TextureReplacer/Plugins/TextureReplacer.dll, GameData/TriggerTech/KerbalAlarmClock/KerbalAlarmClock.dll, GameData/TriggerTech/TransferWindowPlanner/TransferWindowPlanner.dll, GameData/Waterfall/Plugins/Waterfall.dll, GameData/[x]_Science!/Plugins/[x]_Science!.dll
  3393 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_0`2.<DictionaryEquals>b__1(K k)
   at System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate)
   at CKAN.Registry.SetDlcs(Dictionary`2 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 HebaruSan reopened this Jan 18, 2024
@HebaruSan
Copy link
Member

The user on Discord had disabled one of the DLCs in a menu in Steam:

image

This apparently deletes the files for that DLC but leaves behind all the folders:

image

Which makes the DLC detector's IsInstalled return true while leaving the version out param as null:

version = null;
var directoryPath = Path.Combine(game.PrimaryModDirectory(ksp), "SquadExpansion", DirectoryBaseName);
if (Directory.Exists(directoryPath))
{
var readmeFilePath = Path.Combine(directoryPath, "readme.txt");
if (File.Exists(readmeFilePath))
{
foreach (var line in File.ReadAllLines(readmeFilePath))
{
var match = VersionPattern.Match(line);
if (match.Success)
{
var versionStr = match.Groups["version"].Value;
if (CanonicalVersions.ContainsKey(versionStr))
{
versionStr = CanonicalVersions[versionStr];
}
version = new UnmanagedModuleVersion(versionStr);
break;
}
}
}
return true;
}
else
{
return false;
}

Our IsInstalled check should probably return false for the case where the user disabled the DLC in Steam.

@alphaleadership

This comment was marked as off-topic.

@alphaleadership

This comment was marked as off-topic.

@HebaruSan HebaruSan unpinned this issue Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Needs more info We need more info
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants