Redirection from pages to docker registry
Summary
Hi everybody,
I'm posting my issue here because I didn't get any help on the GitLab Pages issue tracker (gitlab-pages#210 (closed))
My instance is acting very strangely. I'm using GitLab 11.8.0 with GitLab Pages 1.5.0 and my pages are stored under *.nowtryz.com
. I checked my DNS records and everything seems good, so is there a bug?
Thanks a lot for the hard work you do.
Steps to reproduce
- Try to access http://whatever.nowtryz.com/whatever.
What is the current bug behavior?
The heck is that when I try to access http://whatever.nowtryz.com/whatever, I'm redirected to https://registry.nowtryz.net:4567/whatever which is the address of my Docker registry.
What is the expected correct behavior?
I should see the whatever/whatever
's pages
artifacts (which doesn't exist but the result is the same).
Output of checks
Using gitlab-ctl tail gitlab-pages
, I see that the pages ip is in use:
2019-03-11_19:01:05.72115 time="2019-03-11T19:01:05Z" level=fatal error="listen tcp 51.68.57.119:80: bind: address already in use"
2019-03-11_19:01:06.74802 time="2019-03-11T19:01:06Z" level=info msg="GitLab Pages Daemon" revision=869b94c version=1.5.0
And that seems to be true because the result of netstat -peanut
from inside the docker container is showing the following:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 0 119002070 743/nginx
But I cannot find any way to prevent nginx from listening to all addresses...
Results of GitLab environment info
Expand for output related to GitLab environment info
root@git:/# gitlab-rake gitlab:env:infoSystem 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.2 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.5 Go Version: unknown
GitLab information Version: 11.8.1 Revision: 657d508 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://git.nowtryz.net HTTP Clone URL: https://git.nowtryz.net/some-group/some-project.git SSH Clone URL: git@git.nowtryz.net:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 8.4.4 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
root@git:/# gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.4 ? ... OK (8.4.4) 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: ... 34/1 ... yes 34/2 ... yes 34/3 ... yes 34/4 ... yes 34/5 ... yes 36/7 ... yes 36/8 ... yes 37/9 ... yes 37/10 ... yes 39/11 ... yes 39/12 ... yes 39/14 ... yes 1/15 ... yes 40/16 ... yes 1/17 ... yes 1/18 ... yes 1/19 ... yes 38/20 ... yes 1/21 ... yes 49/23 ... yes 49/24 ... 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: ... 9
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
If there is no specific IP set for the registry to listen, it listens to all addresses instead of the main instance one. So just use the main instance listened to address as the default address for the registry.
/label gitlab-ce~2278648