Octo.exe pack fails without --version

Using Octopus Deploy Command Line Tool, version 4.2.4+Branch.master.Sha.9f1cbaa1e9e143553779896d25b25587bbb0f703

When I try to run octo.exe pack --id=abc, I get the error:

System.ArgumentException: Value cannot be null or an empty string.
Parameter name: value
   at NuGet.Versioning.NuGetVersion.Parse(String value)
   at Octopus.Cli.Commands.PackCommand.<>c__DisplayClass17_0.<Execute>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.Program.Run(String[] args)

It works if I specify --version explicitly.

Digging into the source code, I found the following starting on line 111 in Octo.Commands.PackCommand:

            var metadata = new ManifestMetadata
                Id = id,
                Authors = authors,
                Description = description,
                Version = NuGetVersion.Parse(version.OriginalString)

Here version.OriginalString is null, even though version is not.

Hi Geir,

Thanks for getting in touch! I’m really sorry you’ve run into this - it’s a bug in how we generate a date-based version after a recent code change. We’ll ship a fix for this very soon, but in the meantime you can work around this bug by passing the --version argument as you’d suggested. Most of our customers use this approach since it gives them a more predictable and traceable version number based on their build system.

Hope that helps!

Hi Geir,

I’ve just shipped octo.exe 4.3.1 which has a fix for this bug in it.

Hope that helps!

Great, thanks a lot!