"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

  1. Install gitlab and expose it to a relative url. Example : "https://example.com/gitlab" (Update the /etc/gitlab/gitlab.rb file to do this)

  2. Open a project and go to "Settings/General"

  3. The following message is displayed

  4. Scroll down "Merge request approvals"

  5. The loader stucks under "Add approvers"

  6. Open browser dev tool (with f12)

  7. 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

image

image

image

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)

Results of GitLab application Check

System information System: Ubuntu 16.04 Proxy: no Current User: gitlab Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.5 Go Version: unknown

GitLab information Version: 11.10.0-ee Revision: dfa95630be4 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 9.6.12, URL: http://.../gitlab HTTP Clone URL: http://.../gitlab/some-group/some-project.git SSH Clone URL: ...@...:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: yes Omniauth Providers:

GitLab Shell Version: 9.0.0 Repository storage paths:

  • default: ... GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git