'Error while loading the branch files' when opening Web IDE
Summary
GitLab Omnibus is deployed in LAN. We get a
Error while loading the branch files. Please try again.
error, while opening the Web IDE, if we browse using any address other then the address configured as the external_url
.
Steps to reproduce
- Deploy GitLab Omnibus in LAN with the fully qualified domain name as the external URL.
- Browse any project using an address other than the fully qualified domain name, for example IP address or just the host name.
- Try to open Web IDE.
What is the current bug behavior?
The Web IDE does not load. The error
Error while loading the branch files. Please try again.
is displayed.
What is the expected correct behavior?
It should use relative URL to load the project files instead of external_url/...
Relevant logs and/or screenshots
Chrome:
(index):1 Failed to load http://hostname.domain.com/group/project/files/master?format=json: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://hostname' is therefore not allowed access.
(index):1 Uncaught (in promise) je {url: "http://hostname.domain.com/group/project/files/master?format=json", ok: false, status: 0, statusText: "", headers: {…}, …}
Promise.catch (async)
(anonymous) @ ide_router.js:90
Promise.then (async)
(anonymous) @ ide_router.js:62
p @ vue-router.esm.js:1943
r @ vue-router.esm.js:1717
ue @ vue-router.esm.js:1725
nn.confirmTransition @ vue-router.esm.js:1972
nn.transitionTo @ vue-router.esm.js:1874
sn.init @ vue-router.esm.js:2494
beforeCreate @ vue-router.esm.js:540
Re @ vue.esm.js:2895
e._init @ vue.esm.js:4556
At @ vue.esm.js:4659
(anonymous) @ index.js:10
./ide/index.js @ index.js:22
r @ bootstrap 57532f8615919c45f89e:54
window.webpackJsonp @ bootstrap 57532f8615919c45f89e:25
(anonymous) @ ide.93a1aeb33f27abc0ec66.bundle.js:1
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 8.10 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: unknown
GitLab information Version: 10.7.1 Revision: 0d49bb8 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://hostname.domain.com HTTP Clone URL: http://hostname.domain.com/some-group/some-project.git SSH Clone URL: git@hostname.domain.com:some-group/some-project.git Using LDAP: yes Using Omniauth: no
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