We create new variable that use channel scope
First value has one channel in scope and second value has all other channels in scope.
After that following code string begin to fail:
await repository.VariableSets.Get(deployment.ManifestVariableSetId).ConfigureAwait(false);
StackTrace:
System.AggregateException: One or more errors occurred. —> Octopus.Client.Exceptions.OctopusServerException: Octopus Server returned an error: Value cannot be null.
Parameter name: source
Server exception:
Value cannot be null.
Parameter name: source
System.ArgumentNullException
at System.Linq.Enumerable.Where[TSource](IEnumerable1 source, Func
2 predicate)
at Octopus.Server.Web.Infrastructure.Security.VariablePermissions.DeriveEnvironmentsFromChannels(IReadOnlyCollection1 allEnvironments, IList
1 allChannels, IEnumerable1 lifecycles, VariableDeclaration v, Project project) at Octopus.Server.Web.Infrastructure.Security.VariablePermissions.<>c__DisplayClass0_0.<StartPermissionCheck>b__2(VariableDeclaration v) at Octopus.Server.Web.Api.Actions.InaccessibleVariablesWillBeRemovedRule.<>c__DisplayClass18_0.<BuildViewPermissionFilter>b__0(IId x) at Octopus.Server.Web.Api.Actions.InaccessibleVariablesWillBeRemovedRule.<>c__DisplayClass13_0.<FilterVariableSetResource>b__4(VariableResource vr) at Octopus.Shared.Util.ListExtensions.RemoveWhere[TElement](IList
1 source, Func2 remove) at Octopus.Server.Web.Api.Actions.InaccessibleVariablesWillBeRemovedRule.FilterVariableSetResource(VariableSet set, VariableSetResource setResource) at Octopus.Server.Web.Infrastructure.Api.Responder
1.ExecuteRules[TRule](Action2 ruleCallback) at Octopus.Server.Web.Infrastructure.Api.LoadResponseDescriptor
2.BaseLoadResponder.Execute()
at Octopus.Server.Web.Infrastructure.Api.Responder1.ExecuteRegistered() at Octopus.Server.Web.Infrastructure.Api.Responder
1.Respond(TDescriptor options, NancyContext context)
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)at Octopus.Client.OctopusAsyncClient.d__51
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Octopus.Client.OctopusAsyncClient.<Get>d__30
1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OneInc.PolicyOne.DeploymentOne.Octopus.DeploymentsService.d__8.MoveNext() in C:\Projects\policyone.tools\Oneinc.PolicyOne.DeploymentOne\OneInc.PolicyOne.DeploymentOne\Octopus\DeploymentsService.cs:line 100
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at OneInc.PolicyOne.DeploymentOne.Octopus.DeploymentsService.d__7.MoveNext() in C:\Projects\policyone.tools\Oneinc.PolicyOne.DeploymentOne\OneInc.PolicyOne.DeploymentOne\Octopus\DeploymentsService.cs:line 77
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OneInc.PolicyOne.DeploymentOne.Octopus.DeploymentsService.d__6.MoveNext() in C:\Projects\policyone.tools\Oneinc.PolicyOne.DeploymentOne\OneInc.PolicyOne.DeploymentOne\Octopus\DeploymentsService.cs:line 49
— End of inner exception stack trace —
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at OneInc.PolicyOne.DeploymentOne.RecurringJobs.GetDeploymentsRecurringJob.Execute(PerformContext context) in C:\Projects\policyone.tools\Oneinc.PolicyOne.DeploymentOne\OneInc.PolicyOne.DeploymentOne\RecurringJobs\GetDeploymentsRecurringJob.cs:line 23
—> (Inner Exception #0) Octopus.Client.Exceptions.OctopusServerException: Octopus Server returned an error: Value cannot be null.
Parameter name: source
Server exception:
Value cannot be null.
Parameter name: source
System.ArgumentNullException
at System.Linq.Enumerable.Where[TSource](IEnumerable1 source, Func
2 predicate)
at Octopus.Server.Web.Infrastructure.Security.VariablePermissions.DeriveEnvironmentsFromChannels(IReadOnlyCollection1 allEnvironments, IList
1 allChannels, IEnumerable1 lifecycles, VariableDeclaration v, Project project) at Octopus.Server.Web.Infrastructure.Security.VariablePermissions.<>c__DisplayClass0_0.<StartPermissionCheck>b__2(VariableDeclaration v) at Octopus.Server.Web.Api.Actions.InaccessibleVariablesWillBeRemovedRule.<>c__DisplayClass18_0.<BuildViewPermissionFilter>b__0(IId x) at Octopus.Server.Web.Api.Actions.InaccessibleVariablesWillBeRemovedRule.<>c__DisplayClass13_0.<FilterVariableSetResource>b__4(VariableResource vr) at Octopus.Shared.Util.ListExtensions.RemoveWhere[TElement](IList
1 source, Func2 remove) at Octopus.Server.Web.Api.Actions.InaccessibleVariablesWillBeRemovedRule.FilterVariableSetResource(VariableSet set, VariableSetResource setResource) at Octopus.Server.Web.Infrastructure.Api.Responder
1.ExecuteRules[TRule](Action2 ruleCallback) at Octopus.Server.Web.Infrastructure.Api.LoadResponseDescriptor
2.BaseLoadResponder.Execute()
at Octopus.Server.Web.Infrastructure.Api.Responder1.ExecuteRegistered() at Octopus.Server.Web.Infrastructure.Api.Responder
1.Respond(TDescriptor options, NancyContext context)
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)at Octopus.Client.OctopusAsyncClient.d__51
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Octopus.Client.OctopusAsyncClient.<Get>d__30
1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OneInc.PolicyOne.DeploymentOne.Octopus.DeploymentsService.d__8.MoveNext() in C:\Projects\policyone.tools\Oneinc.PolicyOne.DeploymentOne\OneInc.PolicyOne.DeploymentOne\Octopus\DeploymentsService.cs:line 100
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at OneInc.PolicyOne.DeploymentOne.Octopus.DeploymentsService.d__7.MoveNext() in C:\Projects\policyone.tools\Oneinc.PolicyOne.DeploymentOne\OneInc.PolicyOne.DeploymentOne\Octopus\DeploymentsService.cs:line 77
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Anyone can explain what going wrong?
Octopus version:
v2018.6.15 installed on Windows Server 2016