We just upgraded to 2020.6.4671 release. Currently when we try to deploy a release using octo.exe deploy-release command, we are getting the following:
Found environment: xxx (Environments-2)
Found project: xxx (Projects-382)
Finding release xxx
Updating the release variable snapshot with variables from the project
Found environment: xxx (Environments-2)
Octopus Server returned an error: Object reference not set to an instance of an object.
Error from Octopus Server (HTTP 500 InternalServerError)
I found the exception stack trace in system log. Any idea what the cause may be/places to check? The project requires at least 1 target and as far as I know we have a healthy server as target.
System.NullReferenceException: Object reference not set to an instance of an object.
at Octopus.Server.Orchestration.ServerTasks.Deploy.DeploymentFactory.AllowDeploymentsToNoTargets(Release release) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Orchestration\ServerTasks\Deploy\DeploymentFactory.cs:line 557
at Octopus.Server.Orchestration.ServerTasks.Deploy.ExecutionFactory`3.CreateExecution(IOctopusQueryExecutor queryExecutor, TExecution execution, User user, DateTimeOffset queueTime, Nullable`1 queueTimeExpiry, IEnumerable`1 additionalVariables, IPromptedVariableValueProvider promptedVariableValueProvider, Boolean isScheduledDeployment, TCreateInfo createInfo) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Orchestration\ServerTasks\Deploy\ExecutionFactory.cs:line 139
at Octopus.Server.Orchestration.ServerTasks.Deploy.DeploymentFactory.CreateDeployment(IOctopusQueryExecutor queryExecutor, Deployment deployment, User user, DateTimeOffset queueTime, Nullable`1 queueTimeExpiry, ILifecycleProgressionEvaluator lifecycleProgressionEvaluator, ILifecycleService lifecycleService, IDeploymentSummaryService deploymentSummaryService, IEnumerable`1 additionalVariables, IPromptedVariableValueProvider promptedVariableValueProvider, Boolean isScheduledDeployment) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Orchestration\ServerTasks\Deploy\DeploymentFactory.cs:line 107
at Octopus.Server.Web.Api.Actions.DeploymentCreateAction.CreateDeployment(DeploymentResource resource, DateTimeOffset queueTime, Boolean isScheduledDeployment, IOctopusPrincipalInternal principal, User user, IPromptedVariableValueProvider promptedVariableValueProvider, IEnumerable`1 additionalVariables) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Web\Api\Actions\DeploymentCreateAction.cs:line 104
at Octopus.Server.Web.Api.Actions.DeploymentCreateAction.ExecuteRegistered() in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Web\Api\Actions\DeploymentCreateAction.cs:line 82
at Octopus.Server.Web.Infrastructure.Api.CustomResponder`1.Respond(TDescriptor options, NancyContext context) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Web\Infrastructure\Api\CustomResponder.cs:line 289
at Octopus.Server.Web.Infrastructure.OctopusNancyModule.<>c__DisplayClass14_0.<get_Routes>b__1(Object o, CancellationToken x) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Web\Infrastructure\OctopusNancyModule.cs:line 81
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) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Owin\NancyMiddleware.cs:line 172
at Octopus.NancyOwin.NancyMiddleware.<>c__DisplayClass3_0.<<UseNancy>b__1>d.MoveNext() in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Owin\NancyMiddleware.cs:line 108
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Owin.WebSocketAcceptAdapter.<>c__DisplayClass6_0.<<AdaptWebSockets>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
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, Lazy`1 unitOfWork, ILog log, IActionContextAccessor actionContextAccessor) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Web\UnitOfWorkMiddleware.cs:line 42
at Octopus.Server.Web.UnitOfWorkMiddleware.InvokeAsync(HttpContext httpContext, Lazy`1 unitOfWork, ILog log, IActionContextAccessor actionContextAccessor) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Web\UnitOfWorkMiddleware.cs:line 42
at Octopus.Server.Web.Middleware.OctopusClientOldVersionWarningMiddleware.InvokeAsync(HttpContext context, IAutomationContext automationContext) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Web\Middleware\OctopusClientOldVersionWarningMiddleware.cs:line 38
at Octopus.Server.Web.Middleware.RequestLoggerMiddleware.InvokeAsync(HttpContext context) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Web\Middleware\RequestLoggerMiddleware.cs:line 42
at Octopus.Server.Web.Middleware.ErrorHandlingMiddleware.InvokeAsync(HttpContext context, CorrelationId correlationId) in C:\BuildAgent\work\b5c671f6c6f2b660\source\Octopus.Server\Web\Middleware\ErrorHandlingMiddleware.cs:line 70