500 error on all projects search
Created by: thewholelifetolearn
Hi!
I encountered this issue on Gitlab 7.0, 7.1 and 7.2. I didn't get this issue on Gitlab 6.9. This installation is done by manual procedure and works on CentOS.
This issue comes up when a research is done on the dashboard page or when 'Any' is selected for Group and Project. When the search is submitted, on 500 error page is shown. The example shown is about to find all projects with this pattern.
The error is about an undefined methode 'name_with_namespace' for nil:NilClass
.
The issue seems to similar to #7033 (closed) .
If you need more information, please ask. I will try to answer as I can.
Here is the trace from production.log
Started GET "/search?search=tuto" for 127.0.0.1 at 2015-01-29 13:23:53 +0100
Processing by SearchController#show as HTML
Parameters: {"search"=>"tuto"}
Completed 500 Internal Server Error in 216ms
ActionView::Template::Error (undefined method `name_with_namespace' for nil:NilClass):
5: %strong.term
6: = truncate merge_request.title, length: 50
7: - if merge_request.for_fork?
8: %span.light (#{merge_request.source_project.name_with_namespace}:#{merge_request.source_branch} → #{merge_request.target_project.name_with_namespace}:#{merge_request.target_branch})
9: - else
10: %span.light (#{merge_request.source_branch} → #{merge_request.target_branch})
11: - if merge_request.merged?
app/views/search/results/_merge_request.html.haml:8:in `_app_views_search_results__merge_request_html_haml__773123198_33647200'
app/views/search/_global_results.html.haml:4:in `_app_views_search__global_results_html_haml__853806245_33853380'
app/views/search/_results.html.haml:13:in `_app_views_search__results_html_haml___574004972_24686900'
app/views/search/show.html.haml:20:in `block in _app_views_search_show_html_haml__285661650_26688290'
app/views/search/show.html.haml:1:in `_app_views_search_show_html_haml__285661650_26688290'