Octopus.Migrator.exe import error on v2020.4.11

We have multiple instances of v2020.4.11 and I am working on consolidating them to a single server using the partial-export and import functionality of the Octopus Migrator all running the same v2020.4.11 version. When running the import in a test environment, everything works out with no errors. However when running it on our production instance also on the same version and using the exact same exported files, we are seeing the following errors in the logs;

2020-12-08 18:54:02.7203 6532 1 ERROR An unexpected error occurred when processing document with source ID ‘ActionTemplates-81’: Expected to find at least one feed of type OctopusProject
System.InvalidOperationException: Expected to find at least one feed of type OctopusProject
at Octopus.Migrator.Core.DocumentImporters.ActionTemplateImporter.Convert(ImportedDocument source, ImportContext context, String destinationId, ActionTemplate existing) in C:\buildAgent\work\77a480eb4131d316\source\Octopus.Migrator.Core\DocumentImporters\ActionTemplateImporter.cs:line 34
at Octopus.Migrator.Core.DocumentImporters.ConventionBasedImporter1.InsertNewDocument(ImportedDocument source, ImportContext context, Identity identity) in C:\buildAgent\work\77a480eb4131d316\source\Octopus.Migrator.Core\DocumentImporters\ConventionBasedImporter.cs:line 141 at Octopus.Migrator.Core.DocumentImporters.ConventionBasedImporter1.Import(ImportedDocument source, ImportContext context) in C:\buildAgent\work\77a480eb4131d316\source\Octopus.Migrator.Core\DocumentImporters\ConventionBasedImporter.cs:line 128
at Octopus.Migrator.Core.ImportProcess.ImportController.ConvertDocuments(ImportContext context) in C:\buildAgent\work\77a480eb4131d316\source\Octopus.Migrator.Core\ImportProcess\ImportController.cs:line 480
2020-12-08 18:54:02.7584 6532 1 INFO The document content was: {
“$type”: “Octopus.Core.Model.Projects.ActionTemplate, Octopus.Core”,
“Id”: “ActionTemplates-81”,
“Name”: “JIRA - Transition Issues”,
“Description”: “Transitions JIRA issues as the code they are associated with gets deployed.”,
“Version”: 8,
“ActionType”: “Octopus.Script”,
“CommunityActionTemplateId”: “CommunityActionTemplates-141”,
“SpaceId”: “Spaces-22”,
“Properties”: {
“Octopus.Action.Script.Syntax”: “PowerShell”,
“Octopus.Action.Script.ScriptSource”: “Inline”,
“Octopus.Action.Script.ScriptBody”: “#require version 3.0\n\nparam (\n [System.Uri]$Uri,\n [string]$Jql,\n [string]$Transition,\n [string]$User,\n [string]$Password\n)\n\n$ErrorActionPreference = “Stop”\n$AllProtocols = [System.Net.SecurityProtocolType]‘Tls,Tls11,Tls12’\n[Net.ServicePointManager]::SecurityProtocol = $AllProtocols\n\nfunction Get-Param($Name, [switch]$Required, $Default) {\n $result = $null\n\n if ($OctopusParameters -ne $null) {\n $result = $OctopusParameters[$Name]\n }\n\n if ($result -eq $null) {\n $variable = Get-Variable $Name -EA SilentlyContinue \n if ($variable -ne $null) {\n $result = $variable.Value\n }\n }\n\n if ($result -eq $null) {\n if ($Required) {\n throw “Missing parameter value $Name”\n } else {\n $result = $Default\n }\n }\n\n return $result\n}\n\nfunction Jira-QueryApi\n{\n Param (\n [Uri]$Query,\n [string]$Username,\n [string]$Password\n );\n\n Write-Host “Querying JIRA API $($Query.AbsoluteUri)”\n\n # Prepare the Basic Authorization header - PSCredential doesn’t seem to work\n $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes((”{0}:{1}" -f $Username,$Password)))\n $headers = @{Authorization=(“Basic {0}” -f $base64AuthInfo)}\n\n # Execute the query\n Invoke-RestMethod -Uri $Query -Headers $headers\n}\n\nfunction Jira-ExecuteApi\n{\n Param (\n [Uri]$Query,\n [string]$Body,\n [string]$Username,\n [string]$Password\n );\n\n Write-Host “Posting JIRA API $($Query.AbsoluteUri)”\n\n $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $Username,$Password)))\n $headers = @{Authorization=(“Basic {0}” -f $base64AuthInfo)}\n\n Invoke-RestMethod -Uri $Query -Headers $headers -UseBasicParsing -Body $Body -Method Post -ContentType “application/json”\n}\n\nfunction Jira-GetTransitions\n{\n Param (\n [Uri]$TransitionsUri,\n [string]$Username,\n [string]$Password\n );\n\n $transitions = Jira-QueryApi -Query $TransitionsUri -Username $Username -Password $Password\n $transitions.transitions\n}\n\nfunction Jira-PostTransition\n{\n Param (\n [Uri]$TransitionsUri,\n [string]$Username,\n [string]$Password,\n [string]$Body\n );\n\n Jira-ExecuteApi -Query $TransitionsUri -Body $body -Username $Username -Password $Password\n}\n\nfunction Jira-TransitionTicket\n{\n Param (\n [Uri]$IssueUri,\n [string]$Username,\n [string]$Password,\n [string]$Transition\n );\n\n $query = $IssueUri.AbsoluteUri + “/transitions”\n $uri = [System.Uri] $query\n\n $transitions = Jira-GetTransitions -TransitionsUri $uri -Username $Username -Password $Password\n $match = $transitions | Where name -eq $Transition | Select -First 1\n $comment = “Status automatically updated via Octopus Deploy with release {0} of {1} to {2}” -f $OctopusParameters[‘Octopus.Action.Package.PackageVersion’],$OctopusParameters[‘Octopus.Project.Name’],$OctopusParameters[‘Octopus.Environment.Name’] \n \n If ($match -ne $null)\n {\n $transitionId = $match.id\n $body = “{ ““update””: { ““comment””: [ { ““add”” : { ““body”” : “”$comment”" } } ] }, ““transition””: { ““id””: “”$transitionId"" } }"\n\n Jira-PostTransition -TransitionsUri $uri -Body $body -Username $Username -Password $Password\n }\n}\n\nfunction Jira-TransitionTickets\n{\n Param (\n [Uri]$BaseUri,\n [string]$Username,\n [string]$Password,\n [string]$Jql,\n [string]$Transition\n );\n\n $api = New-Object -TypeName System.Uri -ArgumentList $BaseUri, ("/rest/api/2/search?jql=" + $Jql)\n $json = Jira-QueryApi -Query $api -Username $Username -Password $Password\n\n If ($json.total -eq 0)\n {\n Write-Output “No issues were found that matched your query : $Jql”\n }\n Else\n {\n ForEach ($issue in $json.issues)\n {\n Jira-TransitionTicket -IssueUri $issue.self -Transition $Transition -Username $Username -Password $Password\n }\n }\n}\n\n& {\n param(\n [System.Uri]$Uri,\n [string]$Jql,\n [string]$Transition,\n [string]$User,\n [string]$Password\n )\n\n Write-Host “JIRA - Create Transition”\n Write-Host " JIRA URL : $Uri"\n Write-Host " JIRA JQL : $Jql"\n Write-Host " Transition : $Transition"\n Write-Host " Username : $User"\n\n # Some sample values:\n # $uri = “http://tempuri.org”\n # $Jql = “fixVersion = 11.3.1 AND status = Completed”\n # $Ttransition = “Deploy”\n # $User = “admin”\n # $Pass = “admin”\n\n try {\n Jira-TransitionTickets -BaseUri $Uri -Jql $Jql -Transition $Transition -Username $User -Password $Password\n } catch {\n Write-Host -ForegroundColor Red “An error occurred while attempting to transition the JIRA issues”\n Write-Host -ForegroundColor Red $_.Exception | Format-List -Force\n }\n} \n(Get-Param \"Jira.Transition.Url\" -Required) \n(Get-Param “Jira.Transition.Query” -Required) \n(Get-Param \"Jira.Transition.Name\" -Required) \n(Get-Param “Jira.Transition.Username” -Required) \n(Get-Param \"Jira.Transition.Password\" -Required)\n" }, "Packages": [], "Parameters": [ { "Id": null, "Name": "Jira.Transition.Url", "Label": "JIRA URL", "HelpText": "The base URL of the JIRA Server (e.g. http://tempuri.org/jira)", "DefaultValue": "", "DisplaySettings": { "Octopus.ControlType": "SingleLineText" } }, { "Id": null, "Name": "Jira.Transition.Username", "Label": "Username", "HelpText": "The username of the account that will be used to run the transition. The account should have sufficient permissions in JIRA to run the transition.", "DefaultValue": "", "DisplaySettings": { "Octopus.ControlType": "SingleLineText" } }, { "Id": null, "Name": "Jira.Transition.Password", "Label": "Password", "HelpText": "The password of the account that will be used to run the transaction.", "DefaultValue": "", "DisplaySettings": { "Octopus.ControlType": "Sensitive" } }, { "Id": null, "Name": "Jira.Transition.Name", "Label": "Transition", "HelpText": "The name of the transition that should be applied to the JIRA tickets. If an issue does not have the named transition, it will be ignored.", "DefaultValue": "", "DisplaySettings": { "Octopus.ControlType": "SingleLineText" } }, { "Id": null, "Name": "Jira.Transition.Query", "Label": "JQL", "HelpText": "The JIRA query that should be used to select issues that will be transitioned (e.g. status = Completed AND fixVersion = 1.2.3)", "DefaultValue": "", "DisplaySettings": { "Octopus.ControlType": "SingleLineText" } } ] } 2020-12-08 18:54:02.8424 6532 1 ERROR =============================================================================== 2020-12-08 18:54:02.8536 6532 1 FATAL Expected to find at least one feed of type OctopusProject System.InvalidOperationException at Octopus.Migrator.Core.DocumentImporters.ActionTemplateImporter.Convert(ImportedDocument source, ImportContext context, String destinationId, ActionTemplate existing) in ActionTemplateImporter.cs:line 34 at Octopus.Migrator.Core.DocumentImporters.ConventionBasedImporter1.InsertNewDocument(ImportedDocument source, ImportContext context, Identity identity) in ConventionBasedImporter.cs:line 141
at Octopus.Migrator.Core.DocumentImporters.ConventionBasedImporter1.Import(ImportedDocument source, ImportContext context) in ConventionBasedImporter.cs:line 128 at Octopus.Migrator.Core.ImportProcess.ImportController.ConvertDocuments(ImportContext context) in ImportController.cs:line 480 at Octopus.Migrator.Core.ImportProcess.ImportController.ExecuteWithTimer(ImportContext ctx, String name, Action1 work) in ImportController.cs:line 171
at Octopus.Migrator.Core.ImportProcess.ImportController.ImportDocuments(IImportedDocumentSource backup) in ImportController.cs:line 114
at Octopus.Migrator.Core.ImportProcess.ImportController.Import(IImportedDocumentSource backup) in ImportController.cs:line 93
at Octopus.Migrator.Cli.Commands.ImportFilesCommand.Start() in ImportFilesCommand.cs:line 118
at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions)
at Octopus.Shared.Startup.OctopusProgram.Start(ICommandRuntime commandRuntime)
at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown)
at Octopus.Shared.Startup.OctopusProgram.RunHost(ICommandHost host)
at Octopus.Shared.Startup.OctopusProgram.Run()
2020-12-08 18:54:02.8879 6532 1 FATAL -------------------------------------------------------------------------------
Terminating process with exit code 100
Full error details are available in the log files at:
C:\Users\amnelson\AppData\Local\Octopus\Logs
E:\Octopus\Logs
If you need help, please send these log files to https://octopus.com/support

Hi Aaron,

I see you’ve raised a ticket with us here on discourse and also by emailing support@octopus.com.

I will respond to the support@octopus.com ticket.

Regards,

Dane

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