Can't view files - 500 error
Created by: JamesStewy
Everytime I view a file in gitlab I get a 500 error:
In production.log I get this:
`Started GET "/user/project/blob/master/file.js" for ###.###.###.### at 2014-01-10 14:09:15 +1100
Processing by Projects::BlobController#show as HTML
Parameters: {"project_id"=>"user/project", "id"=>"master/file.js"}
Rendered shared/_ref_switcher.html.haml (1.9ms)
Rendered projects/blob/_actions.html.haml (4.9ms)
Rendered projects/blob/_text.html.haml (45.9ms)
Rendered projects/blob/_blob.html.haml (52.6ms)
Rendered projects/blob/show.html.haml within layouts/projects (55.1ms)
Completed 500 Internal Server Error in 98ms
ActionView::Template::Error (Failed to get header.):
9: .file-content.code
10: - unless blob.empty?
11: %div{class: user_color_scheme_class}
12: = raw blob.colorize(formatter: :gitlab)
13: - else
14: %p.nothing_here_message Empty file
app/views/projects/blob/_text.html.haml:12:in `_app_views_projects_blob__text_html_haml__289281774143900551_70145284681920'
app/views/projects/blob/_blob.html.haml:28:in `_app_views_projects_blob__blob_html_haml__1574017597509049423_70145282518920'
app/views/projects/blob/show.html.haml:4:in `_app_views_projects_blob_show_html_haml___2379748657636985451_70145281749640'
app/controllers/application_controller.rb:57:in `set_current_user_for_thread'
Application check returns no errors. I am running Ubuntu 13.04, gitlab 6.4.3 (last commit sha1: 38397dbe) and python 2.7.4. I have set gitlab's web server to run on port 8081 then used apache2's ProxyPass to access it. For good measure I have tried using gitlab in a web browser on my server at address 127.0.0.1:8081 (bypassing apache2 entirely) and got the same results; everything works except file viewing. This is the apache config in question anyway:
DocumentRoot /home/git/gitlab/public
ProxyPass / http://127.0.0.1:8081/
ProxyPassReverse / http://127.0.0.1:8081/
I know this is a well documented issue however, everything I have seen on this issue I have tried without success. Things I can remember trying:
- Making sure python is greater than version 2.5/2.6/2.7 (it changes in by solution) and less than version 3
- Removing charlock_holmes the nre installing gems
- Upgrading to latest version
- Making sure python2 alias works (i.e python2 --version works) There were also a lot of solutions involving the file lib/gitlab/git/repositories.rb (not 100% sure) but I have no folder git in lib/gitlab.
I have also noticed that pages such as help/api/README give 500 errors as well. I presume it is a reading off a file in this case while a page such as help/workflow isn't and is therefore working (to clear up help/workflow works and help/api/README does not).
Thanks, JamesStewy