actions / actions/runner

Using `force-cancel` returns a 500 error on a hanging workflow

Open
#3,329 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the bug
Calling the force-cancel endpoint using the following syntax, returns a 500 error (related to the recently implemented #1846).

To Reproduce

Have a workflow run that's hanging (if you need to repro this, there are currently two hanging runs in my org, see getaddify and ping me if you want me to try some things).

gh api --method POST repos/GetAddify/colonizer/actions/runs/9420995077/force-cancel

Response:

{
  "message": "Failed to cancel workflow run",
  "documentation_url": "https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run",
  "status": "500"
}

Expected behavior

Run is canceled. However, this does not happen.

Runner Version and Platform

Version of your runner? this in GitHub itself

OS of the machine running the runner? online in github.com

What's not working?

See response JSON above. It won't cancel the hanging run (even after 5 days).

Job Log Output

None. The runs appear as running, but didn't even start. It looks like this in the overview:

image

Runner and Worker's Diagnostic Logs

N/A

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the POST request to the documented force-cancel endpoint for a hanging workflow run and inspect the returned 500 response. The payload names no repository files or tests, so trace the endpoint implementation and related cancellation handling before determining what change is needed. Done means the hanging run is canceled and the endpoint no longer returns this failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, github-actions
Domain
api, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.