OctopusPack not a valid version string

When using vNext Octopus package Application, I am hitting an error of “‘173.01-C112544-SMD.01.SMDPLog.173x.20180319.7’ is not a valid version string". If use the same version number in a PowerShell script calling OctopusTools.4.21.0 it accept the version number.
Full vNext Error:
System.ArgumentException: ‘173.1-C112544-SMD.01.SMDPLog.173x.20180319.8’ is not a valid version string
Parameter name: value
at Octopus.Client.Model.SemanticVersion.Parse(String value, Boolean preserveMissingComponents)
at Octopus.Cli.Commands.Package.PackCommand.<.ctor>b__15_9(String v)
at Octopus.Cli.Infrastructure.OptionSet.<>c__DisplayClass11_0.b__0(OptionValueCollection v)
at Octopus.Cli.Infrastructure.OptionSet.ActionOption.OnParseComplete(OptionContext c)
at Octopus.Cli.Infrastructure.Option.Invoke(OptionContext c)
at Octopus.Cli.Infrastructure.OptionSet.ParseValue(String option, OptionContext c)
at Octopus.Cli.Infrastructure.OptionSet.Parse(String argument, OptionContext c)
at Octopus.Cli.Infrastructure.OptionSet.<>c__DisplayClass22_0.b__0(String argument)
at System.Linq.Enumerable.WhereArrayIterator1.MoveNext() at System.Collections.Generic.List1…ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Octopus.Cli.Infrastructure.OptionSet.Parse(IEnumerable1 arguments) at Octopus.Cli.Infrastructure.Options.Parse(IEnumerable1 arguments)
at Octopus.Cli.Commands.Package.PackCommand.<>c__DisplayClass16_0.b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
— 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.Cli.CliProgram.Run(String[] args)
Exit code: -3

Task : Package Application
Description : Package your application into a NuPkg or Zip file.
Version : 2.0.98
Author : Octopus Deploy
Help : Version: 2.0.98. More Information

Hi Scott,

Thanks for getting in touch, sorry you are having an issue.

I tested your version number you provided with Octo.exe version 4.21.0 and I got same not a valid version string response as you were seeing.

The version number format should follow the SemVer standard. The version number that you are using appears to be including both the Package Id and the version number, plus some other invalid characters. If you have used this version number format previously, I would be interested to see where you had it working.

So I can help you troubleshoot the problem, are you able to provide me additional information, such as the command you are using to package (the one that is working) and the step in VSTS/TFS which is failing, plus the powershell script that you mentioned.


Hi Ben,
The powershell we are using to package is C:\Windows\OctopusTools.4.21.0\Octo.exe pack --id="SQL" --version=$RELEASE --basePath=R:\OCTPKG\Binaries\$PROJECT\$DEPLOY_TO\AVL2DBScripts\ --outfolder=$Outfolder
Our version number is made up of the following $BRANCHVERSION-$Changeset-$TFSBuildNumber

So when we pass this into Octopus it looks like this:
C:\Windows\OctopusTools.4.21.0\Octo.exe pack --id=
AVL2 --version=173.1-C112357-GO47.AVL.173x.20180308.2 --basePath=R:\OCTPKG\Binaries\AVL2\nz02\AVL2DBScripts\ --outfolder=R:\OCTPKG\AVL2\173.1\nz02

Build step looks like this:

Thanks Scott

Hi Scott,

Looking at the couple of different version numbers that you have mentioned, they still seem to be in the wrong format for SemVer.
SemVer version numbers need to be in the format MAJOR.MINOR.PATCH-prereleasetag+metadata.

So in the case of the original version number (173.01-C112544-SMD.01.SMDPLog.173x.20180319.7) you would need to remove the leading zero from the .01, add a third version number as a patch version and change the second hyphen to a plus, e.g 173.1.0-C112544+SMD.01.SMDPLog.173x.20180319.7
The second version number for the AVL2 package has a similar issue.

I tested the modified version number using Octo.exe version 4.21.0 and it created the package successfully.

I also used this web site to test the version number strings.

Hopefully this helps you out.


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