Skip to content

Handle post_plan_running status in apply-run #2986

@duijf

Description

@duijf

We have a GitHub action that uses the tooling from this repository that looks very similar to this example.

      - uses: hashicorp/tfc-workflows-github/actions/create-run@v1.3.2
        id: create-run
        with:
          workspace: ${{ env.TF_WORKSPACE }}
          configuration_version: ${{ steps.upload.outputs.configuration_version_id }}

      - uses: hashicorp/tfc-workflows-github/actions/apply-run@v1.3.2
        # assign id attribute to reference in subsequent steps
        id: apply
        with:
          run: ${{ steps.create-run.outputs.run_id }}
          comment: "Confirmed from GitHub Actions CI"

Occasionally, we're observing the following in the apply-run step:

View Run in HCP Terraform: https://app.terraform.io/app/<redacted>/workspaces/<redacted>/runs/run-<redacted>
run run-<redacted>, cannot be applied
{
  "run_id": "run-<redacted>",
  "run_link": "https://app.terraform.io/app/<redacted>/workspaces/<redacted>/runs/run-<redacted>",
  "run_status": "post_plan_running",
  "status": "Error"
}

The workspace in question has Sentinel policies enabled. It looks like either create-run returns too early or apply-run needs to keep retrying until the post_plan_running state / Sentinel policies have passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions