Lesstep
GitLab · merge requests · rebase API · Checked October 24, 2026

GitLab: why the rebase did not happen

Rebasing a merge request through the API (PUT /projects/:id/merge_requests/:merge_request_iid/rebase) is refused at once with 403 or 409, or answers 202, which only means that GitLab has queued the rebase: it runs afterwards and can still fail. All of this is from GitLab's source (the rebase endpoint in lib/api/merge_requests.rb, MergeRequests::RebaseService, and rebase_async in app/models/merge_request.rb), read on October 24, 2026.

The answers

After the 202 ({"rebase_in_progress":true}), a rebase that fails leaves its reason in the merge request's merge_error:

GitLab also writes a failed merge there. merge_error stays until the next push to the source branch, or until the merge request is closed or merged.

A token without the api scope is refused with 403 too, but that answer says insufficient_scope; see which scope to add. A project path that does not exist, or that you cannot see, answers 404; see address or permission.

Where it stands

curl -H "PRIVATE-TOKEN: your-token" "https://gitlab.com/api/v4/projects/group%2Fproject/merge_requests/42?include_rebase_in_progress=true"

While rebase_in_progress is true, the rebase is still queued or running. Once it is false, merge_error is null if the rebase worked, or says why it failed. state tells whether the merge request is still open. Use your own server's address instead of gitlab.com.

What to do

GitLab merge requests in IntelliJ IDEA

Merge Request Inbox for GitLab, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, offers to rebase the source branch when GitLab says the merge request needs a rebase. When GitLab answers 403, it says that your role in the project or its settings may not let your account do it, with GitLab's words; other refusals in GitLab's words. After the 202, it says that GitLab is rebasing the branch and to refresh in a moment; from version 1.0.14, when the rebase fails afterwards, the overview shows what GitLab put in merge_error, until the branch is pushed again or the merge request can be merged. Reading is free; rebasing, approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).

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 auto-merge refused (405) or canceled · GitLab approval refused (401, 409) · GitLab comment or thread refused (400, 403) · GitLab merge request not created (409, 422, 400) · GitLab "insufficient_scope" · GitLab 401 "invalid_token" · GitLab 404 "Project Not Found" · GitLab merge request list refused (400, 404) · GitLab merge request changes cut short ("1000+", too_large) · GitLab 429 "Retry later" (rate limits) · GitLab merge refused or failed over squashing · GitLab "compare_timeout": true (diff limits) · GitLab merge request plugins for IntelliJ IDEA, compared · 日本語