Error when updating project's project templates

Hello,
I am getting an error when attempting to update a project’s project template.

Object reference not set to an instance of an object.

From the Chrome Console, it appears the server is returning a 500 error when attempting to save the updated project template configs. I’ve tried adding a new project template, and updating an existing template. (i don’t want to delete because if it works I could delete needed data).

It is to be noted this issue appears to only happen on a single project (as far as I can tell), which indicates something about the project might be corrupted.

Octo version: v2021.1 (Build 7316)
Local installation with sql server 2016 standard.

Hey @kennethgarza,

Thanks for reaching out.

Are you able to get us the full stack trace from the Octopus Server logs to see if there is any other information in there that might be causing this? Feel free to DM me the logs for privacy reasons.

Please let me know.

Best,
Jeremy

here it is (i removed anything that would be considered sensitive)

2021-07-28 18:30:32.8311   2152    132 ERROR  Unhandled error on request: PUT https://octopus.xxxxx.xxx/api/Spaces-1/projects/Projects-501 80001704-0000-ee00-b63f-84710c7967bb by xxxxxxxxxxxx : Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Octopus.Server.Web.Api.Actions.Projects.ReleaseCreationStrategyWillBeUpdatedRule.<PackageFromABuiltInFeed>g__IsFromBuiltInFeed|12_0(PackageReference packageToCheck, <>c__DisplayClass12_0& ) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Api\Actions\Projects\ReleaseCreationStrategyWillBeUpdatedRule.cs:line 147
at Octopus.Server.Web.Api.Actions.Projects.ReleaseCreationStrategyWillBeUpdatedRule.PackageFromABuiltInFeed(PackageReferenceCollection packageReference, String packageName, IOctopusQueryExecutor queryExecutor) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Api\Actions\Projects\ReleaseCreationStrategyWillBeUpdatedRule.cs:line 132
at Octopus.Server.Web.Api.Actions.Projects.ReleaseCreationStrategyWillBeUpdatedRule.IsReleaseCreationStrategyValid(Project model, ProjectResource resource, IOctopusQueryExecutor queryExecutor)
C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Api\Actions\Projects\ReleaseCreationStrategyWillBeUpdatedRule.cs:line 100
at Octopus.Server.Web.Api.Actions.Projects.ReleaseCreationStrategyWillBeUpdatedRule.Apply(Project model, ProjectResource resource, IOctopusQueryExecutor queryExecutor) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Api\Actions\Projects\ReleaseCreationStrategyWillBeUpdatedRule.cs:line 50
at Octopus.Server.Web.Api.Actions.Projects.ProjectModifyResponder.AfterMapBeforeStore(Project model, ProjectResource resource, IOctopusRelationalTransaction transaction) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Api\Actions\Projects\ProjectModifyResponder.cs:line 96
at Octopus.Server.Web.Infrastructure.Api.CustomModifyResponder`3.ExecuteRegistered() in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Infrastructure\Api\CustomModifyResponder.cs:line 109
at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 46
at Octopus.Server.Web.Infrastructure.OctopusNancyModule.<>c__DisplayClass14_0.<get_Routes>b__1(Object o, CancellationToken x) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Infrastructure\OctopusNancyModule.cs:line 82
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\c42ca9d2b8233f1c\source\Octopus.Server\Owin\NancyMiddleware.cs:line 172
at Octopus.NancyOwin.NancyMiddleware.<>c__DisplayClass3_0.<<UseNancy>b__1>d.MoveNext() in C:\BuildAgent\work\c42ca9d2b8233f1c\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.HttpOverrides.HttpMethodOverrideMiddleware.Invoke(HttpContext context)
at Octopus.Server.Web.UnitOfWorkMiddleware.InvokeAsync(HttpContext httpContext, Lazy`1 unitOfWork, ILog log, IActionContextAccessor actionContextAccessor) in C:\BuildAgent\work\c42ca9d2b8233f1c\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\c42ca9d2b8233f1c\source\Octopus.Server\Web\UnitOfWorkMiddleware.cs:line 42
at Octopus.Server.Web.Middleware.OctopusClientOldVersionWarningMiddleware.InvokeAsync(HttpContext context, IAutomationContext automationContext) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Middleware\OctopusClientOldVersionWarningMiddleware.cs:line 38
at Octopus.Server.Web.Middleware.RequestLoggerMiddleware.InvokeAsync(HttpContext context) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Middleware\RequestLoggerMiddleware.cs:line 42
at Octopus.Server.Web.Middleware.ErrorHandlingMiddleware.InvokeAsync(HttpContext context, CorrelationId correlationId) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Server\Web\Middleware\ErrorHandlingMiddleware.cs:line 82

Hey @kennethgarza,

Thanks for the stacktrace.

I think our next best step would be to look at the JSON column for that project in the dbo.Project table. Would you be able to DM me the JSON column and look at the templates section and let me know if there’s anything there that is deprecated?

Please let me know.

Best,
Jeremy

sure, expect DM shortly

For anyone potentially finding this in the future since it was solved/worked in DMs, the cause of the issue was Auto Release Creation was at one point enabled and used, and a step was modified to stop using the built-in feed and instead use a variable. This put the project in a bad state. This is fixable by changing the step back to use the built-in feed, then go to Triggers and disable Auto Release Creation, then go change your feed back to the variable you need within your step.

Unfortunately, Auto Release Creation does not work for external feeds yet. I have passed along this feedback to our developers and will update the thread if necessary.

Best,
Jeremy

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