Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9140

Closed
Open
Created Apr 15, 2015 by Administrator@rootOwner

Files page on repo with submodules gives 500 (> 7.4) (ActionView::Template::Error (undefined method `content' for #<Rugged::Tree:0x00...))

Created by: RaymiiOrg

Summary: Files page on repo with submodules gives 500 (> 7.4) (ActionView::Template::Error (undefined method `content' for #<Rugged::Tree:0x00...))

Observed behavior:

We have a group with 3 repositories 'Work/{cluster,assets,playbooks}'. assets and playbooks are submodules in cluster.

In Gitlab <= 7.4 viewing the files tab works. In > 7.4 (tested up to 7.9), viewing the files tab gives an 500 error.

Manually creating a repo with submodules asdescribed here does not create this issue: https://git-scm.herokuapp.com/book/nl/v2/Git-Tools-Submodules.

Expected behavior:

Viewing files tab shows files instead of error.

Logging and checks:

Relevant part of production.log (after clicking files tab on repo):

  Started GET "/submodule-test/cluster/tree/master" for 12.34.56.789 at 2015-04-15 12:36:41 +0200
  Processing by Projects::TreeController#show as HTML
    Parameters: {"namespace_id"=>"submodule-test", "project_id"=>"cluster", "id"=>"master"}
  Completed 500 Internal Server Error in 57ms

  ActionView::Template::Error (undefined method `content' for #<Rugged::Tree:0x007f72da7655f8>):
      1: %tr{ class: "tree-item" }
      2:   %td.tree-item-file-name
      3:     %i.fa.fa-archive
      4:     = submodule_link(submodule_item, @ref)
      5:   %td
      6:   %td.hidden-xs
    app/models/repository.rb:170:in `method_missing'
    app/models/repository.rb:232:in `submodule_url_for'
    app/helpers/submodule_helper.rb:6:in `submodule_links'
    app/helpers/diff_helper.rb:140:in `submodule_link'
    app/views/projects/tree/_submodule_item.html.haml:4:in `_app_views_projects_tree__submodule_item_html_haml__4307942022963526435_70065634155080'
    app/helpers/tree_helper.rb:21:in `render_tree'
    app/views/projects/tree/_tree.html.haml:42:in `_app_views_projects_tree__tree_html_haml__3383678859715900827_70065564519840'
    app/views/projects/tree/show.html.haml:9:in `_app_views_projects_tree_show_html_haml__4087596354501233742_70065548835920'
    app/controllers/projects/tree_controller.rb:21:in `show'


  Started GET "/submodule-test/cluster/tree/master" for 12.34.56.789 at 2015-04-15 12:36:42 +0200
  Processing by Projects::TreeController#show as HTML
    Parameters: {"namespace_id"=>"submodule-test", "project_id"=>"cluster", "id"=>"master"}
  Completed 500 Internal Server Error in 230ms

  ActionView::Template::Error (undefined method `content' for #<Rugged::Tree:0x007f72da33ec18>):
      1: %tr{ class: "tree-item" }
      2:   %td.tree-item-file-name
      3:     %i.fa.fa-archive
      4:     = submodule_link(submodule_item, @ref)
      5:   %td
      6:   %td.hidden-xs
    app/models/repository.rb:170:in `method_missing'
    app/models/repository.rb:232:in `submodule_url_for'
    app/helpers/submodule_helper.rb:6:in `submodule_links'
    app/helpers/diff_helper.rb:140:in `submodule_link'
    app/views/projects/tree/_submodule_item.html.haml:4:in `_app_views_projects_tree__submodule_item_html_haml__4307942022963526435_70065631829040'
    app/helpers/tree_helper.rb:21:in `render_tree'
    app/views/projects/tree/_tree.html.haml:42:in `_app_views_projects_tree__tree_html_haml__3383678859715900827_70065630799500'
    app/views/projects/tree/show.html.haml:9:in `_app_views_projects_tree_show_html_haml__4087596354501233742_70065630248580'
    app/controllers/projects/tree_controller.rb:21:in `show'

Checks:

sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
Checking Environment ...

Git configured for git user? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 2.6.0 ? ... OK (2.6.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
hooks directories in repos are links: ... 
2/1 ... ok
2/2 ... ok
2/3 ... ok
1/4 ... ok
1/5 ... ok
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files: 
        /home/git/repositories/: OK
        /home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.2.12
Send ping to redis server: PONG
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ... 
2/1 ... yes
2/2 ... yes
2/3 ... yes
1/4 ... yes
1/5 ... yes
Projects have satellites? ... 
2/1 ... yes
2/2 ... yes
2/3 ... yes
1/4 ... yes
1/5 ... yes
Redis version >= 2.0.0? ... yes
Ruby version >= 2.0.0 ? ... yes (2.1.2)
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (2.3.5)
Active users: 1

Checking GitLab ... Finished



sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

System information
System:         Ubuntu 12.04
Current User:   git
Using RVM:      no
Ruby Version:   2.1.2p95
Gem Version:    2.2.2
Bundler Version:1.9.4
Rake Version:   10.4.2
Sidekiq Version:3.3.0

GitLab information
Version:        7.9.4
Revision:       b10de29
Directory:      /home/git/gitlab
DB Adapter:     mysql2
URL:            http://git-test.example.net
HTTP Clone URL: http://git-test.example.net/some-project.git
SSH Clone URL:  [email protected]:some-project.git
Using LDAP:     no
Using Omniauth: no

GitLab Shell
Version:        2.6.0
Repositories:   /home/git/repositories/
Hooks:          /home/git/gitlab-shell/hooks/
Git:            /usr/bin/git

Last commit:

commit b10de29edbaff7219547dc506cb1468ee35065c3
Author: Dmitriy Zaporozhets <[email protected]>
Date:   Wed Apr 15 12:21:44 2015 +0300

    Version 7.9.4
Assignee
Assign to
Time tracking