Hi,
I’m using v2021.3 build 8275. I have a step template that is used by 3 projects and I made changes to the step template. When I click update or update all to propagate the changes to one or more projects I’m seeing this error:
Value cannot be null. (Parameter ‘key’)
Can you help?
2021-12-05 23:08:59.6218 3084 5 ERROR Unhandled error on request: POST http://<my octopus server>/api/Spaces-1/actiontemplates/ActionTemplates-21/actionsUpdate 800151fb-0001-f500-b63f-84710c7967bb by username : Value cannot be null. (Parameter 'key')
System.ArgumentNullException: Value cannot be null. (Parameter 'key')
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at Octopus.Server.Web.Api.Actions.DeploymentActionUpdate.DeploymentActionUpdater.AssertNoRemovedPackagesInUse(DeploymentActionToUpdate subject, ActionTemplateBase targetVersion, ActionTemplateVersion currentVersion) in ./source/Octopus.Server/Web/Api/Actions/DeploymentActionUpdate/DeploymentActionUpdater.cs:line 204
at Octopus.Server.Web.Api.Actions.DeploymentActionUpdate.DeploymentActionUpdater.Update(DeploymentActionToUpdate subject, ActionTemplateBase targetVersion, ILog log, ActionTemplateVersion currentVersion, Dictionary`2 defaultPropertyValues, Dictionary`2 overrides) in ./source/Octopus.Server/Web/Api/Actions/DeploymentActionUpdate/DeploymentActionUpdater.cs:line 49
at Octopus.Server.Web.Api.Actions.DeploymentActionUpdate.ActionTemplateActionsUpdater.<>c__DisplayClass14_0.<Update>b__16(DeploymentActionToUpdate a) in ./source/Octopus.Server/Web/Api/Actions/DeploymentActionUpdate/ActionTemplateActionsUpdater.cs:line 115
at System.Linq.Enumerable.SelectListIterator`2.ToArray()
at Octopus.Server.Web.Api.Actions.DeploymentActionUpdate.ActionTemplateActionsUpdater.Update(String actionTemplateId, ActionsUpdateResource input, ILog log, CancellationToken token)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
at Octopus.Core.Extensions.TaskExtensionMethods.AsSync[T](Task`1 task) in ./source/Octopus.Core/Extensions/TaskExtensionMethods.cs:line 22
at Octopus.Server.Web.Api.Actions.DeploymentActionUpdate.ActionTemplateActionsUpdateResponder.ExecuteRegistered(String actionTemplateId) in ./source/Octopus.Server/Web/Api/Actions/DeploymentActionUpdate/ActionTemplateActionsUpdateResponder.cs:line 66
at Octopus.Server.Web.Infrastructure.Api.CustomActionWithIdResponder`1.ExecuteRegistered() in ./source/Octopus.Server/Web/Infrastructure/Api/CustomActionResponder.cs:line 46
at Octopus.Server.Web.Infrastructure.Api.CustomResponder`1.Respond(TDescriptor options, NancyContext context) in ./source/Octopus.Server/Web/Infrastructure/Api/CustomResponder.cs:line 289
at Octopus.Server.Web.Infrastructure.OctopusNancyModule.<>c__DisplayClass13_0.<get_Routes>b__1(Object _, CancellationToken _) in ./source/Octopus.Server/Web/Infrastructure/OctopusNancyModule.cs:line 75
at Nancy.Routing.Route`1.Invoke(DynamicDictionary parameters, CancellationToken cancellationToken)
at Nancy.Routing.DefaultRouteInvoker.Invoke(Route route, CancellationToken cancellationToken, DynamicDictionary parameters, NancyContext context)
at Nancy.Routing.DefaultRequestDispatcher.Dispatch(NancyContext context, CancellationToken cancellationToken)
at Nancy.NancyEngine.InvokeRequestLifeCycle(NancyContext context, CancellationToken cancellationToken, IPipelines pipelines)
at Octopus.NancyOwin.NancyMiddleware.RequestComplete(NancyContext context, IDictionary`2 environment, CancellationToken cancellationToken) in ./source/Octopus.Server/Owin/NancyMiddleware.cs:line 171
at Octopus.NancyOwin.NancyMiddleware.<>c__DisplayClass3_0.<<UseNancy>b__1>d.MoveNext() in ./source/Octopus.Server/Owin/NancyMiddleware.cs:line 111
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Owin.WebSocketAcceptAdapter.<>c__DisplayClass6_0.<<AdaptWebSockets>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.HttpOverrides.HttpMethodOverrideMiddleware.Invoke(HttpContext context)
at Octopus.Server.Web.UnitOfWorkMiddleware.InvokeAsync(HttpContext httpContext, IUnitOfWork unitOfWork) in ./source/Octopus.Server/Web/UnitOfWorkMiddleware.cs:line 47
at Octopus.Server.Web.UnitOfWorkMiddleware.InvokeAsync(HttpContext httpContext, IUnitOfWork unitOfWork) in ./source/Octopus.Server/Web/UnitOfWorkMiddleware.cs:line 47
at Octopus.Server.Web.Middleware.OctopusClientOldVersionWarningMiddleware.InvokeAsync(HttpContext context, IAutomationContext automationContext) in ./source/Octopus.Server/Web/Middleware/OctopusClientOldVersionWarningMiddleware.cs:line 38
at Octopus.Server.Web.Middleware.DynamicContentHeadersMiddleware.InvokeAsync(HttpContext context) in ./source/Octopus.Server/Web/Middleware/DynamicContentHeadersMiddleware.cs:line 48
at Octopus.Server.Web.Middleware.MaintenanceModeMiddleware.InvokeAsync(HttpContext context) in ./source/Octopus.Server/Web/Middleware/MaintenanceModeMiddleware.cs:line 55
at Octopus.Server.Web.Middleware.OctopusAuthenticationMiddleware.InvokeAsync(HttpContext context, CorrelationId correlationId) in ./source/Octopus.Server/Web/Middleware/OctopusAuthenticationMiddleware.cs:line 67
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Octopus.Server.Web.Middleware.RequestLoggerMiddleware.InvokeAsync(HttpContext context) in ./source/Octopus.Server/Web/Middleware/RequestLoggerMiddleware.cs:line 42
at Octopus.Server.Web.Middleware.TelemetryMiddleware.InvokeAsync(HttpContext context, CorrelationId correlationId) in ./source/Octopus.Server/Web/Middleware/TelemetryMiddleware.cs:line 75
at Octopus.Server.Web.Middleware.ErrorHandlingMiddleware.InvokeAsync(HttpContext context, CorrelationId correlationId) in ./source/Octopus.Server/Web/Middleware/ErrorHandlingMiddleware.cs:line 103
Thanks for reaching out, sorry to hear you’re having troubles updating a particular Step Template!
It seems most likely that you have encountered this recently closed issue which outlines that this error can occur when a Channel version rule refers to the Step being updated.
A fix for this issue will be included in version 2021.3.9124 which should be available in the very near future. However, if you would like to update these projects without waiting for the build to be released, then possibly reviewing the Channels Package Version Rules to see if they include the Step being updated, and if so, removing that association until they have been updated successfully.
Feel free to reach out if this doesn’t help resolve the issue or you have any questions!
Hi,
I removed the channel package version rule and I could update the template, thank you. I’ll use this workaround until 2021.3.9124 is released.
Regards,
Gabriele