Sub topic 12
Troubleshooting common queue problems
This chapter assumes you can read GitHub Actions workflow files, know how required status checks gate a pull request, and have already enabled a merge queue on a branch. Most queue problems come from a small set of causes. Work through them in order, starting with the most common.
How to approach a stuck queue
A queue entry has two phases. First GitHub builds a temporary merge group branch, named gh-readonly-queue/<base>/.... Then it waits for the required checks to report on that branch. Almost every stall is a failure in the second phase: the checks never report, or they report the wrong thing.
Problem: checks never start
This is the most common failure. The pull request is green, you add it to the queue, and the entry sits at "awaiting checks" until it times out.
The cause is usually a workflow that listens only for pull_request. The queue creates a push to a temporary branch and raises a merge_group event. A workflow without that trigger does not run, so the required check never reports.
name: CI
on:
pull_request:
branches: [main]
merge_group:
types: [checks_requested]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: make testCheck two things after you add the trigger:
- The workflow file on the base branch contains the
merge_grouptrigger. Merge group runs use the workflow as it exists on the merge group commit, so merge the workflow change first. - No
branchesfilter excludes the temporary branch. Apushorpull_requestbranch filter does not apply tomerge_group, but anyif:condition on a job that testsgithub.event_name == 'pull_request'will skip the job.
A skipped job can look like a stall. Open the Actions tab, filter by event merge_group, and confirm a run exists for the entry.
Problem: checks run but the entry still waits
If a run exists and passed, compare names. A required status check is matched by its reported name, which is the job name (or the name: of the job), not the workflow name. Renaming a job, or using a matrix that changes the displayed name, leaves the required check waiting for a name that never appears.
- Compare the required checks listed in the branch protection rule or ruleset with the check names shown on the merge group commit.
- If a path filter or conditional skips a workflow, the check is never reported. Use a single always-running job that depends on the others, and require only that job.
- Remember that required checks must pass on the merge group commit. Passing on the pull request does not count.
Problem: the entry was removed
A pull request leaves the queue for three main reasons.
| Cause | What you see | Fix |
|---|---|---|
| A required check failed on the merge group | Entry removed, failure shown on the group | Fix the failure and add the PR again |
| Checks exceeded the response timeout | Entry removed with a timeout message | Raise `check_response_timeout_minutes` or shorten the job |
| Merge conflict with the base or an earlier entry | Entry cannot form a group | Update the branch, resolve the conflict, re-add |
With the ALLGREEN grouping strategy, one failing group removes the entry that caused it. Entries queued behind it are rebuilt without it.
Problem: the queue is slow, not stuck
Before assuming a fault, check capacity. A queue builds up to max_entries_to_build groups at once. If your runners are limited, those builds wait for machines, and a long wait looks like a stall. Also check min_entries_to_merge_wait_minutes: a group may be deliberately waiting for more entries before it merges.
Exercise
A pull request passes all checks, joins the queue, and is removed after 60 minutes with a timeout. The workflow has on: pull_request only. What is the cause, and what is the fix?
Show answer
The required check never ran on the merge group branch, because the workflow does not listen for the merge_group event. Add merge_group (with types: [checks_requested], or no types) to the on: block, merge that change into the base branch, and add the pull request to the queue again.
Exercise
The test job runs on the merge group commit and passes, but the entry still waits. The required check list contains CI / test (ubuntu), and the job now reports as test (ubuntu-latest). What do you change?
Show answer
The required check name no longer matches the reported name. Update the required check in the branch protection rule or ruleset to the current name, or restore the old job name. Better, require one stable aggregate job so renames and matrix changes do not break the rule.