"Artifacts HTML Preview" does not work, display 502
Summary
HTML Preview of Artifacts added in GitLab 10.1 does not work. 502 page is displayed.
Steps to reproduce
- Click html file in job's artifacts
- Display 502 page
Example Project
Using gitlab/gitlab-ee
docker image
What is the current bug behavior?
502 page displayed
What is the expected correct behavior?
HTML preview shown
Relevant logs and/or screenshots
# tail -1 /var/log/gitlab/gitlab-pages/current
2017-11-01_01:05:50.84710 masakura.pages.example.com 127.0.0.1:38470 - - [2017-11-01 01:05:50.845674701 +0000 UTC] "GET /-/previewhtml/-/jobs/4/artifacts/index.html HTTP/1.0" 502 2905 "http://gitlab.example.com/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0" 0.001277
# tail -1 /var/log/gitlab/nginx/gitlab_pages_access.log
172.17.0.1 - - [01/Nov/2017:01:05:50 +0000] "GET /-/previewhtml/-/jobs/4/artifacts/index.html HTTP/1.1" 502 2917 "http://gitlab.example.com/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0"
# ngrep -W byline -d lo port 53
interface: lo (127.0.0.0/255.0.0.0)
filter: (ip or ip6) and ( port 53 )
#
U 127.0.0.1:58755 -> 127.0.0.1:53
^............gitlab.example.com.....
#
U 127.0.0.1:35415 -> 127.0.0.1:53
.............gitlab.example.com.....
#
U 127.0.0.1:50177 -> 127.0.0.1:53
d/...........gitlab.example.com.....
#
U 127.0.0.1:55671 -> 127.0.0.1:53
.K...........gitlab.example.com.....
- gitlab-pages is running on chroot
- Can not access /etc/resolv.conf because it is chroot
- Attempt to resolve names with localhost, when access http://gitlab.example.com/api/v4/....
- Name resolution fails
- 502 page displayed
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.3.5p376 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.1.0 Redis Version: 3.2.5 Git Version: 2.13.5 Sidekiq Version:5.0.4 Go Version: unknownGitLab information Version: 10.1.0-ee Revision: 3a712c3 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.5 URL: http://gitlab.example.com HTTP Clone URL: http://gitlab.example.com/some-group/some-project.git SSH Clone URL: git@gitlab.example.com:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.9.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 [33mGitLab Shell[0m ...GitLab Shell version >= 5.9.3 ? ... [32mOK (5.9.3)[0m Repo base directory exists? default... [32myes[0m Repo storage directories are symlinks? default... [32mno[0m Repo paths owned by git:root, or git:git? default... [32myes[0m Repo paths access is drwxrws---? default... [32myes[0m hooks directories in repos are links: ... [33m2[0m/[33m1[0m ... [32mok[0m [33m2[0m/[33m2[0m ... [32mok[0m 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 [32mgitlab-shell self-check successful[0m
Checking [33mGitLab Shell[0m ... [32mFinished[0m
Checking [33mSidekiq[0m ...
Running? ... [32myes[0m Number of Sidekiq processes ... [32m1[0m
Checking [33mSidekiq[0m ... [32mFinished[0m
Reply by email is disabled in config/gitlab.yml Checking [33mLDAP[0m ...
LDAP is disabled in config/gitlab.yml
Checking [33mLDAP[0m ... [32mFinished[0m
Checking [33mGitLab[0m ...
Git configured correctly? ... [32myes[0m Database config exists? ... [32myes[0m All migrations up? ... [32myes[0m Database contains orphaned GroupMembers? ... [32mno[0m GitLab config exists? ... [32myes[0m GitLab config up to date? ... [32myes[0m Log directory writable? ... [32myes[0m Tmp directory writable? ... [32myes[0m Uploads directory exists? ... [32myes[0m Uploads directory has correct permissions? ... [32myes[0m Uploads directory tmp has correct permissions? ... [35mskipped (no tmp uploads folder yet)[0m Init script exists? ... [35mskipped (omnibus-gitlab has no init script)[0m Init script up-to-date? ... [35mskipped (omnibus-gitlab has no init script)[0m Projects have namespace: ... [33m2[0m/[33m1[0m ... [32myes[0m [33m2[0m/[33m2[0m ... [32myes[0m Redis version >= 2.8.0? ... [32myes[0m Ruby version >= 2.3.3 ? ... [32myes (2.3.5)[0m Git version >= 2.7.3 ? ... [32myes (2.13.5)[0m Git user has default SSH configuration? ... [32myes[0m Active users: ... [32m2[0m Elasticsearch version 5.1 - 5.5? ... [35mskipped (elasticsearch is disabled)[0m
Checking [33mGitLab[0m ... [32mFinished[0m