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
  • #3991

Closed
Open
Created May 19, 2013 by Administrator@rootOwner

500 Internal Server Error - TypeError (can't convert nil into String) when check repo is empty.

Created by: Jazznight

After import by "run bundle exec rake gitlab:import:repos RAILS_ENV=production".

I can login and see all the projects at dashboard page. But I can't explorer a specific repo when i click any project link (Please refer log as below msg).

Started GET "/root/common" for at 2013-05-19 17:52:38 +0800 Processing by ProjectsController#show as HTML Parameters: {"id"=>"root/common"} Completed 500 Internal Server Error in 576ms

TypeError (can't convert nil into String): lib/gitlab/git/repository.rb:54:in commit' lib/gitlab/git/repository.rb:125:inhas_commits?' lib/gitlab/git/repository.rb:131:in empty?' app/models/repository.rb:20:inempty?' app/models/project.rb:339:in empty_repo?' app/controllers/projects_controller.rb:61:inblock (2 levels) in show' app/controllers/projects_controller.rb:59:in `show'

PS. I have checked lib/gitlab/git/repository.rb#commit. It's very weird..

  def commit(commit_id = nil)
    commit = if commit_id
               repo.commit(commit_id)
             else
               repo.commits(root_ref).first                              <==  line 54
             end

    decorate_commit(commit) if commit
  end

I have also change line (54) to : Grit::Repo.new('/gitroot/root/common.git').commit('master').first but I still got the same error at line 54.

I also check this line at rails console, but it work well! 1. RAILS_ENV=production bundle exec rails c 2. Grit::Repo.new('/gitroot/root/common.git').commit('master') => <Grit::Commit "5756bbb95cbb665aed16b3e072d11637ae71656d">

Assignee
Assign to
Time tracking