"An error occurred fetching the approval rules" when using relative URL
Summary
When using a relative url with gitlab, "An error occurred fetching the approval rules" is displayed on General Settings.
Steps to reproduce
-
Install gitlab and expose it to a relative url. Example : "https://example.com/gitlab" (Update the /etc/gitlab/gitlab.rb file to do this)
-
Open a project and go to "Settings/General"
-
The following message is displayed
-
Scroll down "Merge request approvals"
-
The loader stucks under "Add approvers"
-
Open browser dev tool (with f12)
-
Notice that the url of the API which is call ispath of called API is wrong :
http://.../api/v4/projects/6/approval_settings instead of http://.../gitlab/api/v4/projects/6/approval_settings
What is the current bug behavior?
- "An error occurred fetching the approval rules" is shown
- Approvers are not loaded in "Merge request approvals" section
What is the expected correct behavior?
- Error should not be displayed
- Approvers should be loaded in "Merge request approvals" section
Relevant logs and/or screenshots
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production)


