GitLab: the merge pre-receive hook failed
A merge can fail with Something went wrong during merge pre-receive hook. followed by 500 Internal Server Error. Try again. In the logs of a Self-Managed server it appears as Rack::Timeout::RequestTimeoutException and "Request ran for longer than 60000ms." (GitLab docs: merge request troubleshooting, checked November 19, 2026).
Causes GitLab names
- The merge request has many diffs.
- The source branch is many commits behind the target branch.
- The merge request references a locked Git LFS file.
The merge ran for 60 seconds without finishing, so the timeout, not a rule of the repository, is what stopped it. GitLab's page does not say more than this about the cause, so treat the list as the places to look.
To see what else blocks the merge, so that this error is the only one left: 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.
What to do
- Try again. The message itself asks for it.
- Bring the branch up to date, since being far behind is a named cause: rebase it (the
/rebasequick action, or Rebase source branch in the merge widget; see when GitLab refuses the rebase), or merge the target branch into it. - Check for LFS locks on files the merge request changes:
git lfs locks; see merge blocked by locked files. - Self-Managed: an administrator reads
gitlab-rails/api_json.logfor the timeout and the server logs for the cause. - GitLab.com: GitLab's page tells users to contact Support.
For the merge API's own refusals (405, 409, 422), see why GitLab refused the merge; a 422 Branch cannot be merged is another answer, not this timeout.
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. 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 rebase refused or failed (403, 409) · GitLab squash refused or failed · GitLab merge blocked by locked files (locked_paths, locked_lfs_files)