"new look" causes attach-file to ignore external_url

Summary

Attaching a file to an issue with "New look" enabled (on self-managed gitlab) results in a 404, the subdir from external_url is missing from the URL. It works fine with "New look" disabled.

Steps to reproduce

  1. Ensure "New look" is enabled.
  2. Create an issue or edit or comment on an existing one.
  3. Click on the paperclip icon to attach a file, select a file (does not seem to matter).

Immediately see

image

The gitlab_configs.rb file includes

external_url 'https://myhost.com/git'

Using the dev-console, the URL https://myhost.com/repogroup/reponame/uploads is missing the /git leading subdir, it should be https://myhost.com/git/repogroup/reponame/uploads.

What is the current bug behavior?

I cannot attach files to the issue with "New look" enabled.

What is the expected correct behavior?

The /uploads link should have included the leading /git subdir.

Expand for output related to GitLab environment info
System information
System:
Current User:   git
Using RVM:      no
Ruby Version:   3.2.5
Gem Version:    3.6.5
Bundler Version:2.6.5
Rake Version:   13.0.6
Redis Version:  7.0.15
Sidekiq Version:7.2.4
Go Version:     unknown

GitLab information
Version:        17.10.3
Revision:       22d4014a923
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     16.8
URL:            https://myhost.com/git
HTTP Clone URL: https://myhost.com/git/some-group/some-project.git
SSH Clone URL:  ssh://git@myhost.com:20027/some-group/some-project.git
Using LDAP:     yes
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version:        14.41.0
Repository storages:
- default:      unix:/var/opt/gitlab/gitaly/gitaly.socket
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell

Gitaly
- default Address:      unix:/var/opt/gitlab/gitaly/gitaly.socket
- default Version:      17.10.3
- default Git Version:  2.48.1.gl1
- 

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 >= 14.41.0 ? ... OK (14.41.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-check Internal API available: OK Redis available via internal API: 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 (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Checking Reply by email ...

IMAP server credentials are correct? ... Checking git@MyCompany.com no Try fixing it: An error occurred: Net::IMAP::NoResponseError: LOGIN failed. Check that the information in config/gitlab.yml is correct For more information see: doc/administration/reply_by_email.md Please fix the error above and rerun the checks. Mailroom enabled? ... skipped MailRoom running? ... skipped

Checking Reply by email ... Finished

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) User output sanitized. Found 12 users of 100 limit.

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes Tables are truncated? ... skipped All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Cable config exists? ... yes Resque config exists? ... 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 Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 5/3 ... yes 4/4 ... yes 5/5 ... yes 5/6 ... yes 14/7 ... yes 4/9 ... yes 5/10 ... yes 4/12 ... yes 4/13 ... yes 4/14 ... yes 4/15 ... yes 4/16 ... yes 22/17 ... yes 22/18 ... yes 4/19 ... yes 22/20 ... yes 4/21 ... yes 4/22 ... yes 4/23 ... yes 4/24 ... yes 4/25 ... yes 4/26 ... yes 4/27 ... yes 3/28 ... yes 3/29 ... yes 3/30 ... yes 3/31 ... yes 3/32 ... yes 3/33 ... yes 3/34 ... yes 15/35 ... yes 15/36 ... yes 15/37 ... yes 15/38 ... yes 4/39 ... yes 2/40 ... yes 4/41 ... yes 4/42 ... yes 4/43 ... yes 15/44 ... yes 15/45 ... yes 5/46 ... yes 15/47 ... yes 15/48 ... yes 15/49 ... yes 14/50 ... yes 4/51 ... yes 15/52 ... yes 15/53 ... yes 4/54 ... yes 15/55 ... yes 14/56 ... yes 15/57 ... yes 15/58 ... yes 15/60 ... yes 4/61 ... yes 15/62 ... yes 15/63 ... yes 15/65 ... yes 15/66 ... yes 15/67 ... yes 15/68 ... yes 15/69 ... yes 4/71 ... yes 15/72 ... yes 5/73 ... yes 4/74 ... yes 15/75 ... yes 2/76 ... yes 15/77 ... yes 15/78 ... yes 15/79 ... yes 5/80 ... yes 15/82 ... yes 15/83 ... yes 15/84 ... yes 125/85 ... yes 15/86 ... yes 15/87 ... yes 15/88 ... yes 14/89 ... yes 15/90 ... yes 15/91 ... yes 15/92 ... yes 15/93 ... yes 15/94 ... yes 15/95 ... yes 15/96 ... yes 15/97 ... yes 15/98 ... yes 15/99 ... yes 15/100 ... yes 5/101 ... yes 5/102 ... yes 15/103 ... yes 15/104 ... yes 15/105 ... yes 15/106 ... yes 15/107 ... yes 15/108 ... yes 15/109 ... yes 15/110 ... yes 15/111 ... yes 131/112 ... yes 15/113 ... yes 14/114 ... yes 15/115 ... yes 15/116 ... yes 131/117 ... yes 131/118 ... yes 15/119 ... yes 131/120 ... yes 15/121 ... yes 15/122 ... yes 15/123 ... yes Redis version >= 6.2.14? ... yes Ruby version >= 3.0.6 ? ... yes (3.2.5) Git user has default SSH configuration? ... yes Active users: ... 10 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

Edited by Bill Evans