Missing registry auth realm host
Summary
gitlab-ctl reconfigure
generates /var/opt/gitlab/registry/config.yml
with /jwt/auth
(without Gitlab host) as auth realm, even with both external_url
and registry_external_url
set with distinct (http) fqdn in gitlab.rb
.
Expected behavior
Auth realm URL should include Gitlab host as explained in the doc: https://docs.gitlab.com/ce/administration/container_registry.html#enable-the-container-registry
Actual behavior
/var/opt/gitlab/registry/config.yml
:
auth:
token:
realm: /jwt/auth
service: container_registry
issuer: omnibus-gitlab-issuer
rootcertbundle: /var/opt/gitlab/registry/gitlab-registry.crt
Login result:
# docker login -u ...
Error response from daemon: Get http://registry.example.com/v2/: Get /jwt/auth?account=registrytest&client_id=docker&offline_token=true&service=container_registry: unsupported protocol scheme ""
Workaround
Manually adding http://[Gitlab hostname]
before /jwt/auth
in /var/opt/gitlab/registry/config.yml
and restarting fixes the issue, but it's overwritten when reconfiguring omnibus...
Results of GitLab application Check
Checking GitLab Shell ...
GitLab Shell version >= 4.1.1 ? ... OK (4.1.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... no
User id for git: 994. Groupd id for git: 991
Try fixing it:
sudo chown -R git:git /var/opt/gitlab/git-data/repositories
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
2/1 ... ok
3/2 ... ok
4/4 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
[...]
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... skipped (no tmp uploads folder yet)
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/1 ... yes
3/2 ... yes
4/4 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.8.4)
Active users: 5
Checking GitLab ... Finished
Results of GitLab environment info
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 10.5.0
Sidekiq Version:4.2.7
GitLab information
Version: 8.15.2
Revision: 790035f
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: http://gitlab-ci.lab
HTTP Clone URL: http://gitlab-ci.lab/some-group/some-project.git
SSH Clone URL: git@gitlab-ci.lab:some-group/some-project.git
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 4.1.1
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git