The given key was not present in the dictionary

reliability
server
known
(Daniel Haigh) #1

I sent an email to support@octopus.com this morning regarding an error we’re experiencing on our v2018.9.0 instance:

The given key was not present in the dictionary
System.Collections.Generic.KeyNotFoundException
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

The issue appears to have begun when a user added a parameter to a step template and then updated his project to use that parameter but provided an incorrect value in the process.

Accessing the affected project directly via the API yields the same result, and I am unclear how to proceed with removing the offending reference. I noted several similar cases here in the forums, but providing a DB backup to support appeared to be the first step in resolution in all of those.

Full exception text:
{
“ErrorMessage”: “The given key was not present in the dictionary.”,
“FullException”: “The given key was not present in the dictionary.\r\nSystem.Collections.Generic.KeyNotFoundException\r\n at System.Collections.Generic.Dictionary2.get_Item(TKey key)\r\n at Octopus.Server.Web.Mapping.DeploymentActionPackageNameMapper.MapToNames(String projectId, IEnumerable1 models)\r\n at Octopus.Server.Web.Mapping.DeploymentActionPackageNameMapper.MapToNames(String projectId, DeploymentActionPackage model)\r\n at Octopus.Server.Web.Mapping.ResourceMappings.<>c.b__9_40(Project project, ProjectResource resource, IResourceMappingContext ctx, IResourceMapper mapper, AllRoutes routes)\r\n at Octopus.Server.Web.Mapping.ActionResourceEnricher2.EnrichResource(TModel model, TResource resource)\r\n at Octopus.Server.Extensibility.HostServices.Infrastructure.EnumerableExtensions.ForEach[T](IEnumerable1 these, Action1 action)\r\n at Octopus.Server.Web.Mapping.ResourceMapper.ModelToResource(Object model, Object resource, Boolean detailed, IResourceMapping resourceMapping)\r\n at Octopus.Server.Web.Mapping.ResourceMapper.<>c__DisplayClass4_0.<ConvertTo>b__0(IResourceMapping mapping)\r\n at Octopus.Server.Web.Mapping.ResourceMapper.ConvertTo[TResource](Object model, ResourceMapperMode mode)\r\n at Octopus.Server.Web.Infrastructure.Api.LoadResponseDescriptor2.BaseLoadResponder.Execute()\r\n at Octopus.Server.Web.Infrastructure.Api.Responder1.ExecuteRegistered()\r\n at Octopus.Server.Web.Infrastructure.Api.Responder1.Respond(TDescriptor options, NancyContext context)\r\n at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)\r\n at CallSite.Target(Closure , CallSite , Object , Object , NancyContext )\r\n at Octopus.Server.Web.Infrastructure.OctopusNancyModule.<>c__DisplayClass14_0.<get_Routes>b__1(Object x)\r\n at CallSite.Target(Closure , CallSite , Func`2 , Object )\r\n at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)”
}

(Tina) closed #4