Skip to content

Cannot update project process when auto create release is true and release creation strategy is missing #9483

@bec-callow-oct

Description

@bec-callow-oct

Severity

Not known to be blocking any customers, a workaround exists

Version

Earliest tried was 2025.2.12938, still exists in 2025.3.4207

Latest Version

I could reproduce the problem in the latest build

What happened?

When AutoReleaseCreate is set to true on project creation, ReleaseCreationStrategy.ReleaseCreationPackage does not get set as it isn't expected when the project is initially created.

When the deployment process is updated and AutoCreateRelease is true, we attempt to access ReleaseCreationStrategy.ReleaseCreationPackage.DeploymentActionId, which fails because the package is null.

This issue cannot be resolved by updating the ReleaseCreationPackage data on the project because this requires an existing package deployment step.

Reproduction

  1. Create a project via the API (or terraform) with AutoCreateRelease: true. This issue does not occur when modifying an existing project.
  2. Attempt to add a step to the project process.
  3. The request fails with an exception.

Error and Stacktrace

Request took 3317ms
�"HTTP" "PUT" to "localhost:8080""/api/Spaces-2/variables/variableset-Projects-8" "completed" with 200 in 00:00:03.3182423 (3318ms) by "admin""HTTP" "GET" to "localhost:8080""/api/Spaces-2/variables/variableset-Projects-8" "completed" with 200 in 00:00:00.0502709 (50ms) by "admin""HTTP" "GET" to "localhost:8080""/api/octopusservernodes/ping" "completed" with 200 in 00:00:00.0153269 (15ms) by """HTTP" "GET" to "localhost:8080""/api/octopusservernodes/ping" "completed" with 200 in 00:00:00.0107625 (10ms) by """HTTP" "GET" to "localhost:8080""/api/Spaces-2/variables/variableset-Projects-8" "completed" with 200 in 00:00:00.0489416 (48ms) by "admin"
Unhandled error on request: "Object reference not set to an instance of an object."
System.NullReferenceException: Object reference not set to an instance of an object.
at Octopus.Core.Validation.DeploymentProcessValidator.ValidateDeploymentProcessChangeDoesNotImpactArcSettings(DeploymentProcess deploymentProcess, IRawRelationalTransaction t, CustomContext context) in ./source/Octopus.Core/Validation/DeploymentProcessValidator.cs:line 128
� at Octopus.Core.Validation.DeploymentProcessValidator.<>c__DisplayClass9_0.b__9(IRawRelationalTransaction t) in ./source/Octopus.Core/Validation/DeploymentProcessValidator.cs:line 97
� at Octopus.Core.Validation.DeploymentProcessValidator.ExecuteInTransaction(Action1 action) in ./source/Octopus.Core/Validation/DeploymentProcessValidator.cs:line 117 �   at Octopus.Core.Validation.DeploymentProcessValidator.<AddRules>b__9_7(DeploymentProcess deploymentProcess, CustomContext context) in ./source/Octopus.Core/Validation/DeploymentProcessValidator.cs:line 94 �   at FluentValidation.Validators.CustomValidator1.Validate(PropertyValidatorContext context) in /home/jskinner/code/FluentValidation/src/FluentValidation/Validators/CustomValidator.cs:line 41
� at FluentValidation.Internal.PropertyRule.InvokePropertyValidator(ValidationContext context, IPropertyValidator validator, String propertyName) in /home/jskinner/code/FluentValidation/src/FluentValidation/Internal/PropertyRule.cs:line 423
� at FluentValidation.Internal.PropertyRule.Validate(ValidationContext context)+MoveNext() in /home/jskinner/code/FluentValidation/src/FluentValidation/Internal/PropertyRule.cs:line 282
at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
� at FluentValidation.AbstractValidator1.Validate(ValidationContext1 context) in /home/jskinner/code/FluentValidation/src/FluentValidation/AbstractValidator.cs:line 115
� at FluentValidation.AbstractValidator1.Validate(T instance) in /home/jskinner/code/FluentValidation/src/FluentValidation/AbstractValidator.cs:line 83 at Octopus.Core.Model.Projects.Updaters.UpdatedDeploymentProcessValidator.ValidateUpdatedProcess(ProjectReference projectReference, List1 originalSteps, DeploymentProcess updatedDeploymentProcess) in ./source/Octopus.Core/Model/Projects/Updaters/UpdatedDeploymentProcessValidator.cs:line 28
at Octopus.Core.Model.Projects.Updaters.DeploymentProcessUpdaterAndValidator.UpdateAndValidate(DeploymentProcess process, DeploymentProcessResource resource, ProjectReference projectReference, CancellationToken cancellationToken) in ./source/Octopus.Core/Model/Projects/Updaters/DeploymentProcessUpdaterAndValidator.cs:line 52
at Octopus.Core.Features.DeploymentProcesses.Ocl.ModifyDeploymentProcessCommandHandler.HandleInternal(ProjectReference projectReference, IModifyDeploymentProcessCommand command, CancellationToken cancellationToken) in ./source/Octopus.Core/Features/DeploymentProcesses/Ocl/ModifyDeploymentProcessCommandHandler.cs:line 102
at Octopus.Core.Features.DeploymentProcesses.Ocl.ModifyDeploymentProcessCommandHandler.Handle(ModifyDeploymentProcessInDatabaseCommand command, CancellationToken cancellationToken) in ./source/Octopus.Core/Features/DeploymentProcesses/Ocl/ModifyDeploymentProcessCommandHandler.cs:line 56
� at Octopus.Core.Infrastructure.Mediator.AutofacMediator.Do[TCommand,TResponse](ICommand2 command, CancellationToken cancellationToken) in ./source/Octopus.Core/Infrastructure/Mediator/AutofacMediator.cs:line 33 at Octopus.Core.Infrastructure.Mediator.Decorators.SystemComponentModelValidationDecorator.Do[TCommand,TResponse](ICommand2 command, CancellationToken cancellationToken) in ./source/Octopus.Core/Infrastructure/Mediator/Decorators/SystemComponentModelValidationDecorator.cs:line 28
at Octopus.Core.Infrastructure.Mediator.Decorators.FluentValidationsDecorator.Do[TCommand,TResponse](ICommand2 command, CancellationToken cancellationToken) in ./source/Octopus.Core/Infrastructure/Mediator/Decorators/FluentValidationsDecorator.cs:line 35 at Octopus.Core.Infrastructure.Mediator.Decorators.MessageBusSiphoningDecorator.Do[TCommand,TResponse](ICommand2 command, CancellationToken cancellationToken) in ./source/Octopus.Core/Infrastructure/Mediator/Decorators/MessageBusSiphoningDecorator.cs:line 32
at Octopus.Server.Web.Controllers.DeploymentProcesses.ModifyDeploymentProcessController.ModifyDeploymentProcessInDatabase(ModifyDeploymentProcessInDatabaseCommand command, CancellationToken cancellationToken) in ./source/Octopus.Server/Web/Controllers/DeploymentProcesses/ModifyDeploymentProcessController.cs:line 118
at lambda_method24433(Closure, Object)
� at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
� at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)
� at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
� at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
� at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
� at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
� at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
� at Octopus.Server.Web.Middleware.BoundaryTrailerRewriteMiddleware.Invoke(HttpContext context, IAutomationContext automationContext) in ./source/Octopus.Server/Web/Middleware/BoundaryTrailerRewriteMiddleware.cs:line 45
� at Octopus.Server.Web.Middleware.OpenFeatureUserContextMiddleware.InvokeAsync(HttpContext httpContext, IOctopusPrincipalInternal principal, IFeatureClient client) in ./source/Octopus.Server/Web/Middleware/OpenFeatureUserContextMiddleware.cs:line 30
at Octopus.Server.Web.Infrastructure.Authentication.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult) in ./source/Octopus.Server/Web/Infrastructure/Authentication/AuthorizationMiddlewareResultHandler.cs:line 50
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
� at Octopus.Server.Web.UnitOfWorkMiddleware.InvokeAsync(HttpContext httpContext, IUnitOfWork unitOfWork) in ./source/Octopus.Server/Web/UnitOfWorkMiddleware.cs:line 31
at Octopus.Server.Web.UnitOfWorkMiddleware.InvokeAsync(HttpContext httpContext, IUnitOfWork unitOfWork)
� at Octopus.Server.Web.Middleware.OctopusClientOldVersionWarningMiddleware.InvokeAsync(HttpContext context, IAutomationContext automationContext) in ./source/Octopus.Server/Web/Middleware/OctopusClientOldVersionWarningMiddleware.cs:line 24
� at Octopus.Server.Web.Middleware.DynamicContentHeadersMiddleware.InvokeAsync(HttpContext context) in ./source/Octopus.Server/Web/Middleware/DynamicContentHeadersMiddleware.cs:line 50
� at Octopus.Server.Web.Middleware.MaintenanceModeMiddleware.InvokeAsync(HttpContext context) in ./source/Octopus.Server/Web/Middleware/MaintenanceModeMiddleware.cs:line 66
at Octopus.Server.Web.Middleware.OctopusAuthenticationMiddleware.InvokeAsync(HttpContext context, IUserAuthenticator userAuthenticator, IUserSessionService userSessionService, IWebAuthCache authCache, ILogger logger) in ./source/Octopus.Server/Web/Middleware/OctopusAuthenticationMiddleware.cs:line 70
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
� at Octopus.Server.Web.Middleware.TelemetryMiddleware.InvokeAsync(HttpContext context) in ./source/Octopus.Server/Web/Middleware/TelemetryMiddleware.cs:line 64
� at Octopus.Server.Web.Middleware.ErrorHandlingMiddleware.InvokeAsync(HttpContext context) in ./source/Octopus.Server/Web/Middleware/ErrorHandlingMiddleware.cs:line 47
�"HTTP" "PUT" to "localhost:8080""/api/Spaces-2/projects/Projects-8/deploymentprocesses" "completed" with 500 in 00:00:00.0867130 (86ms) by "admin""HTTP" "PUT" to "localhost:8080""/api/Spaces-2/variables/variableset-Projects-8" "completed" with 200 in 00:00:00.1063490 (106ms) by "admin""HTTP" "GET" to "localhost:8080""/api/octopusservernodes/ping" "completed" with 200 in 00:00:00.0182738 (18ms) by ""

More Information

The Octopus Server UI does not display triggers correctly for the broken project.

No triggers are listed on the Triggers page
Image

No built-in feed trigger can be created because one already exists
Image

Workaround

  1. Update the project to have AutoCreateRelease false to allow you to edit the process. This must be done via the API as the Server UI does not display triggers correctly for the broken project.
  2. Configure a package step in the project deployment process (this can be done via the UI if preferred).
  3. Add a new auto release creation trigger.

Metadata

Metadata

Assignees

Labels

kind/bugThis issue represents a verified problem we are committed to solving

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions