Graph not showing up with a nil:NilClass error.
Summary
For one of our projects, the graph stopped showing up since the version 10.5.1. If we go to the production log, we get a 500 error message saying nil:NilClass.
What is the current bug behavior?
This happens all the time whether we clean cache, reconfigure, restart, or upgrade to 10.5.4 We have numerous other projects and their graphs are showing up.
For this particular repository, we have used BFG to clean up large files before. But the graph showed up fine before the upgrade to 10.5.1. (was using 10.3.3 previously).
Relevant logs and/or screenshots
Started GET "/xxx/xxx/network/master?format=json" for 127.0.0.1 at 2018-03-09 19:55:34 +0000 Processing by Projects::NetworkController#show as JSON Parameters: {"namespace_id"=>"xxx", "project_id"=>"xxx", "id"=>"master"} Completed 500 Internal Server Error in 167ms (ActiveRecord: 2.1ms)
NoMethodError (undefined method id' for nil:NilClass): lib/gitlab/git/repository.rb:645:in
block in refs_hash'
lib/gitlab/git/repository.rb:642:in each' lib/gitlab/git/repository.rb:642:in
refs_hash'
app/models/repository.rb:475:in method_missing' lib/gitlab/git/commit.rb:554:in
refs'
lib/gitlab/git/commit.rb:411:in ref_names' app/models/network/commit.rb:15:in
method_missing'
app/models/network/graph.rb:135:in include_ref?' app/models/network/graph.rb:124:in
block in commits_sort_by_ref'
app/models/network/graph.rb:123:in sort' app/models/network/graph.rb:123:in
commits_sort_by_ref'
app/models/network/graph.rb:66:in block in index_commits' lib/gitlab/gitaly_client.rb:297:in
allow_n_plus_1_calls'
app/models/network/graph.rb:65:in index_commits' app/models/network/graph.rb:17:in
initialize'
app/controllers/projects/network_controller.rb:25:in new' app/controllers/projects/network_controller.rb:25:in
block (3 levels) in show'
app/controllers/projects/network_controller.rb:17:in block in show' lib/gitlab/gitaly_client.rb:297:in
allow_n_plus_1_calls'
app/controllers/projects/network_controller.rb:13:in show' lib/gitlab/i18n.rb:47:in
with_locale'
lib/gitlab/i18n.rb:53:in with_user_locale' app/controllers/application_controller.rb:325:in
set_locale'
lib/gitlab/middleware/multipart.rb:95:in call' lib/gitlab/request_profiler/middleware.rb:14:in
call'
lib/gitlab/middleware/go.rb:17:in call' lib/gitlab/etag_caching/middleware.rb:11:in
call'
lib/gitlab/middleware/read_only.rb:31:in call' lib/gitlab/request_context.rb:18:in
call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
Output of checks
sudo gitlab-rake gitlab:git:fsck returns ok except notices about HEAD pointing to an unborn branch and no default references for a lot of our projects.
Results of GitLab environment info
omnibus installation.
System information System: Current User: git Using RVM: no Ruby Version: 2.3.6p384 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.3.0 Redis Version: 3.2.11 Git Version: 2.14.3 Sidekiq Version:5.0.5 Go Version: unknown
GitLab information Version: 10.5.4 Revision: gitlab-ce@8d768f995d8dbd6a835992a11285392e861ff755 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://xxx HTTP Clone URL: http://xxx/some-group/some-project.git SSH Clone URL: git@xxx:some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 6.0.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
Checking GitLab Shell ...
GitLab Shell version >= 6.0.3 ? ... OK (6.0.3) 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: ... 14/2 ... ok 13/3 ... ok 15/4 ... ok 15/5 ... ok 16/6 ... ok 13/9 ... ok 11/10 ... ok 14/11 ... ok 19/13 ... ok 11/15 ... ok 23/16 ... ok 8/18 ... ok 16/19 ... ok 8/20 ... ok 32/21 ... ok 1/22 ... ok 33/34 ... ok 35/35 ... ok 35/36 ... repository is empty 35/37 ... ok 35/38 ... ok 35/39 ... repository is empty 35/40 ... ok 43/41 ... ok 44/43 ... ok 35/44 ... ok 35/45 ... ok 35/46 ... repository is empty 15/47 ... ok 9/48 ... ok 35/49 ... repository is empty 35/50 ... repository is empty 35/51 ... repository is empty 35/52 ... repository is empty 15/53 ... ok 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 Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Reply by email is disabled in config/gitlab.yml 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? ... no Try fixing it: sudo chown -R git /var/opt/gitlab/gitlab-rails/uploads sudo find /var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} ; sudo find /var/opt/gitlab/gitlab-rails/uploads -type d -not -path /var/opt/gitlab/gitlab-rails/uploads -exec chmod 0700 {} ; For more information see: doc/install/installation.md in section "GitLab" Please fix the error above and rerun the checks. 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: ... 14/2 ... yes 13/3 ... yes 15/4 ... yes 15/5 ... yes 16/6 ... yes 13/9 ... yes 11/10 ... yes 14/11 ... yes 19/13 ... yes 11/15 ... yes 23/16 ... yes 8/18 ... yes 16/19 ... yes 8/20 ... yes 32/21 ... yes 1/22 ... yes 33/34 ... yes 35/35 ... yes 35/36 ... yes 35/37 ... yes 35/38 ... yes 35/39 ... yes 35/40 ... yes 43/41 ... yes 44/43 ... yes 35/44 ... yes 35/45 ... yes 35/46 ... yes 15/47 ... yes 9/48 ... yes 35/49 ... yes 35/50 ... yes 35/51 ... yes 35/52 ... yes 15/53 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.6) Git version >= 2.9.5 ? ... yes (2.14.3) Git user has default SSH configuration? ... yes Active users: ... 37
Checking GitLab ... Finished