Octopus CLI: Cannot Create Release for Script Steps which Reference a Package: "No package version was specified"

Context

I am trying to a create a release for a project which has 2 steps - both of which are script steps that reference a package.

This release is being created from a “Microsoft Visual Studio Team Foundation Server” release definition, which effectively uses the Octopus Command Line (CLI).

Problem

The following error is encountered in the logs, even when a package version for one of the packages is specified as an argument (–package DatabaseMigrationManager:1.0.9):

Creating release…

There was a problem with your request.

No package version was specified for Prepare All Scripts in Package:MigrationScripts

No package version was specified for Deploy Migration Scripts from Package:DatabaseMigrationManager

The command that is run is the below

D:\releaseagent\_work\_tasks\OctopusCreateRelease_4e131b60-5532-4362-95b6-7c67d9841b4f\2.0.135\Octo.exe" create-release --project="Database Migrations" --releaseNumber="" --channel="Development" --server=https://octopus.hidden-name.com/ --apiKey=*** --enableServiceMessages --releaseNotesFile="D:\releaseagent\_work\r93\a\release-notes-93d6309a-6938-473d-8d75-d34e313521cc.md" --package DatabaseMigrationManager:1.0.9

The full output from the logs, showing the release versions that were found and the error message described is in the screenshot

Additional Information

If a release is created via the Octopus UI, it works perfectly. The issue only displays when creating the release via the CLI.

For releases that reference a IIS Web Site Package (e.g. screenshot below), there are no issues.

Steps to Reproduce

  1. Create an Octopus project with at least 1 script step which references any package
  2. Create a release using the CLI
    Octo.exe create-release --project="Database Migrations" --releaseNumber="" --channel="Development" --server=https://octopus.hidden-name.com/ --apiKey=*** --enableServiceMessages --releaseNotesFile=""

Versions

  • Microsoft Visual Studio Team Foundation Server version 16.131.28601.4
  • Octopus Deploy Command Line Tool version 4.34.0
  • Octopus Deploy version 2022.1 (Build 2412)

Hi @JCollier,

Thank you for contacting Octopus Support. I’m sorry you are running into an issue when trying to create a release from your build server.

It looks like the build server is currently using a legacy v2 Create Octopus Release step which (I believe) installs a particular version of Octopus CLI automatically. In this case, version 4.34. We recommend using the newest version of the Create Octopus Release step and using the Octopus CLI Installer task to install the Octopus CLI as part of the build.

You can confirm that the Octopus CLI version is the issue by simply installing the latest version locally on the build server and running the same command as the build:

create-release --project="Database Migrations" --releaseNumber="" --channel="Development" --server=https://octopus.hidden-name.com/ --apiKey=*** --enableServiceMessages --releaseNotesFile="D:\releaseagent\_work\r93\a\release-notes-93d6309a-6938-473d-8d75-d34e313521cc.md" --package DatabaseMigrationManager:1.0.9

Let me know if you are able to test the new Octopus CLI version at your earliest convenience.

Best Regards,
Donny

1 Like

Thanks Donny. I’ve upgraded to the v4 “Create Octopus Release” step which has resolved the issue. The only reason I didn’t go to the latest version of the “Create Octopus Release” step is because my release agent limited me. Thanks!

1 Like