Unable to find action ids on project

We are running version 3.3.12., In one of our projects we get the following error when opening the “Process” tab and the “Channels” tab.

What could be wrong and is there a way to fix the issue without recreating the whole project?

2016-11-04 14:38:47.1351 3 ERROR Unhandled error on request: http://deploy.xxxxxxxxx.no/api/projects/Projects-62/channels by Hallvar.Helleseth@xxxxxxx.no : Unable to find action ids a071211b-6525-468a-b172-3d46da01396a, 79c52cb0-fa81-437c-ab09-b6899b7aacf9 on project Projects-62
System.Exception: Unable to find action ids a071211b-6525-468a-b172-3d46da01396a, 79c52cb0-fa81-437c-ab09-b6899b7aacf9 on project Projects-62
at Octopus.Server.Web.CanonicalActionNameMapper.GetNamesFromIds(String projectId, ReferenceCollection actionIds) in Y:\work\refs\tags\3.3.12\source\Octopus.Server\Web\CanonicalActionNameMapper.cs:line 41
at Octopus.Server.Web.ResourceMapper.<>c__DisplayClass6_0.b__29(ChannelVersionRule rule) in Y:\work\refs\tags\3.3.12\source\Octopus.Server\Web\ResourceMapper.cs:line 335
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.ResourceMapper.<>c.b__6_28(Channel channel, ChannelResource resource, IResourceMappingContext ctx) in Y:\work\refs\tags\3.3.12\source\Octopus.Server\Web\ResourceMapper.cs:line 335
at Octopus.Server.Web.ResourceMapping3.ModelToResource(Object model, Object resource, Object context, Boolean detailed) in Y:\work\refs\tags\3.3.12\source\Octopus.Server\Web\ResourceMapping.cs:line 82 at Octopus.Server.Web.ResourceMapper.<>c__DisplayClass13_01.b__0(ResourceMapping mapping) in Y:\work\refs\tags\3.3.12\source\Octopus.Server\Web\ResourceMapper.cs:line 704
at Octopus.Server.Web.ResourceMapper.ConvertTo[TResource](Object model, ResourceMapperMode mode) in Y:\work\refs\tags\3.3.12\source\Octopus.Server\Web\ResourceMapper.cs:line 705
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List1…ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Octopus.Client.Model.ResourceCollection1..ctor(IEnumerable1 items, LinkCollection links) in Y:\work\refs\tags\3.3.12\source\Octopus.Client\Model\ResourceCollection.cs:line 14
at Octopus.Server.Web.Infrastructure.Api.Responder1.Collection[TResource](IList resources, Int32 itemsPerPage, Int32 totalResults, LinkCollection links) in Y:\work\refs\tags\3.3.12\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 147 at Octopus.Server.Web.Infrastructure.Api.ChildIndexResponseDescriptor4.Responder.Execute() in Y:\work\refs\tags\3.3.12\source\Octopus.Server\Web\Infrastructure\Api\ChildIndexResponseDescriptor.cs:line 60
at Octopus.Server.Web.Infrastructure.Api.Responder1.Respond(TDescriptor options, NancyContext context) in Y:\work\refs\tags\3.3.12\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 162 at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at CallSite.Target(Closure , CallSite , Object , Object , NancyContext ) at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Y:\work\refs\tags\3.3.12\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46 at CallSite.Target(Closure , CallSite , Func2 , Object )
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)

Hi,

I’m sorry to hear you’re experiencing this issue.

We’re not sure how this would have happened, but it seems your data has been corrupted.
One of your channels appears to have version-rules that reference deployment steps (aka actions) that do not exist in the project.

Is there anything note-worthy about that project? Was it cloned from another project (though that should be fine)? Was it migrated from another Octopus instance (again, that should be fine)?

Regarding correcting the data without re-creating the project (which I totally understand your reluctance to do). We need to remove the offending channel rules, and re-create them. I’ll propose two options:

  • Option 1: Correct the data in SQL Server yourself
  • Option 2: We can provide a script to clean the data (the only catch is, it may take us a day or so to create and supply you with the script).

Option 1

This only applies if you have access to your Octopus Server’s SQL Server instance, and are comfortable modifying the data directly.

I would strongly recommend you take a back-up first, in case something goes wrong.

Select the channels for the affected project using

SELECT *
  FROM [Octopus].[dbo].[Channel]
  Where ProjectId = 'Projects-62'

If you examine the JSON column for these channels, at least one should have values for the Rules property.

e.g.

{
    "Description": "Straight to Prod...",
    "IsDefault": false,
    "Rules": [
        {
            "Id": "d8fed73d-8984-4c7c-b3f4-77e9eced788b",
            "Actions": [
                "06b9cde5-a03a-46d5-bb38-9f154b7f9a1e"
            ],
            "VersionRange": "[3.2,)",
            "Tag": "^$"
        }
    ]
}

The example above has one rule defined. You should be able to find a rule/s where it’s Action property contains the action ids mentioned in your stack-trace.

I think the best option is to remove the rules from those channels. E.g:

{
    "Description": "Straight to Prod...",
    "IsDefault": false,
    "Rules": []
}

And update the channel records.

You can then recreate the removed rules via the Octopus UI.

Option 2

If you would prefer us to supply a script to do this, then we’re happy to. If so, I may ask you for a extract of your channel data, so we can test the script.

What do you think?

Again, we apologize for any inconvenience.

Regards,
Michael