GitLab: a merge request blocked by an external status check
External status checks let a tool outside GitLab (ServiceNow or a script of your own) answer for a merge request. When the project requires them, detailed_merge_status reads status_checks_must_pass, the check's failure text is "All external status checks must pass.", and the merge page says Status checks must pass. (GitLab docs: external status checks and API, checked November 19, 2026).
When it blocks
- By default a merge request can be merged even if an external check fails. It is blocked only when a Maintainer or Owner turns on Status checks must succeed in Settings > Merge requests. In the source the check is inactive unless that setting and the licensed feature (Ultimate) are both there.
- Each check is
pending(no answer yet, the default),passedorfailed. Pending and failed both block. - Status checks fail if they stay pending for more than two minutes. A failed check can be retried, see below.
- GitLab sends the service a merge request webhook payload, with an
external_approval_ruleobject, whenever the merge request is updated, closed, reopened, approved, unapproved or merged, and when code is pushed to its source branch. A push therefore starts the check over.
To see that a status check is what blocks a merge request: Merge Request (MR) Review Inbox for GitLab, a plugin for JetBrains IDEs, lists the merge checks from detailed_merge_status with the blocking ones first.
Answering a check (the service's side)
curl --request POST --header "PRIVATE-TOKEN: your-token" \ --data "sha=HEAD_SHA_OF_THE_SOURCE_BRANCH" --data "external_status_check_id=1" --data "status=passed" \ "https://gitlab.com/api/v4/projects/123/merge_requests/42/status_check_responses"
shamust be the head of the merge request's source branch. GitLab answers 409 Conflict to any response about another commit, which makes it safe for a service to finish checking an old commit.statusispending,passedorfailed. The token must belong to a user with the Developer, Maintainer or Owner role on the target project.
Retrying a failed check
- In the merge request, open the list of external status checks and select Retry on the failed row; the check goes back to pending.
- Through the API:
POST /projects/:id/merge_requests/:merge_request_iid/status_checks/:external_status_check_id/retry. It answers202 Accepted; for a check that has already passed it answers 422External status check must be failed.
Other messages in the settings
Name is already takenandExternal API is already in use by another status check: a project can use a name or API URL once.Please provide a valid URL: the API to check must be an http or https address.Failed to load status checks: an unexpected answer from the status checks API. Refresh; if it stays, look at the GitLab status page.
GitLab merge requests in IntelliJ IDEA
Merge Request (MR) Review Inbox for GitLab, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, shows a merge request's merge checks before you merge: approvals, requested changes, unresolved threads, the pipeline, conflicts, and GitLab's other reasons from detailed_merge_status, with the ones that block the merge first, and the head pipeline with a link. GitLab's status checks status is one of those reasons, so a merge request that waits for an outside service is listed as blocked before you merge. Reading is free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GITLAB is a trademark of GitLab Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitLab Inc. or JetBrains.
More: GitLab merge refused (405, 409, 422) · GitLab "A CI/CD pipeline must run and be successful before merge" · GitLab "Merge request dependencies must be merged" · GitLab approval refused (401, 409)