Octo.exe Import of project with Channel Rule with Tag filter

When successfully exporting using Octo.exe we encountered the following exception when importing a project with Channel Rules with Tag filters.

D:\Data\Octopus\Work\20170223140131-20\octo.exe
14:01:38 Info | import
14:01:38 Info | --server=http://##:##/api
14:01:38 Info | --apiKey=####
14:01:38 Info | --type=project
14:01:38 Info | --filePath=D:\Data\Octopus\ProjectExport\Logging-Service.json
14:01:44 Info | Octopus Deploy Command Line Tool, version 4.6.0 Handshaking with Octopus server: http://wwokpavpsb01:9090/api Handshake successful. Octopus version: 3.8.6; API version: 3.0.0 Authenticated as: ### Finding importer ‘project’ Validating the import Export file successfully loaded Checking that lifecycle Normal Production Lifecycle exists Found lifecycle ‘Normal Production Lifecycle’ Checking that all environments exist Checking that all machines exist Checking that all NuGet Feeds exist Checking that all Action Templates exist Checking that all Library Variable Sets exist Checking that the Project Group exist Checking that all channel lifecycles exist No validation errors found. Project is ready to import. Beginning the import Beginning import of project ‘Logging Service’ Importing Project Project does not exist, a new project will be created Importing the channels for the project Channel already exists, channel will be updated with new settings Octopus Server returned an error: Unable to find action names System.Linq.Enumerable+<ExceptIterator>d__721[System.String]on projectProjects-25Server exception: System.Exception: Unable to find action namesSystem.Linq.Enumerable+d__721[System.String] on project Projects-25 at Octopus.Server.Web.CanonicalActionNameMapper.GetIdsFromNames(String projectId, ReferenceCollection actionNames) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\CanonicalActionNameMapper.cs:line 45 at Octopus.Server.Web.Api.Rules.ChannelVersionRulesWillBePersisted.<>c__DisplayClass6_0.b__0(ChannelVersionRuleResource rule) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Api\Rules\ChannelVersionRulesWillBePersisted.cs:line 25 at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Collections.Generic.List1…ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Octopus.Server.Web.Api.Rules.ChannelVersionRulesWillBePersisted.AfterMapBeforeStore(Channel model, ChannelResource resource, ISpecialRuleContext context) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Api\Rules\ChannelVersionRulesWillBePersisted.cs:line 24 at Octopus.Server.Web.Infrastructure.Api.Responder1.ExecuteRules[TRule](Action2 ruleCallback) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 171 at Octopus.Server.Web.Infrastructure.Api.ModifyResponseDescriptor2.Responder.Execute() in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Infrastructure\Api\ModifyResponseDescriptor.cs:line 64 at Octopus.Server.Web.Infrastructure.Api.Responder1.Respond(TDescriptor options, NancyContext context) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 145 at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46 at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context) ----------------------- Error from Octopus server (HTTP 500 InternalServerError) Exit code: -7
14:01:44 Verbose | Updating manifest with output variables
14:01:45 Fatal | The remote script failed with exit code -7
14:01:45 Verbose | at Octopus.Worker.Scripting.ScriptResult.EnsureSuccessful() in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Worker\Scripting\ScriptResult.cs:line 69
| at Octopus.Server.Orchestration.Deploy.Script.ServerScriptActionHandler.Execute(ActionCommand command, Machine machine) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Orchestration\Deploy\Script\ServerScriptActionHandler.cs:line 55
| at Octopus.Server.Orchestration.Deploy.Guidance.Execute(Action callback) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Orchestration\Deploy\Guidance.cs:line 60
| at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteWithTransientErrorDetection(Action action, Machine machine) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Orchestration\Deploy\DeploymentTaskController.cs:line 424
| at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteActionAndInitLoggingContext(PlannedStep step, Machine machine, PlannedAction action) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Orchestration\Deploy\DeploymentTaskController.cs:line 322
14:01:45 Fatal | Import Project File on the Octopus Server

We remove the filters and it exports and import fine.

Thanks Rich

Interestingly as I was reapplying the filter rules I got the same exception. :

System.Exception: Unable to find action names System.Linq.Enumerable+<ExceptIterator>d__721[System.String]on projectProjects-25at Octopus.Server.Web.CanonicalActionNameMapper.GetIdsFromNames(String projectId, ReferenceCollection actionNames) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\CanonicalActionNameMapper.cs:line 45 at Octopus.Server.Web.Api.Rules.ChannelVersionRulesWillBePersisted.<>c__DisplayClass6_0.<AfterMapBeforeStore>b__0(ChannelVersionRuleResource rule) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Api\Rules\ChannelVersionRulesWillBePersisted.cs:line 25 at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Octopus.Server.Web.Api.Rules.ChannelVersionRulesWillBePersisted.AfterMapBeforeStore(Channel model, ChannelResource resource, ISpecialRuleContext context) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Api\Rules\ChannelVersionRulesWillBePersisted.cs:line 24 at Octopus.Server.Web.Infrastructure.Api.Responder1.ExecuteRules[TRule](Action2 ruleCallback) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 171 at Octopus.Server.Web.Infrastructure.Api.ModifyResponseDescriptor2.Responder.Execute() in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Infrastructure\Api\ModifyResponseDescriptor.cs:line 64
at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 145
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)
I think this is due a disabled NuGet deploy step that’s not got a NuGet package name filled in?
Rich

Hi Rich,

Thanks for reporting that problem - you’ve nailed it: it manifests when you have a disabled package step covered by a channel version rule. I’ve created this issue to get it fixed: https://github.com/OctopusDeploy/Issues/issues/3220

I’m really sorry you’ve run into this problem, but I am grateful you took the time to report it so we can fix it quickly. :slight_smile:

Hope that helps!
Mike