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]: CountryDoggosRandomKKBits-related Crash #4169

Closed
1 task done
heyimastopsign opened this issue Aug 22, 2024 · 5 comments · Fixed by #4170
Closed
1 task done

[Bug]: CountryDoggosRandomKKBits-related Crash #4169

heyimastopsign opened this issue Aug 22, 2024 · 5 comments · Fixed by #4170
Assignees
Labels
Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN

Comments

@heyimastopsign
Copy link

heyimastopsign commented Aug 22, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Operating System

MacOS 14.6.1

CKAN Version

v1.34.4

Games

KSP 1

Game Version

1.12.5

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

To my knowledge, I have not made any manual changes.

Describe the bug

When searching for "FP" or scrolling down far enough in CKAN, my CKAN will spontaneously crash.

Steps to reproduce

  • Search for "FP", or just scroll far enough
  • Crash appears

Relevant log output

Unhandled Exception:
CKAN.ModuleNotFoundKraken: Module not found: CountryDoggosRandomKKBits
  at CKAN.Registry.getAvail (System.String identifier) [0x00040] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.Registry.LatestCompatibleGameVersion (System.Collections.Generic.List`1[T] realVersions, System.String identifier) [0x0000d] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.ConsoleUI.ModListScreen+<>c__DisplayClass0_0.<.ctor>b__34 (CKAN.CkanModule m) [0x00016] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.ConsoleUI.Toolkit.ConsoleListBox`1[RowT].Draw (CKAN.ConsoleUI.Toolkit.ConsoleTheme theme, System.Boolean focused) [0x00259] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.ConsoleUI.Toolkit.ScreenContainer.Draw (CKAN.ConsoleUI.Toolkit.ConsoleTheme theme) [0x0002e] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.ConsoleUI.Toolkit.ScreenContainer.Interact (CKAN.ConsoleUI.Toolkit.ConsoleTheme theme) [0x0000f] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.ConsoleUI.Toolkit.ScreenContainer.Run (CKAN.ConsoleUI.Toolkit.ConsoleTheme theme, System.Action`1[T] process) [0x00021] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.ConsoleUI.ConsoleCKAN..ctor (CKAN.GameInstanceManager mgr, System.String themeName, System.Boolean debug) [0x000b1] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.ConsoleUI.ConsoleUI.Main_ (CKAN.GameInstanceManager manager, System.String themeName, System.Boolean debug) [0x00005] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.CmdLine.MainClass.ConsoleUi (CKAN.GameInstanceManager manager, CKAN.CmdLine.ConsoleUIOptions opts) [0x00033] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.CmdLine.MainClass.RunSimpleAction (CKAN.CmdLine.Options cmdline, CKAN.CmdLine.CommonOptions options, System.String[] args, CKAN.IUser user, CKAN.GameInstanceManager manager) [0x002ea] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.CmdLine.MainClass.Execute (CKAN.GameInstanceManager manager, CKAN.CmdLine.CommonOptions opts, System.String[] args) [0x002b4] in <5619c0490fe14ea1b83e6c508f8301de>:0
  at CKAN.CmdLine.MainClass.Main (System.String[] args) [0x000e9] in <5619c0490fe14ea1b83e6c508f8301de>:0
@HebaruSan HebaruSan added Support Issues that are support requests macOS Issues specific for macOS Bug Something is not working as intended ConsoleUI Issues affecting the interactive console UI labels Aug 22, 2024
@HebaruSan
Copy link
Member

That mod was frozen in KSP-CKAN/NetKAN#8711 and KSP-CKAN/CKAN-meta#3283 after being removed by its author. Apparently ConsoleUI didn't like that.

@heyimastopsign
Copy link
Author

Ah, I see. Any relevant fixes? I've attempted uninstalling the mod, but the issue still appears to occur.

@HebaruSan HebaruSan self-assigned this Aug 22, 2024
@HebaruSan HebaruSan added Core (ckan.dll) Issues affecting the core part of CKAN and removed Support Issues that are support requests macOS Issues specific for macOS ConsoleUI Issues affecting the interactive console UI labels Aug 22, 2024
@HebaruSan
Copy link
Member

HebaruSan commented Aug 22, 2024

Any relevant fixes?

Not yet. Uninstalling the mod in CKAN should should solve it (I assume you just deleted some files rather than uninstalling in CKAN?), but that probably won't succeed while this exception is being thrown. Once we have a better understanding of what's happening, we might be able to identify a workaround.

After #3904, LatestCompatibleGameVersion uses the new function getAvail, which throws ModuleNotFoundKraken for modules that aren't in the metadata repos:

/// <summary>
/// Return the latest game version compatible with the given mod.
/// </summary>
/// <param name="identifier">Name of mod to check</param>
public GameVersion LatestCompatibleGameVersion(List<GameVersion> realVersions,
string identifier)
=> getAvail(identifier).Select(am => am.LatestCompatibleGameVersion(realVersions))
.Max();

Before, it used TryGetValue, which doesn't throw:

/// <summary>
/// Return the latest game version compatible with the given mod.
/// </summary>
/// <param name="identifier">Name of mod to check</param>
public GameVersion LatestCompatibleGameVersion(List<GameVersion> realVersions,
string identifier)
=> available_modules.TryGetValue(identifier, out AvailableModule availMod)
? availMod.LatestCompatibleGameVersion(realVersions)
: null;

ConsoleUI uses that function as if its failure mode is to return null, so that exception should be suppressed:

}, new ConsoleListBoxColumn<CkanModule>() {
Header = Properties.Resources.ModListMaxGameVersionHeader,
Width = 20,
Renderer = m => registry.LatestCompatibleGameVersion(game.KnownVersions, m.identifier)?.ToString() ?? "",
Comparer = (a, b) => registry.LatestCompatibleGameVersion(game.KnownVersions, a.identifier).CompareTo(registry.LatestCompatibleGameVersion(game.KnownVersions, b.identifier))

@HebaruSan
Copy link
Member

Hi @heyimastopsign, thanks for reporting this! There are a number of options for working around this issue:

  1. If you are familiar with CKAN's command line mode, mono ckan.exe remove CountryDoggosRandomKKBits should work (but I haven't personally confirmed this, so there's some possibility that there could be another similar bug there)
  2. If you know how to use it, the dev build at the ckan.exe link at https://github.com/KSP-CKAN/CKAN/pull/4170/checks under the Artifacts dropdown should allow you to run CKAN without hitting this issue and then uninstall the mod that way
  3. Or if you prefer a full Mac package, you can try this one: CKAN.dmg.zip
  4. Otherwise I can hand-edit your <Game dir>/CKAN/registry.json file to remove it for you, if you upload it here

@heyimastopsign
Copy link
Author

Resolved the issue using solution 1.

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants