Octo.exe crashes when assigning a version number to a zip file

I am attempting to use octo. exe to pack up my c:\temp folder into a zip file and get it to automatically assign a version number, using the following

C:\Temp>octo pack --id=temp --format=zip

However it crashes with the following error

Octopus Deploy Command Line Tool, version 4.0.7+Branch.master.Sha.e04e9beff28f7e189baddab121c6cf689fddd9b6

Packing temp version “2017.1.25.164449”…

System.InvalidOperationException: Octopus: We want to avoid using NormalizedVersion()

at NuGet.Versioning.NuGetVersion.ToString()

at System.String.Concat(Object[] args)

at Octopus.Cli.Commands.ZipPackageBuilder.BuildPackage(String basePath, IList`1 includes, ManifestMetadata metadata, String outFolder, Boolean overwrite)

at Octopus.Cli.Commands.PackCommand.<>c__DisplayClass17_0.b__0()

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.Program.Run(String[] args)

Exit code: -3

If I specify a version number, e.g. by using

C:\Temp>octo pack --id=temp --version=1.0.0 --format=zip

then it works fine and creates the zip file with the following output

Octopus Deploy Command Line Tool, version 4.0.7+Branch.master.Sha.e04e9beff28f7e189baddab121c6cf689fddd9b6

Packing temp version “1.0.0”…

Saving “temp.1.0.0.zip” to “C:\Temp”…

Adding files from “C:\Temp” matching pattern “**”

Adding file: “App-Copy.config”

Adding file: “App.config”

Adding file: “test.ps1”

Adding file: “tfshistory.txt”

Adding file: “Web Services.json”

Done.

Hi,

Thanks for reaching out! 4-part versions such as 1.0.0.0 or 2017.1.25.164449 are not compatible with the SemVer guideline which is what we follow through all Octopus for packages and releases. You might wanna consider using a pre-release tag instead of a 4th digit.

Best regards,
Dalmiro

Hi Dalmiro,

Thanks for the reply. However this doesn’t help me, because Octo.exe is generating the version number, not me.

Is there a version of Octo.exe which doesn’t have this bug?

Cheers,
Dean.

Hi Dean,

I brought this conversation to one of my teammates and It seems like I got it partially wrong: While its true that SemVer doesn’t allow 4-part versions, we do accept it in Octopus for both packages and releases. So 2017.1.25.164449 should work.

I tested that same command using Octo.exe 4.6.0 and it worked just fine on my end:

Octopus Deploy Command Line Tool, version 4.6.0

Packing temp version "2017.1.27.103439"...
Saving "temp.2017.1.27.103439.zip" to "C:\Tools"...
Adding files from "C:\Tools" matching pattern "**"
Adding file: "Octo.exe"
Adding file: "OctopusTools.4.6.0.zip"
Adding file: "MyApp/File1.txt"
Adding file: "MyApp/File2.txt"

So my recommendation would be to update your Octo.exe to the latest and try again. If you are running this command using the TeamCity or VSTS plugin, upgrade those to the latest which should contain a newer version of Octo.exe built-in.

Let me know how that goes.
Dalmiro

Hi Dalmiro,

I’ve just downloaded Octo.exe 4.6.0, and this has fixed the problem. So it looks like it was a bug in the earlier version.

Thanks for your assistance.

Cheers,
Dean.

Glad to hear that!

Cheers