"undefined method `force_encoding' for nil:NilClass" on /artifacts/browse
Summary
Error 500 while browsing certain artifacts
Steps to reproduce
not kown, looking for debugging-hints
Download of artifacts via zip works.
Example Project
What is the current bug behavior?
HTTP error 500 shown
What is the expected correct behavior?
Beeing able to browse artifacts
Relevant logs and/or screenshots
Files in artifact are (output from file(1)
)
ASCII text
ASCII text, with very long lines
ASCII text, with very long lines, with CR, LF line terminators
empty
UTF-8 Unicode text, with very long lines
logs/gitlab-rails/production.log
says:
Started GET "/foo/repo/-/jobs/222/artifacts/browse" for 93. at 2017-08-24 10:40:36 +0000
Processing by Projects::ArtifactsController#browse as HTML
Parameters: {"namespace_id"=>"foo", "project_id"=>"repo", "job_id"=>"222"}
Completed 500 Internal Server Error in 16ms (ActiveRecord: 0.8ms)
NoMethodError (undefined method `force_encoding' for nil:NilClass):
lib/gitlab/ci/build/artifacts/metadata.rb:61:in `match_entries'
lib/gitlab/ci/build/artifacts/metadata.rb:42:in `block in find_entries!'
lib/gitlab/ci/build/artifacts/metadata.rb:105:in `open'
lib/gitlab/ci/build/artifacts/metadata.rb:105:in `gzip'
lib/gitlab/ci/build/artifacts/metadata.rb:40:in `find_entries!'
lib/gitlab/ci/build/artifacts/metadata.rb:47:in `to_entry'
app/models/ci/build.rb:308:in `artifacts_metadata_entry'
app/controllers/projects/artifacts_controller.rb:23:in `browse'
lib/gitlab/i18n.rb:45:in `with_locale'
lib/gitlab/i18n.rb:51:in `with_user_locale'
app/controllers/application_controller.rb:294:in `set_locale'
lib/gitlab/performance_bar/peek_performance_bar_with_rack_body.rb:16:in `call'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
lib/gitlab/middleware/go.rb:16:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
Output of checks
Results of GitLab environment info
Expand for output related to 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 Redis Version: 3.2.5 Git Version: 2.13.4 Sidekiq Version:5.0.0 Go Version: unknown
GitLab information Version: 9.4.5 Revision: 140292e Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://gitlab.x.com HTTP Clone URL: https://gitlab.x.com/some-group/some-project.git SSH Clone URL: git@gitlab.x.com:some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.3.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
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...
GitLab Shell version >= 5.3.1 ? ... OK (5.3.1) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 3/1 ... ok 6/2 ... ok 6/3 ... ok 7/4 ... ok 7/5 ... ok 7/6 ... ok 8/7 ... ok 9/13 ... ok 5/14 ... ok 5/15 ... ok 14/17 ... ok 5/19 ... ok 20/23 ... ok 17/24 ... ok 44/26 ... ok 21/27 ... ok 21/29 ... ok 21/30 ... ok 22/32 ... ok 21/33 ... ok 24/34 ... ok 25/35 ... ok 29/37 ... ok 28/38 ... ok 27/39 ... ok 17/40 ... ok 19/41 ... ok 14/43 ... ok 14/44 ... ok 14/45 ... ok 19/46 ... ok 21/47 ... ok 21/48 ... ok 14/49 ... ok 21/50 ... ok 31/51 ... ok 2/52 ... ok 2/53 ... ok 2/54 ... ok 2/55 ... ok 2/56 ... ok 2/57 ... ok 32/58 ... repository is empty 21/59 ... ok 34/60 ... ok 21/61 ... ok 2/62 ... ok 38/63 ... ok 40/64 ... ok 14/65 ... ok 44/66 ... ok 5/67 ... ok 44/68 ... ok 33/69 ... 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 ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
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/1 ... yes 6/2 ... yes 6/3 ... yes 7/4 ... yes 7/5 ... yes 7/6 ... yes 8/7 ... yes 9/13 ... yes 5/14 ... yes 5/15 ... yes 14/17 ... yes 5/19 ... yes 20/23 ... yes 17/24 ... yes 44/26 ... yes 21/27 ... yes 21/29 ... yes 21/30 ... yes 22/32 ... yes 21/33 ... yes 24/34 ... yes 25/35 ... yes 29/37 ... yes 28/38 ... yes 27/39 ... yes 17/40 ... yes 19/41 ... yes 14/43 ... yes 14/44 ... yes 14/45 ... yes 19/46 ... yes 21/47 ... yes 21/48 ... yes 14/49 ... yes 21/50 ... yes 31/51 ... yes 2/52 ... yes 2/53 ... yes 2/54 ... yes 2/55 ... yes 2/56 ... yes 2/57 ... yes 32/58 ... yes 21/59 ... yes 34/60 ... yes 21/61 ... yes 2/62 ... yes 38/63 ... yes 40/64 ... yes 14/65 ... yes 44/66 ... yes 5/67 ... yes 44/68 ... yes 33/69 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.3 ? ... yes (2.3.3) Git version >= 2.7.3 ? ... yes (2.13.4) Active users: ... 28
Checking GitLab ... Finished