Skip to content

Using forward slashes in branch names causes 404

Summary

When using a tool (git, VScode or any other client) to push a new branch with forward slashes in the name (e.g. feature/newFeature) it will create the branch but not fully since you'll not be able to browse to it on the Gitlab WebGUI.

For the original bug report, see the forum post

Steps to reproduce

Install Gitlab-ce version 17.1.0 or newer, issue a git push origin main:feature/newFeature, browse the new branch on the WebUI. You should stumble upon a 404 page.

  1. Visit https://gitlab.com/vyaklushin/public-project/-/tree/feature/signatures
  2. Click on History button
  3. You should see a 404 page

Links to test:

Example Project

I wasn't able to reproduce the bug here. It seems that, either gitlab.com is running an older version than 17.1, or gitlab.com is running the ee version whick may not be affected by this bug.

What is the current bug behavior?

Issuing 404 pages to branches containing forward slashes "/" and that were not created using the gitlab's web interface.

What is the expected correct behavior?

Getting a normal HTTP 200 response by being able to view the branch correctly.

Relevant logs and/or screenshots

a94653fb85b59be33b4c26b73ea12c49eac12b36

d3feaf43c7366eb285f9a74732982a7a9e2fa134

Workaround

For Gitlab-ce 17.1.0 or newer. Create the branches on the web interface. If your "feature/newFeature" is displaying 404, create "feature/randomString" this will "unlock" the previous one and all other branches that are or will be named with with the prefix "feature/".

Other workaround : simply downgrade to 17.0.X versions

Edited by 🤖 GitLab Bot 🤖