Permission error when viewing a git diff

Added by Jeremy Ross about 10 years ago

I get the following error when viewing any git diff in redmine. The web server runs as apache and apache owns /var/www/redmine/tmp/cache. Any ideas?

ActionView::Template::Error (Permission denied - /var/www/redmine/tmp/cache/44E):
    13:   </p>
    14: <% end %>
    15: 
    16: <% cache(@cache_key) do -%>
    17: <%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
    18: <% end -%>
    19: 

Ruby: 1.8.7 (x86_64-linux)
Rails: 3.2.3
OS: CentOS 5.8
DB: MySQL 5.0.95
Web server: Apache + passenger

Replies (2)

RE: Permission error when viewing a git diff - Added by Jeremy Ross about 10 years ago

I've discovered that file created by the web server are owned by root. I'm not sure why, because apache is set up to run as apache:apache. I suspect this is what is causing my problem.

RE: Permission error when viewing a git diff - Added by Michael Aye over 9 years ago

I had the same problem.
My redmine runs as user www-data, but the cache folder inside redmine/tmp belonged to root.
I solved this by doing

chown -R www-data:www-data tmp

inside the redmine folder.

(1-2/2)