7.4: error when viewing the contents of a directory
Summary: internal server error when viewing contents of specific directory under the Files pane.
Steps to reproduce: unclear, as it seems to happen with only some directories.
Expected behavior: a normal file listing
Observed behavior: Happens since upgrading Gitlab from 6.6.5 to 7.4(rc, and after that, stable). In certain projects, when opening a particular directory in the Files view, a 500 internal server error occurs.
Relevant logs: The production.log shows the following after clicking the directory in the listing:
Started GET "/mygroup/myproject/tree/master/MyDirectory" for 127.0.0.1 at 2014-10-22 22:42:42 +0200
Processing by Projects::TreeController#show as HTML
Parameters: {"project_id"=>"mygroup/myproject", "id"=>"master/MyDirectory"}
Completed 500 Internal Server Error in 373ms
ActionView::Template::Error (undefined method `[]' for nil:NilClass):
1: - tree, commit = submodule_links(submodule_item)
2: %tr{ class: "tree-item" }
3: %td.tree-item-file-name
4: %i.fa.fa-archive
app/models/repository.rb:162:in `method_missing'
app/models/repository.rb:228:in `submodule_url_for'
app/helpers/submodule_helper.rb:6:in `submodule_links'
app/views/projects/tree/_submodule_item.html.haml:1:in `_app_views_projects_tree__submodule_item_html_haml__1960578592168380494_48290660'
app/helpers/tree_helper.rb:19:in `render_tree'
app/views/projects/tree/_tree.html.haml:42:in `_app_views_projects_tree__tree_html_haml__985986129427416040_29680420'
app/views/projects/tree/show.html.haml:9:in `_app_views_projects_tree_show_html_haml___3955057514203210948_31577660'
app/controllers/projects/tree_controller.rb:13:in `show'
Started GET "/mygroup/myproject/tree/master/MyDirectory" for 127.0.0.1 at 2014-10-22 22:42:42 +0200
Processing by Projects::TreeController#show as HTML
Parameters: {"project_id"=>"mygroup/myproject", "id"=>"master/MyDirectory"}
Completed 500 Internal Server Error in 348ms
ActionView::Template::Error (undefined method `[]' for nil:NilClass):
1: - tree, commit = submodule_links(submodule_item)
2: %tr{ class: "tree-item" }
3: %td.tree-item-file-name
4: %i.fa.fa-archive
app/models/repository.rb:162:in `method_missing'
app/models/repository.rb:228:in `submodule_url_for'
app/helpers/submodule_helper.rb:6:in `submodule_links'
app/views/projects/tree/_submodule_item.html.haml:1:in `_app_views_projects_tree__submodule_item_html_haml__1960578592168380494_48290660'
app/helpers/tree_helper.rb:19:in `render_tree'
app/views/projects/tree/_tree.html.haml:42:in `_app_views_projects_tree__tree_html_haml__985986129427416040_29680420'
app/views/projects/tree/show.html.haml:9:in `_app_views_projects_tree_show_html_haml___3955057514203210948_31577660'
app/controllers/projects/tree_controller.rb:13:in `show'
Unfortunately I can't supply any more information, as there is nothing I can deduce from the specific directory that triggers this problem, apart from the fact that it's pretty large (~700 files), and contains five submodules (this seems to be mentioned in one of the errors, but I'm not sure it's relevant).
Checks all pass. This is the output of bundle exec rake gitlab:env:info RAILS_ENV=production
:
System information
System: Debian 7.7
Current User: git
Using RVM: no
Ruby Version: 2.1.3p242
Gem Version: 2.2.2
Bundler Version:1.7.4
Rake Version: 10.3.2
Sidekiq Version:2.17.0
GitLab information
Version: 7.4.0
Revision: ba76dbc
Directory: /var/git/gitlab
DB Adapter: mysql2
URL: http://gitlab
HTTP Clone URL: http://gitlab/some-project.git
SSH Clone URL: git@gitlab:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 2.0.1
Repositories: /var/git/repositories/
Hooks: /var/git/gitlab-shell/hooks/
Git: /usr/bin/git