Problem adding new issue with blank repository
Created by: alexrussell
I have just set up a new repository and, because I want to use issues as a kind of task tracker, I've gone into the issues to add some todo-like stuff. Upon clicking 'add new issue' I get a 500 error. I have other repositories with commits and adding issues is not a problem, but it is in this blank repository. The relevant lines from the production log file are:
Started GET "/alexrussell/repo/issues/new?issue%5Bassignee_id%5D=&issue%5Bmilestone_id%5D=" for 127.0.0.1 at 2014-05-01 22:10:53 +0100
Processing by Projects::IssuesController#new as HTML
Parameters: {"issue"=>{"assignee_id"=>"", "milestone_id"=>""}, "project_id"=>"alexrussell/repo"}
Rendered projects/issues/_form.html.haml (3.1ms)
Rendered projects/issues/new.html.haml within layouts/projects (3.5ms)
Completed 500 Internal Server Error in 80ms
ActionView::Template::Error (undefined method `sha' for nil:NilClass):
1: %div.issue-form-holder
2: %h3.page-title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.iid}"
3: %hr
4: - if @repository.contribution_guide && [email protected]?
5: - contribution_guide_url = project_blob_path(@project, tree_join(@repository.root_ref, @repository.contribution_guide.name))
6: .alert.alert-info.col-sm-10.col-sm-offset-2
7: ="Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe
app/models/repository.rb:183:in `tree'
app/models/repository.rb:173:in `block in contribution_guide'
app/models/repository.rb:172:in `contribution_guide'
app/views/projects/issues/_form.html.haml:4:in `_app_views_projects_issues__form_html_haml__3403996604646950317_70206080861280'
app/views/projects/issues/new.html.haml:1:in `_app_views_projects_issues_new_html_haml___3315614762869711381_70206080837340'
app/controllers/projects/issues_controller.rb:46:in `new'
app/controllers/application_controller.rb:58:in `set_current_user_for_thread'
Presumably, Gitlab assumes that your repository will have some files/commits when getting repository.contribution_guide
.
I can try to provide more details on request, though this probably points you in the right direction.
Environment:
GitLab 6.7.5
GitLab Shell 1.9.1
GitLab API v3
Ruby 2.0.0p247
Rails 4.0.3