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

Closed
Open
Created Sep 16, 2013 by Administrator@rootOwner

Empty Public Project returns 500 error

Created by: karlhungus

https://github.com/gitlabhq/gitlabhq/blob/master/app/controllers/public/projects_controller.rb

Seems that on line 22 @tree = Tree.new(@repository, @commit.id) of show:

  def show
    @project = Project.public_only.find_with_namespace(params[:id])
    render_404 and return unless @project

    @repository = @project.repository
    @recent_tags = @repository.tags.first(10)

    @commit = @repository.commit(params[:ref])
    @tree = Tree.new(@repository, @commit.id)
  end

There is no @commit (because project is empty).

Error logs: production.log

Started GET "/public/projects/ialpert/izaak-test" for 127.0.0.1 at 2013-09-16 16:03:25 -0400
Processing by Public::ProjectsController#show as HTML
  Parameters: {"id"=>"ialpert/izaak-test"}
Completed 500 Internal Server Error in 15ms

NoMethodError (undefined method `id' for nil:NilClass):
  app/controllers/public/projects_controller.rb:22:in `show'

To reproduce

  1. Create a new empty project
  2. Set project to public
  3. go to public projects page
  4. click on project -> 500 error
Assignee
Assign to
Time tracking