Failed to execute Octo Pack Task in azure pipeline

Currently, I am having a problem on executing the Octopus Pack task in my azure devops pipeline. The steps of the pipeline is listed below:

  1. Copying the package in the Staging folder task
  2. Package Application for Octopus task (Here is where the error is encountered)
  3. Push package to octopus task

At task number 2, I am receiving this error ##[error]"Failed to execute octo pack command. Unable to locate and download the latest Octopus CLI tool. To use the embedded copy or another specific version, add the Octopus CLI installer task to the build pipeline before this task.

Can you please help me what went wrong here? Thanks in advance.

Hi Edgar,

Thanks for getting in touch!

The Octopus steps within ADO use our Octo CLI to execute the commands; however, the CLI isn’t included within the steps themselves.

Instead, you’ll either need to add the Octopus CLI Installer step to run before the package step or install the Octo CLI onto a self-hosted agent and register it as a capability.

Further details on both these options can be found here.

Regards,
Paul

2022-09-23T10:31:06.1221827Z ##[section]Starting: OctopusPack
2022-09-23T10:31:06.1481648Z ==============================================================================
2022-09-23T10:31:06.1482068Z Task : Package Application for Octopus
2022-09-23T10:31:06.1482371Z Description : Package your application into a NuPkg or Zip file.
2022-09-23T10:31:06.1482644Z Version : 4.3.134
2022-09-23T10:31:06.1482840Z Author : Octopus Deploy
2022-09-23T10:31:06.1484246Z Help : Version: 5.2.134. More Information
2022-09-23T10:31:06.1484701Z ==============================================================================
2022-09-23T10:31:06.7142792Z ##[warning]This task is supported, but it no longer actively maintained.
It was originally created for the Octopus CLI when Octopus Deploy only supported NuGet packages.
It is recommended to migrate to the built-in ‘Archive Files’ task (Archive Files task - Azure Pipelines | Microsoft Learn).
Alternatively, if NuGet package metadata is required, consider using the ‘NuGet’ task (NuGet restore, pack, and publish task - Azure Pipelines | Microsoft Learn) or the ‘dotnet pack’ task (.NET Core CLI task - Azure Pipelines | Microsoft Learn).
2022-09-23T10:31:06.7215269Z Attempting to contact https://g.octopushq.com to find Octopus CLI tool version latest
2022-09-23T10:31:07.5706852Z ##[error]Error:

Just a moment...

download.octopusdeploy.com

Checking if the site connection is secure

Enable JavaScript and cookies to continue
download.octopusdeploy.com needs to review the security of your connection before proceeding.
<div class="footer" role="contentinfo">
    <div class="footer-inner">
        <div class="clearfix diagnostic-wrapper">
            <div class="ray-id">Ray ID: <code>74f29be01f57021d</code></div>
        </div>
        <div class="text-center">Performance &amp; security by <a rel="noopener noreferrer" href="https://www.cloudflare.com?utm_source=challenge&utm_campaign=m" target="_blank">Cloudflare</a></div>
    </div>
</div>

2022-09-23T10:31:07.5734520Z ##[error]"Failed to execute octo pack command. Unable to locate and download the latest Octopus CLI tool. To use the embedded copy or another specific version, add the Octopus CLI installer task to the build pipeline before this task.
Error: Unable to locate and download the latest Octopus CLI tool. To use the embedded copy or another specific version, add the Octopus CLI installer task to the build pipeline before this task.
at Ru.t.isSome.bu.then.catch.e (D:\AzureDevOpsAgent_work_tasks\OctopusPack_179fac12-2402-486e-80cf-5a6a8571f7c0\4.3.134\index.js:10:22655)
at process._tickCallback (internal/process/next_tick.js:68:7)
2022-09-23T10:31:07.5814709Z ##[section]Finishing: OctopusPack

@paul.calvert here is the whole logs and it seems there is an additional error referring to the cloudflare.com

Is the agent running the pipeline a local, self-hosted one? If so, it could be that it doesn’t have network access https://g.octopushq.com/.

You could try adding the Install CLI step to see if that is able to successfully download the CLI from our site, if that also fails then it would suggest a network issue.

It is worth mentioning that our Package Application step is deprecated now and we recommend using either the built-in Archive Files task or if NuGet package metadata is required, consider using the NuGet task or the dotnet pack task.