- Blog

Keep it simple

Fixing Not Found (404) error for project scans while setting up Jenkins GitLab Branch Source Plugin

written on 16 April 2021
In my case, we had Jenkins access GitLab through a reverse proxy - nginx. Gitlab was running inside a docker container. I could nicely configure then Jenkins job itself with the GitLab Branch Source Plugin, it even nicely auto-discovered the projects for the owner that I set. However, once it tried to do the "SCan GitLab Project Now", it would give me an error saying "Not found (404)" for the project. For debugging, I ran a `tcpdump -A port 80` in the GitLab container, showing an access path looking like this: ```sh ``` Clearly, this didn't match the GitLab API URL for projects, which expects an ":id": [](). It took a long while to figure out, that the API component of the Branch Source Plugin actually URL-encodes the "project path" as the id, i.e. the request URL is actually: ```sh ``` **Turns out, you have to tell nginx to use the original URI as-is (and not automatically unwrap/decode the URI...):** ```sh Wrong: proxy_pass Correct: proxy_pass$request_uri ``` More info in this StackOverflow thread: []()