New-OctopusArtifact fails with System.FormatException

Hi

When I use the PowerShell command New-OctopusArtifact to try and upload .trx test results file I get the following exception when using the line below;

New-OctopusArtifact -Path “$MsTestWorkingDirectoryPath\TestRun.trx” -Name “$([System.Environment]::MachineName)TestRun.trx”

The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Octopus.Worker.Scripting.ServiceMessageParser.b__1(XAttribute s) in y:\work\refs\heads\master\source\Octopus.Worker\Scripting\ServiceMessageParser.cs:line 101
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer)
at Octopus.Worker.Scripting.ServiceMessageParser.ProcessMessage(ProcessOutputSource source, String message) in y:\work\refs\heads\master\source\Octopus.Worker\Scripting\ServiceMessageParser.cs:line 102
at Octopus.Worker.Scripting.ServiceMessageParser.Append(ProcessOutputSource source, String line) in y:\work\refs\heads\master\source\Octopus.Worker\Scripting\ServiceMessageParser.cs:line 73
at Octopus.Worker.Scripting.ScriptOutputFilter.Write(IEnumerable1 output) in y:\work\refs\heads\master\source\Octopus.Worker\Scripting\ScriptOutputFilter.cs:line 59 at Octopus.Worker.Tentacles.ScriptObserver.ObserveUntilComplete(ScriptTicket ticket, Int64 next, ScriptOutputFilter output) in y:\work\refs\heads\master\source\Octopus.Worker\Tentacles\ScriptObserver.cs:line 54 at Octopus.Worker.Tentacles.ScriptObserver.ObserveUntilComplete(ScriptTicket ticket, Action1 collectArtifacts) in y:\work\refs\heads\master\source\Octopus.Worker\Tentacles\ScriptObserver.cs:line 31
at Octopus.Worker.Tentacles.TentacleFacade.ExecuteCommand(StartScriptCommand command) in y:\work\refs\heads\master\source\Octopus.Worker\Tentacles\TentacleFacade.cs:line 36
at Octopus.Worker.Tentacles.TentacleWorker.RunScript(String scriptBody, ScriptSyntax syntax, TargetManifest targetManifest, Boolean isViaConsole) in y:\work\refs\heads\master\source\Octopus.Worker\Tentacles\TentacleWorker.cs:line 39
at Octopus.Server.Orchestration.Deploy.Script.ScriptActionHandler.Execute(ActionCommand command, Machine machine) in y:\work\refs\heads\master\source\Octopus.Server\Orchestration\Deploy\Script\ScriptActionHandler.cs:line 33
at Octopus.Server.Orchestration.Deploy.Guidance.Execute(Action callback) in y:\work\refs\heads\master\source\Octopus.Server\Orchestration\Deploy\Guidance.cs:line 50
at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteActions(PlannedStep step, Machine machine) in y:\work\refs\heads\master\source\Octopus.Server\Orchestration\Deploy\DeploymentTaskController.cs:line 192
at Octopus.Shared.Tasks.OctoThreadClosure`1.Execute() in y:\work\refs\heads\master\source\Octopus.Shared\Tasks\OctoThreadClosure.cs:line 29
Octopus.Server version 3.0.7.2204

Hi Jared,
This sounds familiar to another issues that i have heard recently. Could I get you to check the installed Tentacle version and compare with the installed Octopus Server version. Let me know what versions you have there but from the previous case it sounded like upgrading the Tentacle to the same version of the Server did the job.
Thanks for passing this issue through.
Cheers,
Robert

Hi

Thanks for the quick response. As it happens we upgraded to 3.1.5 this weekend and that seems to have cured it. Server and Tentacle are both the same version now.

Thanks

Jared

Jared Holgate
Development Manager

Direct +1 345 814 5147 | Mobile +1 345 526 5147
jared.holgate@maplesandcalder.com

Maples and Calder | Cayman Islands