KSP-CKAN / CKAN

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

Exceptions when updating or removing AdvancedFlyByWire #2646

Closed Garek33 closed 5 years ago

Garek33 commented 5 years ago

Background

CKAN Version: 1.24.0

KSP Version: 1.6.0.2395

Operating System: Windows 10

Have you made any manual changes to your GameData folder (i.e., not via CKAN)? I'm currently building kOS manually (should be unrelated, and CKAN seems to autodetect it correctly).

Problem

NB: https://forum.kerbalspaceprogram.com/index.php?/topic/154922-ckan-the-comprehensive-kerbal-archive-network-v1254-kennedy/&page=62&tab=comments#comment-3514969 is probably the same problem, but apparently ctbram has not yet created an issue (or I completely missed that, in which case I'm terribly sorry)

System.ArgumentOutOfRangeException: Der Index und die Anzahl müssen sich auf eine Position in der Zeichenfolge beziehen.
Parametername: count
   bei System.String.Remove(Int32 startIndex, Int32 count)
   bei CKAN.ModuleInstaller.<>c__DisplayClass34_0.<AddParentDirectories>b__1(String dir)
   bei System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   bei System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   bei System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
   bei System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
   bei CKAN.ModuleInstaller.AddParentDirectories(HashSet`1 directories)
   bei CKAN.ModuleInstaller.Uninstall(String modName)
   bei CKAN.ModuleInstaller.AddRemove(IEnumerable`1 add, IEnumerable`1 remove, Boolean enforceConsistency)
   bei CKAN.ModuleInstaller.Upgrade(IEnumerable`1 modules, IDownloader netAsyncDownloader, Boolean enforceConsistency)
   bei CKAN.Main.InstallMods(Object sender, DoWorkEventArgs e)
   bei System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   bei System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

Google Translate: "The index and the number must refer to a position in the string."

HebaruSan commented 5 years ago

Stack trace points to this block:

https://github.com/KSP-CKAN/CKAN/blob/421332c3abf30e3cf52adc81d6cd77743c2592d2/Core/ModuleInstaller.cs#L940-L967

But if there's a call to System.String.Remove in there, it's very well hidden...

HebaruSan commented 5 years ago

Hmm, I'm able to update from AdvancedFlyByWire 1.8.1.1 to 1.8.1.3 without errors.

@Garek33 , can you please try the latest version of CKAN? 1.24.0 is fairly old, so maybe this was something that got fixed incidentally along the way.

https://github.com/KSP-CKAN/CKAN/releases/latest

Garek33 commented 5 years ago

@Garek33 , can you please try the latest version of CKAN? 1.24.0 is fairly old, so maybe this was something that got fixed incidentally along the way.

Oh, I didn't realise, I'm sorry! Using CKAN 1.25.4, both updating and removing AFBW does indeed work. Thank you very much for the quick support!