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] DependencyNotSatisfiedKraken on recommendation screen #3134

Closed
DasSkelett opened this issue Aug 6, 2020 · 3 comments · Fixed by #3137
Closed

[Bug] DependencyNotSatisfiedKraken on recommendation screen #3134

DasSkelett opened this issue Aug 6, 2020 · 3 comments · Fixed by #3137
Labels
Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN GUI Issues affecting the interactive GUI Relationships Issues affecting depends, recommends, etc.

Comments

@DasSkelett
Copy link
Member

DasSkelett commented Aug 6, 2020

Background

  • Operating System: Windows
  • CKAN Version: v1.28.0
  • KSP Version: 1.10.1

Have you made any manual changes to your GameData folder (i.e., not via CKAN)?
unknown

Problem

Describe the bug
A user reported an unhandled exception when trying to install several mods after force-installing CommunityResourcePack on Discord.
I've been able to track it down to one example mod causing this, there are more though.

Steps to reproduce

  • Be on KSP 1.10.1, do not have any version below 1.10 marked as compatible.
  • Force-install CRP via the versions tab
  • Select CryoTanks to install
  • Select Kerbal Atomics to install
  • Click Apply twice to rech the recommendation tab
  • Toggle some checkboxes while "Kerbal Atomics - Other Mod Support" is selected
  • Windows will display that "Unhandled Exception" window, on Mono CKAN will ask you whether you really want to quit CKAN (interestingly that hook seems to also run for otherwise unhandled exceptions)
    This seems to be a result of both Dependency/compatibility fixes #3104 and the new conflict marking logic from Mark conflicts in initial recommendations #3097.
    When the conflict detection logic runs the relationship resolver, the resolver doesn't seem to detect the already force-installed CRP, on which CryoTanks depends, on which KerbalAtomics depends, on which KerbalAtomics-NTRModSupport depends.

Also, on the modlist, if you select kerbal atomics before CryoTanks, it also shows an error about its any_of dependencies CryoTanks OR KerbalAtomics-NTRsUseLF aren't compatible, even though CryoTanks should be.

Expected behavior
The exception shouldn't be thrown since the dependency is satisfied, the resolver needs to respect that. I'm not entirely sure if this is a symptom of the "Known Limitations" from #3104.

Screenshots (if applicable)
(Mods the user tried to install)
grafik
grafik

CKAN error code (if applicable):
grafik

CKAN.DependencyNotSatisfiedKraken: Exception of type 'CKAN.DependencyNotSatisfiedKraken' was thrown.
  at CKAN.RelationshipResolver.ResolveStanza (System.Collections.Generic.IEnumerable`1[T] stanza, CKAN.SelectionReason reason, CKAN.RelationshipResolverOptions options, System.Boolean soft_resolve, System.Collections.Generic.IEnumerable`1[T] old_stanza) [0x0038f] in /home/DasSkelett/git/CKAN/Core/Relationships/RelationshipResolver.cs:434 
  at CKAN.RelationshipResolver.Resolve (CKAN.CkanModule module, CKAN.RelationshipResolverOptions options, System.Collections.Generic.IEnumerable`1[T] old_stanza) [0x00038] in /home/DasSkelett/git/CKAN/Core/Relationships/RelationshipResolver.cs:318 
  at CKAN.RelationshipResolver.AddModulesToInstall (System.Collections.Generic.IEnumerable`1[T] modules) [0x00189] in /home/DasSkelett/git/CKAN/Core/Relationships/RelationshipResolver.cs:260 
  at CKAN.RelationshipResolver..ctor (System.Collections.Generic.IEnumerable`1[T] modulesToInstall, System.Collections.Generic.IEnumerable`1[T] modulesToRemove, CKAN.RelationshipResolverOptions options, CKAN.IRegistryQuerier registry, CKAN.Versioning.KspVersionCriteria kspversion) [0x00028] in /home/DasSkelett/git/CKAN/Core/Relationships/RelationshipResolver.cs:183 
  at CKAN.ChooseRecommendedMods.FindConflicts () [0x00001] in /home/DasSkelett/git/CKAN/GUI/Controls/ChooseRecommendedMods.cs:116 
  at CKAN.ChooseRecommendedMods.MarkConflicts () [0x00001] in /home/DasSkelett/git/CKAN/GUI/Controls/ChooseRecommendedMods.cs:87 
  at CKAN.ChooseRecommendedMods.RecommendedModsListView_ItemChecked (System.Object sender, System.Windows.Forms.ItemCheckedEventArgs e) [0x00045] in /home/DasSkelett/git/CKAN/GUI/Controls/ChooseRecommendedMods.cs:81 
  at System.Windows.Forms.ListView.OnItemChecked (System.Windows.Forms.ItemCheckedEventArgs e) [0x00019] in <f8d3988c81fd41129e6b0d880060d203>:0 
  at System.Windows.Forms.ListViewItem.set_Checked (System.Boolean value) [0x0006c] in <f8d3988c81fd41129e6b0d880060d203>:0 
@DasSkelett DasSkelett added Bug Something is not working as intended GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN labels Aug 6, 2020
@HebaruSan
Copy link
Member

HebaruSan commented Aug 6, 2020

Adding some more descriptive text to the kraken classes, the exception is slightly different than expected:

CKAN.DependencyNotSatisfiedKraken: KerbalAtomics-NTRModSupport dependency on KerbalAtomics version (any) not satisfied

Possibly related to circular dependencies.

@HebaruSan HebaruSan added the Relationships Issues affecting depends, recommends, etc. label Aug 6, 2020
@HebaruSan
Copy link
Member

I think this is the exact line that fails. It uses LatestAvailableWithProvides to check dependencies, which will only check compatible modules, not installed incompatible modules. This returns a list-of-lists of dependencies, and the list corresponding to { "name": "CommunityResourcePack" }, is empty.

var needed = module.depends.Select(depend => depend.LatestAvailableWithProvides(registry, kspversion));

It's probably always worked like this; I wish I had this example on-hand when people were asking "why-don't-you-just" questions about force-installing incompatible modules...

@HebaruSan
Copy link
Member

Also image

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 GUI Issues affecting the interactive GUI Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants