Skip to content

500 Error when attempting to view MR after its target branch was deleted

Summary

Merge Request pages throw 500 error when the target branch is deleted

Steps to reproduce

  1. Create a branch example1
  2. Create a MR from branch example1 targeting default branch (e.g. develop)
  3. Create a branch example2 from example1
  4. Create a MR from branch example2 targeting the example1 branch from the first MR
  5. Merge the first MR from example1 into target branch checking the option to delete the branch example1
  6. Attempting to open MR2 for example2 branch will now cause a 500 error (see example MR below)

Example Project

https://gitlab.com/joshfriend/deleted-target-branch-bug/merge_requests/3

What is the current bug behavior?

500 Internal Server Error

What is the expected correct behavior?

I should be able to view the MR and edit it's target branch

Relevant logs and/or screenshots

I do not currently have access to the logs, but I'm working on it.

Output of checks

This bug happens on GitLab.com

Our organization is running 11.0.2-ee internally as well, which is where I found this behavior originally.

gitlab-ee2278648 gitlab-ee3630472

Edited by Josh Friend