An item with the same key has already been added

Sonarr version (exact version): Sonarr Ver. 2.0.0.5301
Mono version (if Sonarr is not running on Windows):
OS: Docker
Debug logs:
[v2.0.0.5301] System.ArgumentException: An item with the same key has already been added. Key: Unknown
at System.Collections.Generic.Dictionary2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x0015a] in <04750267503a43e5929c1d1ba19daf3e>:0 at System.Collections.Generic.Dictionary2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <04750267503a43e5929c1d1ba19daf3e>:0
at System.Linq.Enumerable.ToDictionary[TSource,TKey] (System.Collections.Generic.IEnumerable1[T] source, System.Func2[T,TResult] keySelector, System.Collections.Generic.IEqualityComparer1[T] comparer) [0x00085] in <0a52baf64a2a4f9b96857c7b358eb12d>:0 at System.Linq.Enumerable.ToDictionary[TSource,TKey] (System.Collections.Generic.IEnumerable1[T] source, System.Func2[T,TResult] keySelector) [0x00000] in <0a52baf64a2a4f9b96857c7b358eb12d>:0 at NzbDrone.Core.Qualities.QualityDefinitionService.<GetAll>b__4_0 () [0x00000] in M:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Core\Qualities\QualityDefinitionService.cs:34 at NzbDrone.Common.Cache.Cached1[T].Get (System.String key, System.Func1[TResult] function, System.Nullable1[T] lifeTime) [0x0006a] in M:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Common\Cache\Cached.cs:81
at NzbDrone.Core.Qualities.QualityDefinitionService.GetAll () [0x00000] in M:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Core\Qualities\QualityDefinitionService.cs:34
at NzbDrone.Core.Qualities.QualityDefinitionService.Get (NzbDrone.Core.Qualities.Quality quality) [0x00000] in M:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Core\Qualities\QualityDefinitionService.cs:56
at NzbDrone.Core.DecisionEngine.Specifications.AcceptableSizeSpecification.IsSatisfiedBy (NzbDrone.Core.Parser.Model.RemoteEpisode subject, NzbDrone.Core.IndexerSearch.Definitions.SearchCriteriaBase searchCriteria) [0x00068] in M:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Core\DecisionEngine\Specifications\AcceptableSizeSpecification.cs:46
at NzbDrone.Core.DecisionEngine.DownloadDecisionMaker.EvaluateSpec (NzbDrone.Core.DecisionEngine.IDecisionEngineSpecification spec, NzbDrone.Core.Parser.Model.RemoteEpisode remoteEpisode, NzbDrone.Core.IndexerSearch.Definitions.SearchCriteriaBase searchCriteriaBase) [0x00000] in M:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Core\DecisionEngine\DownloadDecisionMaker.cs:144
Description of issue:
Tried to download another version of an episode. (Episode file had problems.) System would not automatically import due to the quality being the same as already imported. I tried a manual import, which deleted the existing file, but will not import due to the above error.

v2 hasn’t been supported in years, v4 has just been released. Make a backup first, as I’m not sure if updating straight from v2 to v4 is actually possible.

He may be better off doing a two-stage upgrade from v2 to v3 and let the schema scripts do their thing and then go from v3 to v4. He is running in docker so the images should be around to do that.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.