Skip to content

Gitlab registry process doesn't listen IPv6 port

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Gitlab registry process doesn't listen IPv6 port

netstat -anp | grep registry
tcp        0      0 127.0.0.1:15000         0.0.0.0:*               LISTEN      65054/registry      
tcp        0      0 127.0.0.1:15001         0.0.0.0:*               LISTEN      65054/registry      
tcp        0      0 127.0.0.1:15001         127.0.0.1:36468         ESTABLISHED 65054/registry

part of /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

localhost resolves as IPv4 and IPv6

Part of config of nginx

proxy_pass          http://localhost:15000; 

So, in error logs for this location appears a lot of errors like:

2020/09/10 08:19:35 [error] 35832#35832: *2398985 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.36.167, server: some_hostname, request: "GET /v2/bla/bla/bla/manifests/some_tag HTTP/1.1", upstream: "http://[::1]:15000/v2/bla/bla/bla/manifests/some_tag", host: "some_hostname"

because sometimes nginx tries to proxy request to IPv6 localhost. But there is no listener on IPv6 localhost 15000

Steps to reproduce

  1. Check if gitlab registry listen IPv6 address
  2. Config nginx to proxy on localhost:15000
  3. Send a lot of requests to gitlab registry
  4. Get an error on some attempt.

What is the current bug behavior?

Gitlab registry can't accept requests on IPv6 address

What is the expected correct behavior?

Gitlab registry can accept requests on IPv6 address

Relevant logs and/or screenshots

2020/09/10 08:19:35 [error] 35832#35832: *2398985 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.36.167, server: some_hostname, request: "GET /v2/bla/bla/bla/manifests/some_tag HTTP/1.1", upstream: "http://[::1]:15000/v2/bla/bla/bla/manifests/some_tag", host: "some_hostname"

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

```
System information
System:
Proxy:          no
Current User:   git
Using RVM:      no
Ruby Version:   2.6.6p146
Gem Version:    2.7.10
Bundler Version:1.17.3
Rake Version:   12.3.3
Redis Version:  5.0.9
Git Version:    2.26.2
Sidekiq Version:5.2.7
Go Version:     unknown

GitLab information
Version:        13.0.3-ee
Revision:       d27df234886
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     11.7
URL:            https://gitlab-portal.softline.com
HTTP Clone URL: https://gitlab-portal.softline.com/some-group/some-project.git
SSH Clone URL:  git@gitlab-portal.softline.com:some-group/some-project.git
Elasticsearch:  no
Geo:            no
Using LDAP:     yes
Using Omniauth: yes
Omniauth Providers: 

GitLab Shell
Version:        13.2.0
Repository storage paths:
- default:      /var/opt/gitlab/git-data/repositories
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell
Git:            /opt/gitlab/embedded/bin/git
```

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.2.0 ? ... OK (13.2.0)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/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 ... 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: ... Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
        User output sanitized. Found 100 users of 100 limit.

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: ... 
3/2 ... yes
12/12 ... yes
12/15 ... yes
12/16 ... yes
12/17 ... yes
12/18 ... yes
12/19 ... yes
15/20 ... yes
17/22 ... yes
12/23 ... yes
18/29 ... yes
18/30 ... yes
18/31 ... yes
25/32 ... yes
25/33 ... yes
25/34 ... yes
3/36 ... yes
12/37 ... yes
3/38 ... yes
12/39 ... yes
25/40 ... yes
25/41 ... yes
2/42 ... yes
37/46 ... yes
37/47 ... yes
12/48 ... yes
25/49 ... yes
2/50 ... yes
40/51 ... yes
37/53 ... yes
12/54 ... yes
12/55 ... yes
49/57 ... yes
48/63 ... yes
12/64 ... yes
Redis version >= 4.0.0? ... yes
Ruby version >= 2.5.3 ? ... yes (2.6.6)
Git version >= 2.22.0 ? ... yes (2.26.2)
Git user has default SSH configuration? ... yes
Active users: ... 25
Is authorized keys file accessible? ... yes
GitLab configured to store new projects in hashed storage? ... yes
All projects are in hashed storage? ... no
  Try fixing it:
  Please migrate all projects to hashed storage
  as legacy storage is deprecated in 13.0 and support will be removed in 14.0.
  For more information see:
  doc/administration/repository_storage_types.md
Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished


Checking GitLab subtasks ... Finished

Possible fixes

Edited by 🤖 GitLab Bot 🤖