Skip to content

Web IDE not working with relative URL configuration

Summary

Web IDE does not work with GitLab configured to use a relative URL due to wrong API usage.

Steps to reproduce

  • Configure GitLab to be accessible with a relative URL, e.g. https://server/gitlab
  • Open Web IDE for any project

What is the current bug behavior?

GitLab reports the following error to the user:

Error while loading the project data. Please try again.

What is the expected correct behavior?

Web IDE should start up as with a non-relative URL configuration.

Relevant logs and/or screenshots

JavaScript console shows the following error in Chrome:

xhr.js:178 GET https://server/gitlab/api/v4/projects/gitlab%2Ftest-group%2Ftest-roject 404 ()
project.js:21 Uncaught (in promise) Error: Project not loaded gitlab/test-group/test-project
    at project.js:21

Obviously the API request should be https://server/gitlab/api/v4/projects/test-group%2Ftest-roject without the additional gitlab%2F.

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:		Debian 9.4
Current User:	git
Using RVM:	no
Ruby Version:	2.3.6p384
Gem Version:	2.6.13
Bundler Version:1.13.7
Rake Version:	12.3.0
Redis Version:	3.2.11
Git Version:	2.14.3
Sidekiq Version:5.0.5
Go Version:	go1.7.4 linux/amd64

GitLab information Version: 10.7.0 Revision: 1890d6e Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://server/gitlab HTTP Clone URL: https://server/gitlab/some-group/some-project.git SSH Clone URL: git@server:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers: redmine

GitLab Shell Version: 7.1.2 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking GitLab Shell ...

GitLab Shell version >= 7.1.2 ? ... OK (7.1.2) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 2/2 ... ok 2/3 ... ok 7/12 ... ok 7/13 ... ok 7/15 ... ok 7/16 ... ok 12/18 ... ok 12/20 ... ok 7/22 ... ok 7/23 ... ok 13/25 ... ok 12/28 ... ok 13/35 ... ok 2/36 ... ok 12/38 ... ok 7/42 ... ok 13/43 ... ok 13/44 ... ok 27/46 ... ok 27/47 ... ok 27/48 ... ok 27/49 ... ok 27/50 ... ok 25/51 ... ok 25/52 ... ok 25/53 ... ok 25/54 ... ok 25/55 ... ok 25/56 ... ok 25/57 ... ok 12/58 ... ok 12/59 ... ok 12/61 ... ok 12/62 ... ok 13/63 ... ok 13/67 ... ok 26/68 ... ok 12/69 ... ok 2/72 ... ok 26/73 ... ok 6/74 ... ok 13/76 ... ok 12/77 ... ok 2/90 ... ok 12/91 ... ok 2/92 ... ok 26/93 ... ok 26/94 ... ok 6/95 ... ok 13/96 ... ok 13/97 ... ok 13/98 ... ok 12/101 ... ok 2/102 ... ok 12/103 ... ok 21/104 ... ok 7/105 ... ok 12/106 ... ok 19/107 ... ok 2/108 ... ok 6/113 ... ok 12/114 ... ok 26/115 ... ok 26/116 ... ok 33/118 ... ok 33/119 ... ok 33/120 ... ok 33/121 ... ok 33/122 ... ok 13/123 ... ok 12/124 ... ok 6/125 ... ok 33/126 ... ok 2/127 ... ok 26/128 ... ok 26/129 ... ok 38/130 ... ok 39/131 ... ok 7/132 ... ok 40/133 ... ok 41/135 ... ok 20/137 ... ok 41/138 ... ok 41/139 ... ok 41/140 ... ok 41/141 ... ok 20/142 ... ok 20/143 ... ok 41/144 ... ok 41/145 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Reply by email is disabled in config/gitlab.yml Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/2 ... yes 2/3 ... yes 7/12 ... yes 7/13 ... yes 7/15 ... yes 7/16 ... yes 12/18 ... yes 12/20 ... yes 7/22 ... yes 7/23 ... yes 13/25 ... yes 12/28 ... yes 13/35 ... yes 2/36 ... yes 12/38 ... yes 7/42 ... yes 13/43 ... yes 13/44 ... yes 27/46 ... yes 27/47 ... yes 27/48 ... yes 27/49 ... yes 27/50 ... yes 25/51 ... yes 25/52 ... yes 25/53 ... yes 25/54 ... yes 25/55 ... yes 25/56 ... yes 25/57 ... yes 12/58 ... yes 12/59 ... yes 12/61 ... yes 12/62 ... yes 13/63 ... yes 13/67 ... yes 26/68 ... yes 12/69 ... yes 2/72 ... yes 26/73 ... yes 6/74 ... yes 13/76 ... yes 12/77 ... yes 2/90 ... yes 12/91 ... yes 2/92 ... yes 26/93 ... yes 26/94 ... yes 6/95 ... yes 13/96 ... yes 13/97 ... yes 13/98 ... yes 12/101 ... yes 2/102 ... yes 12/103 ... yes 21/104 ... yes 7/105 ... yes 12/106 ... yes 19/107 ... yes 2/108 ... yes 6/113 ... yes 12/114 ... yes 26/115 ... yes 26/116 ... yes 33/118 ... yes 33/119 ... yes 33/120 ... yes 33/121 ... yes 33/122 ... yes 13/123 ... yes 12/124 ... yes 6/125 ... yes 33/126 ... yes 2/127 ... yes 26/128 ... yes 26/129 ... yes 38/130 ... yes 39/131 ... yes 7/132 ... yes 40/133 ... yes 41/135 ... yes 20/137 ... yes 41/138 ... yes 41/139 ... yes 41/140 ... yes 41/141 ... yes 20/142 ... yes 20/143 ... yes 41/144 ... yes 41/145 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.6) Git version >= 2.9.5 ? ... yes (2.14.3) Git user has default SSH configuration? ... yes Active users: ... 16

Checking GitLab ... Finished