Download URL for attachements in Snippet description is broken
Summary
On my private Gitlab CE instance, which is reachable by an URL like http://elpra-server/git/elpra, I've created a snippet and added an attachment in the snippet description.
I would expect that the Download URL of the file is something like:
http://elpra-server/git/elpra/uploads/-/system/personal_snippet/6/674e4f07fbf0a7736c3439212896e51a/example.tar.gz
but the generated URL is
http://elpra-server/uploads/-/system/personal_snippet/6/674e4f07fbf0a7736c3439212896e51a/example.tar.gz
This leads of course to a 404 error when clicking for download. When add the missing URL part /git/elpra
everything works fine.
The created Markdown tag is
[tuxedocomputers-clevo-xsm-wmi-dcf282992eb8.tar.gz](/uploads/-/system/personal_snippet/6/674e4f07fbf0a7736c3439212896e51a/tuxedocomputers-clevo-xsm-wmi-dcf282992eb8.tar.gz)
It seems like the URL creation is buggy.
The same can't be reproduced in Issue description. Here everything works fine, just the Snippets show this problem.
Steps to reproduce
Create a new Snippet and attach a file in the description field like in the image below.
Example Project
Only available on my intranet. It can't be reproduce on gitlab.com, maybe its a problem with the relative URL described in https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab
What is the current bug behavior?
404 error when downloading the attachment.
What is the expected correct behavior?
Valid download link.
Relevant logs and/or screenshots
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
My Gitlab instance is running in a Docker container.
Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.16.6 Rake Version: 12.3.1 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.3 Go Version: unknown
GitLab information Version: 11.6.3 Revision: bc9391c Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://elpra-server/git/elpra HTTP Clone URL: http://elpra-server/git/elpra/some-group/some-project.git SSH Clone URL: ssh://git@elpra-server:2222/some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 8.4.3 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 subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.3 ? ... OK (8.4.3) 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 Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
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: ... 6/4 ... yes 8/6 ... yes 4/7 ... yes 9/8 ... yes 6/9 ... yes 4/10 ... yes 4/11 ... yes 9/12 ... yes 8/13 ... yes 4/14 ... yes 7/15 ... yes 6/16 ... yes 15/18 ... yes 7/19 ... yes 16/20 ... yes 7/23 ... yes 7/26 ... yes 6/27 ... yes 6/28 ... yes 6/29 ... yes 2/30 ... yes 19/32 ... yes 19/33 ... yes 7/34 ... yes 7/36 ... yes 23/37 ... yes 23/38 ... yes 2/40 ... yes 24/41 ... yes 26/42 ... yes 6/43 ... yes 27/44 ... yes 29/45 ... yes 26/46 ... yes 6/47 ... yes 29/48 ... yes 29/49 ... yes 2/50 ... yes 2/51 ... yes 31/52 ... yes 2/53 ... yes 19/54 ... yes 27/55 ... yes 27/56 ... yes 2/57 ... yes 2/59 ... yes 31/60 ... yes 35/61 ... yes 23/62 ... yes 36/63 ... yes 19/64 ... yes 39/65 ... yes 40/66 ... yes 41/67 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 4
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
no idea