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

Modding Bug that repeats "TextureReplacerReplaced" #2738

Closed
CrafterJacob1 opened this issue Apr 21, 2019 · 15 comments · Fixed by #2740
Closed

Modding Bug that repeats "TextureReplacerReplaced" #2738

CrafterJacob1 opened this issue Apr 21, 2019 · 15 comments · Fixed by #2740
Assignees
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Relationships Issues affecting depends, recommends, etc.

Comments

@CrafterJacob1
Copy link

CrafterJacob1 commented Apr 21, 2019

Background

CKAN Version:
1.26.0

KSP Version:
1.6.1
1.3 and 1.4 marked as compatible

Operating System:
Windows 7

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

Problem

What steps did you take in CKAN?
Install Astronomers Visual Pack

What did you expect to happen?
Ask for TextureReplacerReplaced once without asking for it twice

What happened instead?
Get the fallowing:
TextureReplacerReplaced <--
Scatterer
Astronomers Visual Pack 8k-Textures
TextureReplacerReplaced <--

CKAN suggests TextureReplacerReplaced when I already have it, Once when I get Astronomers Visual Pack, and once when applying the mods.

Screenshots:

This is the message I get...

System.ArgumentException: Already contains module:TextureReplacerReplaced
   at CKAN.RelationshipResolver.Add(CkanModule module, SelectionReason reason)
   at CKAN.RelationshipResolver.AddModulesToInstall(IEnumerable`1 modules)
   at CKAN.ModuleInstaller.InstallList(ICollection`1 modules, RelationshipResolverOptions options, IDownloader downloader, Boolean ConfirmPrompt)
   at CKAN.Main.InstallMods(Object sender, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

For example:

This never happened before I tried booting it up in 1.7

I also get:

Texture Bugs
No Clouds
Occasional Crash
Terrain Glitches - Not much of a problem, it's a rare, and simple fix
Missing Textures for Windows, and Helmets (Ferline Utility Rovers)
And much more.

@CrafterJacob1
Copy link
Author

I forgot to mention that I could not find ways to resolve these online

@DasSkelett DasSkelett added Bug Something is not working as intended Relationships Issues affecting depends, recommends, etc. labels Apr 21, 2019
@HebaruSan
Copy link
Member

1.6.1

This never happened before I tried booting it up in 1.7

Do you have 1.6.1 or 1.7?

@HebaruSan HebaruSan added the Needs more info We need more info label Apr 21, 2019
@DasSkelett
Copy link
Member

DasSkelett commented Apr 21, 2019

Can confirm. If you choose TextureReplacerReplaced to satisfy the TexturReplacer dependency when you select AVP in the mod list, you get asked again to choose between TextureReplacerReplaced and TexturReplacer to satisfy the dependency again. Thus the mod is added twice in the InstallList, throwing the error on installation.
Doesn't happen if you choose TextureReplacer first.

@DasSkelett
Copy link
Member

DasSkelett commented Apr 21, 2019

In my case it is a fake KSP 1.6.1 install with 1.3 to 1.7 marked as compatible.

@HebaruSan
Copy link
Member

I'm seeing this exception:

System.ArgumentException: Already contains module:TextureReplacerReplaced
   at CKAN.RelationshipResolver.Add(CkanModule module, SelectionReason reason)
   at CKAN.RelationshipResolver.AddModulesToInstall(IEnumerable`1 modules)
   at CKAN.RelationshipResolver..ctor(IEnumerable`1 modulesToInstall, IEnumerable`1 modulesToRemove, RelationshipResolverOptions options, IRegistryQuerier registry, KspVersionCriteria kspversion)
   at CKAN.MainModList.<ComputeChangeSetFromModList>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at CKAN.Main.<UpdateChangeSetAndConflicts>d__62.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at CKAN.Main.<UpdateChangeSetAndConflicts>d__62.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at CKAN.Main.<UpdateChangeSetAndConflicts>d__62.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at CKAN.Main.<UpdateChangeSetAndConflicts>d__62.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at CKAN.Main.<UpdateChangeSetAndConflicts>d__62.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at CKAN.Main.<UpdateChangeSetAndConflicts>d__62.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at CKAN.Main.<UpdateChangeSetAndConflicts>d__62.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at CKAN.Main.<UpdateChangeSetAndConflicts>d__62.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at CKAN.Main.<ModList_CellValueChanged>d__277.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

@HebaruSan HebaruSan added Core (ckan.dll) Issues affecting the core part of CKAN and removed Needs more info We need more info labels Apr 21, 2019
@HebaruSan
Copy link
Member

Also happens from CmdLine!

$ _build/ckan install AstronomersVisualPack
Too many mods provide Scatterer-sunflare. Please pick from the following:

1) GPO (Gameslinx Planet Overhaul)
2) GPP (Galileo's Planet Pack)
3) Scatterer-sunflare (scatterer - sunflare)
Enter a number between 1 and 3 (To cancel press "c" or "n".):
3
Too many mods provide Scatterer-config. Please pick from the following:

1) GPO (Gameslinx Planet Overhaul)
2) SSRSS-Cont (SSRSS Continued)
3) Scatterer-config (scatterer - default config)
Enter a number between 1 and 3 (To cancel press "c" or "n".):
3
Too many mods provide AVP-Textures. Please pick from the following:

1) AVP-2kTextures (Astronomer's Visual Pack-2k Textures)
2) AVP-4kTextures (Astronomer's Visual Pack-4k Textures)
3) AVP-8kTextures (Astronomer's Visual Pack-8k Textures)
Enter a number between 1 and 3 (To cancel press "c" or "n".):
1
Too many mods provide TextureReplacer. Please pick from the following:

1) TextureReplacer (TextureReplacer)
2) TextureReplacerReplaced (TextureReplacerReplaced)
Enter a number between 1 and 2 (To cancel press "c" or "n".):
2
Too many mods provide TextureReplacer. Please pick from the following:

1) TextureReplacer (TextureReplacer)
2) TextureReplacerReplaced (TextureReplacerReplaced)
Enter a number between 1 and 2 (To cancel press "c" or "n".):
2

Unhandled Exception: System.ArgumentException: Already contains module:TextureReplacerReplaced
   at CKAN.RelationshipResolver.Add(CkanModule module, SelectionReason reason)
   at CKAN.RelationshipResolver.AddModulesToInstall(IEnumerable`1 modules)
   at CKAN.RelationshipResolver..ctor(IEnumerable`1 modulesToInstall, IEnumerable`1 modulesToRemove, RelationshipResolverOptions options, IRegistryQuerier registry, KspVersionCriteria kspversion)
   at CKAN.RelationshipResolver..ctor(IEnumerable`1 modulesToInstall, IEnumerable`1 modulesToRemove, RelationshipResolverOptions options, IRegistryQuerier registry, KspVersionCriteria kspversion)
   at CKAN.ModuleInstaller.InstallList(List`1 modules, RelationshipResolverOptions options, IDownloader downloader)
   at CKAN.CmdLine.Install.RunCommand(KSP ksp, Object raw_options)
   at CKAN.CmdLine.Install.RunCommand(KSP ksp, Object raw_options)
   at CKAN.CmdLine.Install.RunCommand(KSP ksp, Object raw_options)
   at CKAN.CmdLine.Install.RunCommand(KSP ksp, Object raw_options)
   at CKAN.CmdLine.Install.RunCommand(KSP ksp, Object raw_options)
   at CKAN.CmdLine.Install.RunCommand(KSP ksp, Object raw_options)
   at CKAN.CmdLine.MainClass.RunSimpleAction(Options cmdline, CommonOptions options, String[] args, IUser user, KSPManager manager)
   at CKAN.CmdLine.MainClass.Execute(KSPManager manager, CommonOptions opts, String[] args)
   at CKAN.CmdLine.MainClass.Main(String[] args)

@DasSkelett
Copy link
Member

But not with your consoleUI :)
Also, I have to pass, I don't get such a nice long error message in the GUI, I'm stuck with the mingy one :(

@HebaruSan
Copy link
Member

But not with your consoleUI :)

I was just coming back here to report that! :)

Also, I have to pass, I don't get such a nice long error message in the GUI, I'm stuck with the mingy one :(

I think that was due to what's probably another related problem, if I try to cancel out of the prompt, it just repeats over and over. So each of those stack levels was probably one time I cancelled.

@HebaruSan
Copy link
Member

Weirdly, ConsoleUI installs a version of TextureReplacerReplaced that it claims can be upgraded, and upgrading it produces an error afterwards:

image

@DasSkelett
Copy link
Member

@HebaruSan
Copy link
Member

That makes sense! CmdLine and GUI probably use the provides property of other versions to prompt for TRR vs TR, then if you choose TRR they switch to the latest compatible version which is missing that property. Whereas ConsoleUI installs the actual version that provides TR, which can be upgraded.

I guess we should fix the metadata, but some code changes may be advisable as well. Ideally CmdLine and GUI would work more like ConsoleUI in this instance.

Well that's fun. KSP-CKAN/NetKAN#6049 changed the netkan from providing TR to providing TRR (that would have been between 0.5.2 and 0.5.3), then KSP-CKAN/NetKAN#6068 removed the provides because it was causing other problems. It should have changed it back to providing TR.

@DasSkelett
Copy link
Member

DasSkelett commented Apr 21, 2019

You were a bit faster at typing. Agree with you.
Also all UIs should not offer the update to a version which doesn't provide a needed module any more.
Could this issue apply to replacements too?

@HebaruSan
Copy link
Member

Here's where CmdLine discards the full CkanModule in favor of just the identifier:

// Add the module to the list.
options.modules.Add(ex.modules[result].identifier);

And I think this is where GUI does it (goes through the mod list to populate the change set normally):

CKAN/GUI/MainDialogs.cs

Lines 86 to 87 in 7b9da8c

if (module != null)
MarkModForInstall(module.identifier);

@CrafterJacob1
Copy link
Author

You people were very helpful, Thank you all and God bless you all!!

@Olympic1 Olympic1 removed the Bug Something is not working as intended label Apr 22, 2019
@HebaruSan
Copy link
Member

Glad it's working now @CrafterJacob1. We'd like to keep this open a bit longer because there's an underlying technical issue in the app that could be fixed. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants