Octo.exe failing with error

Good morning,

I’m getting an error trying to run Octo.exe to delete releases. My command is:

Octo.exe delete-releases --server=http://blah --apiKey=blahDeeBlah --project=BlahProject --minversion=1.0.364.152960 --maxversion=1.25.1064.159624

The error I’m getting is:

Octopus Deploy Command Line Tool, version 2.1.2.37

Handshaking with Octopus server: http://blah
Handshake successful. Octopus version: 2.1.3.1223; API version: 3.0.0
Finding project: blahDeeBlah
Finding releases for project…
System.Exception: The document does not define a link for 'Next’
at Octopus.Client.Model.Resource.Link(String name)
at OctopusTools.Commands.DeleteReleasesCommand.Execute()
at OctopusTools.Commands.ApiCommand.Execute(String[] commandLineArguments)
at OctopusTools.Program.Main(String[] args)
Exit code: -3

Any ideas?

Thanks!
Jason.

Actually, never mind. This must be because the releases are being yanked out from underneath Octo.exe since I’ve changed the retention policy and all those releases are now being deleted from within Octopus at the same time Octo.exe is looking through the api.

Having this same problem, see attached

Boy that was a lame image to post…

We had the same issue but our retention policies are turned off. I had a quick look at the code for Octo in GitHub and I think there’s a bug in DeleteReleasesCommand.cs (line 72):

 releases = Repository.Client.List<ReleaseResource>(releases.Link("Next"));

This should be changed to:

 releases = Repository.Client.List<ReleaseResource>(releases.Link("Page.Next"));

Thanks Debra - fixed, will go out in line with 2.4.

The same error happens when exporting releases.
ReleaseExporter.cs (currently line 90) should change from:

releases = Repository.Client.List<ReleaseResource>(releases.Link("Next"));

to:

releases = Repository.Client.List<ReleaseResource>(releases.Link("Page.Next"));

Hi Mark,

Thanks for the report, I’ve raised the following GitHub issue to get this fixed up.

Kind regards,
Henrik

Thanks Henrik
FYI I also received an error when importing a project using the Octo.exe available for download v2.6.3.59. In the end I downloaded the code so I could debug the issue but the import worked when running the code. It seems as though the version for download is a little out of date?

Thanks
Mark

Thanks Mark,

I’ve updated the GH issue with these details.

Cheers,
Henrik