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.

Hello. I’m a colleague of the original poster and I think I can provide additional context and information.

The machine in question is indeed running a self-hosted Azure DevOps agent. However, the machine is connected to the internet and this connection works as expected. The issue we are facing is that the Octopus task in the pipeline is unable to contact Octopus servers because Cloudflare is getting in the way. This doesn’t just affect the agent, it also shows when I try going to the Octopus Deploy home page via a normal browser from the affected machine. We are getting this:

And of course, since Cloudflare answers with HTML, the deployment task fails because it expects a different response from the server.

The affected setup has been working fine for years, we only noticed this change recently. The question is, is there anything we can do on our side to remedy this?

Hi @marek.linka,

Thanks for reaching out.

Were you able to try any of the methods that Paul suggested above?

  • Changing the Package Application step to use the the built-in Archive Files task or if NuGet package metadata is required, consider using the NuGet task or the dotnet pack task.
  • Adding the Install CLI step to see if it is able to successfully download the CLI from our site?

We haven’t had any other reports of Cloudflare blocking access or disrupting any pipelines, so it seems likely that the issue is environmental. Hopefully with the above, we can get to the bottom of the issue.

Please let me know if you’re able to try any of the above steps.

Kind Regards,
Adam

Thanks for the reply. We tried adding the Install CLI step into the pipeline but the problem remains the same - which makes sense. Since apparently CloudFlare is interfering with the traffic, any attempt to get the CLI on the affected machine will fail, no matter the task used. If I tried to do the same via powershell, it would fail in the same way.

One option would be to instruct the pipeline tasks to not download the CLI at all, but I don’t see any way of doing that and still keep using the Octopus tasks. Instead, I think we will just install the .NET Core version of the octo CLI and invoke the push directly via powershell.

I’ll get back to you with the results.

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.