Object reference not set to an instance of an object

I am getting the following issue with one of the Projects that I have. Other projects appear to be fine.
I needed to update the variables for a release and I received an error. I deleted the latest release for this and tried to recreate it and received the error below. If I click on a release in the list of releases for this project, I get the same error.

Paul

Octopus v2018.7.10

Object reference not set to an instance of an object.

System.NullReferenceException
at Octopus.Server.Web.Api.Actions.ReleaseTemplateAction.<>c.b__7_3(VariableSet v)
at System.Linq.Enumerable.SelectManyIterator
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Octopus.Server.Web.Api.Actions.ReleaseTemplateAction.ExecuteRegistered(String id) at Octopus.Server.Web.Infrastructure.Api.Responder1.Respond(TDescriptor options, NancyContext context)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Octopus.Server.Web.Infrastructure.OctopusNancyModule.<>c__DisplayClass14_0.<get_Routes>b__1(Object x)
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)

Hi Paul,

Looking at the source code, I’m guessing that one of the Library Variable sets is missing it’s underlying variables.

Could you run the following query:

SELECT * 
FROM LibraryVariableSet
WHERE VariableSetId not in (SELECT id FROM VariableSet)

If that turns up some records, try editing that library variable set. If that does not work, create a new one and remove the reference to the broken one from your project.

Let me know how you go.

Hi Robert,

Yes, it was “Octopus 1.6 Variable Mappings” that were missing. I removed this from the Library Set and all is now fine.

Many thanks,

Paul

Awesome. Did you recently upgrade? Could this have been a stray document in 1.x or 2.x?

We upgraded some time ago but this is an old project that we haven’t deployed in quite from time. I suspect that it may have been broken for some time.

Paul

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