• 0
James3838

Bug Report: ArgumentException: An element with the same key already exists in the dictionary

Question

Not sure if this is from KSP or MOD (most mods I use log with tag so guessing KSP):


ScaleModList: listSize 164 maxListSize 1643
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

[MessageSystem] Reposition 0.02 12205
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

ArgumentException: An element with the same key already exists in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.Type,System.Int32].Add (System.Type key, Int32 value) [0x00000] in <filename unknown>:0
  at Contracts.ContractSystem.LoadContractWeights (.ConfigNode gameNode) [0x00000] in <filename unknown>:0
  at Contracts.ContractSystem+<OnLoadRoutine>c__Iterator80.MoveNext () [0x00000] in <filename unknown>:0 

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

I have a similar error on my KSP.log when I load a 1.1.2 game in my 1.1.3 installation.

The games loads almost fine but all my past contracts (finished and active) are removed.

I really don't know which mod is causing this, but this is a tough one: if I start removing mods to find out which is causing this I will also start losing ships that require those mods.

Anyone else had this problem?

Eventually I will have to remove mods and start my game again and again, but I prefer to ask first in case someone else has done this already and can help me narrowing the problem (I'm talking of about 200 mods running)

 

Share this post


Link to post
Share on other sites
  • 0

I just encountered this today with 1.2, and have started to diagnose it.

 

In a totally stock game it's fine, but adding in my mods breaks it - the weird thing is that it was working fine this morning, and all of a sudden it broke on me.

I can go into the admin building, or the cheat menu and accept a contract, but when I enter the VAB or load a new game - poof.  Gone.  I have not checked all of the buildings.

 

Spoiler

[EXC 21:47:38.009] ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[System.String,System.Int32].Add (System.String key, Int32 value)
    Contracts.ContractSystem.LoadContractWeights (.ConfigNode gameNode)
    Contracts.ContractSystem+<OnLoadRoutine>c__Iterator9A.MoveNext ()
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)

 

Edited by sentania

Share this post


Link to post
Share on other sites
  • 0

I have done some further digging, and like the UI flickering issue, I've seen in game and referenced in the forums, this appears to be something related to the stock game, but triggered by mods, most likely volume of parts.

Scenario:

1.2 with the following mods installed, all mods are up to date relative to themselves.

Spoiler

 

Mod DLLs found:

Stock assembly: Assembly-CSharp v1.0.0.0

ModuleManager.2.7.1 v2.7.1.0

aaa_Toolbar v1.0.0.0 / v1.7.13.0

USITools v1.0.0.0

B9PartSwitch v1.5.1.0

BetterBurnTime v1.0.0.0

CCK v1.0.0.0

MiniAVC v1.0.3.0

ContractConfigurator v1.0.0.0 / v1.20.2

UnmannedContracts v1.0.5980.31793

MiniAVC v1.0.3.0

SimpleBoiloff v0.2.1.0

DeployableEngines v2.0.0.0

AGExt v1.0.0.0

kOSVoidAction v1.0.0.0

DistantObject v1.8.1.12781

DMagic v1.3.0.4 / vv1.3.4

DMModuleScienceAnimateGeneric v0.15.0.0

Atmosphere v1.5.6131.22338 / v1.0.0.0

CelestialShadows v1.5.6131.22338 / v1.0.0.0

CityLights v1.5.6131.22338 / v1.0.0.0

EVEManager v1.5.6131.22338 / v1.0.0.0

PartFX v1.5.6131.22338 / v1.0.0.0

PQSManager v1.5.6131.22338 / v1.0.0.0

ShaderLoader v1.5.6131.22337 / v1.0.0.0

Terrain v1.5.6131.22338 / v1.0.0.0

TextureConfig v1.5.6131.22338 / v1.0.0.0

Utils v1.5.6131.22337 / v1.0.0.0

_BuildManager v1.5.6131.22338 / v1.0.0.0

Launchpad v5.5.1.0 / v5.5.1

Firespitter v7.3.6128.14258

MiniAVC v1.0.3.0

MiniAVC v1.0.3.2

JSIAdvTransparentPods v0.1.9.0

RasterPropMonitor v0.28.0.29319

KAS v0.6.0.0 / v0.6.0 for KSP 1.2

CLSInterfaces v1.0.0.0

KeepFit v0.11.8.7

MiniAVC v1.0.3.0

MiniAVC v1.0.3.0

KerbalEngineer v1.1.2.2

KerbalEngineer.Unity v1.0.0.0

KerbalJointReinforcement v3.3.0.0

HyperEdit v1.5.3.0

KIS v1.3.0.0 / v1.3.0 for KSP 1.2

KSPDev_Utils v0.14.0.0 / v0.14.0 for KSP v1.2

ModularFlightIntegrator v1.0.0.0 / v1.2.1.0

Kopernicus.Components v1.0.0.0

Kopernicus.OnDemand v1.0.0.0

Kopernicus v1.0.0.0

KSP-AVC v1.1.6.2

AnimatedIntakes v1.0.0.0

TweakableAnimator v1.0.0.0

MiniAVC v1.0.3.0

MechJeb2 v2.5.1.0 / vDev #644 Sarbian / v2.5.9.0

DockingPortAlignmentIndicator v1.0.0.0

DPAI_RPM v1.0.0.0

ModuleDockingNodeNamed v1.0.0.0

MiniAVC v1.0.3.0

NearFutureElectrical v1.0.0.0

MiniAVC v1.0.3.0

NearFuturePropulsion v0.7.5.12674 / v0.7.5.*

MiniAVC v1.0.3.0

NearFutureSolar v0.4.0.0

MiniAVC v1.0.3.0

MiniAVC v1.0.3.0

PlanetarySurfaceStructures v1.3.1.25

ProceduralFairings v0.0.3.17

RCSBuildAid v0.9.6128.36948

RemoteTech v1.8.0.0 / v1.8.0

DeepFreeze v0.23.0.0

SCANsat v1.6.0.9 / vv16.9

scatterer v1.0.6134.38560

StageRecovery v1.6.6.0

MiniAVC v1.0.3.0

SurfaceLights v1.3.0.0 / v1.3.0 for KSP v1.2

TarsierSpaceTech v6.5.0.0

MiniAVC v1.0.3.2

TimeControl v2.2.6136.37227 / v2.3.0

KerbalAlarmClock v3.8.0.0

DynamicTanks v1.0.0.0

Konstruction v0.0.0.0

USILifeSupport v1.0.0.0

KolonyTools v1.0.0.0

AirbagTools v1.0.0.0

FloaterTools v1.0.0.0

Lifeboat v0.1.2.0

WarpEngine v1.0.0.0

[x] Science! v5.0.6130.17789

 

*If* I load the game (1.2 x64), with said mod list, but with the KSP 1.1.3 compatible release of the @Nertea suite, things function as expected.

*If* I load the game (1.2 x64), with said mod list, but without the 1.2 compatible release of the Nertea suite, things function as expected.

*If* load the game (1.2 x64), with *only* the 1.2 compatible release of the Nertea suite, and it’s requirements, things function as expected.

*If* load the game (1.2 x64), with all mods listed above, but with the 1.2 compatible release of the Nertea suite, things do not function as expected.

I observe the following issues:

When you load a game, all active, offered, and your completed contract history reset.

When you enter the VAB, all active, offered, and your completed contract history reset.

This is the error message logged when the contract history is reset:

Spoiler

[EXC 21:47:38.009] ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[System.String,System.Int32].Add (System.String key, Int32 value)
    Contracts.ContractSystem.LoadContractWeights (.ConfigNode gameNode)
    Contracts.ContractSystem+<OnLoadRoutine>c__Iterator9A.MoveNext ()
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)

 

We’d have to see what nertea changed in this release, but having parsed his files, I’m guessing a lot more tags or some such – resulting in an overload of something somewhere.

The bug tracker appears down at the moment otherwise this would be in there.

Edit: Figures that now I go and throw all the mods back together, fire things up and it's behaving normally.  SMH.  I'll play around with it some more if no one else sees anything related to this, or if it crops up some more.

 

Edit 2: There it is again.  It's definitely a function of how many parts are displayed in the VAB.  Toppled tech tree = sorry.  Fresh, super low tech game, no issues.

Edited by sentania
tag nertea damnit

Share this post


Link to post
Share on other sites
  • 0

Edit: In my case it's a bug with Cryogenic Tanks mod, followed the modder's instructions, deleted some plugins, and now contracts are working 100%.

 

 

Confirm, it's happening to me too. In my case, it's when I install Cryogenic Tanks & Kerbal Atomics. No need to have many parts unlocked in the tech tree, if I install these mods and start a new Career, accepted contracts will immediately dissappear when going into VAB, SPH, or launch pad.  

 

Spoiler

[EXC 22:44:23.027] ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[System.String,System.Int32].Add (System.String key, Int32 value)
    Contracts.ContractSystem.LoadContractWeights (.ConfigNode gameNode)
    Contracts.ContractSystem+<OnLoadRoutine>c__Iterator9A.MoveNext ()
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)

I remove these two mods and contracts are fine again. I don't get disappeared contracts back, but new ones I accept no longer disappear.

 

 

Edited by lokodehortaleza
Found solution

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.