Apply Terraform step fails if step has role applied

I was using the Apply Terraform step in a project.

In the step itself I had selected the option to ‘Run on the Octopus server’. But I has also moved this group to be grouped with a Slack notification step. Doing so meant I had to apply a deployment role at the parent step level. The role I applied ‘octopus-server’ contains only the Octopus server itself.

When the Apply terraform step ran, this error immediately occurred:

The step failed: Activity Apply Terraform on OCTOSERVER01 failed with error ‘No package for the action ‘96995048-4e5e-46ac-89ff-cfc05f6e0ae5’ on the server was acquired.’.

The release was correctly created with a valid package from the feed.

When I removed the parent step, removed the role scoping for the Apply Terraform step (and let it remain on the Slack notification step, everything works again. I am certain this has to do with the role scoping.

FYI

Hi Rohin, thanks for reaching out.

This bug was fixed in 2018.3.9 through the issue at https://github.com/OctopusDeploy/Issues/issues/4431. If you are running an earlier version of Octopus can you upgrade to the latest version and see if that resolves this issue?

Regards
Matthew Casperson

1 Like

Thanks for the update Matthew. We upgraded to 2018.3.12 today, but I just found the exact same issue in the ‘Run an AWS CLI script’ step!

It worked when I used the “Where should this step run? · Octopus Server” radio button.

Hi Rohin,

That does appear to be a bug. Can you attach the raw logs for that deployment (https://octopus.com/docs/support/get-the-raw-output-from-a-task has instructions ofr obtaining the logs) as well as the JSON template for the project (you can download this clicking the vertical menu icon and clicking Download as JSON)? We can use this to reproduce the issue locally.

fe61a03d-94d7-48e5-b06c-c70907ba2813

Regards
Matt Casperson

Sorry Matthew, this was in a POC project which has since been removed. The easiest way to replicate it is to repeat the steps taken for the terraform apply step to trigger the issues from my first post in this conversation, only using the AWS CLI step.

Hi Rohin,

This issue has been resolved in Octopus version 2018.5.

Regards
Ben