Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inexistent stylesheet causing error? #28

Closed
solstag opened this issue Aug 15, 2013 · 3 comments
Closed

Inexistent stylesheet causing error? #28

solstag opened this issue Aug 15, 2013 · 3 comments

Comments

@solstag
Copy link

solstag commented Aug 15, 2013

Ni!

I installed and configured a production pairwise-api under apache.

Upon accessing the URL I get a 500 error page and the message below in my logs:

ActionView::TemplateError (Permission denied - /var/websites/pairwise-api/public/stylesheets/all.css) on line #7 of app/views/layouts/application.html.erb:
4:   <head>
5:     <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6:     <title>Rebirth</title>
7:     <%= stylesheet_link_tag :flutie, 'rebirth', :cache => true %>
8:   </head>
9:   <body class="<%= body_class %>">
10:     <div class="content">

    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/helpers/asset_tag_helper.rb:674:in `initialize'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/helpers/asset_tag_helper.rb:674:in `open'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/helpers/asset_tag_helper.rb:674:in `write_asset_file_contents'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/helpers/asset_tag_helper.rb:434:in `stylesheet_link_tag'
    app/views/layouts/application.html.erb:7
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/renderable.rb:34:in `block in render'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/base.rb:306:in `with_template'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/renderable.rb:30:in `render'
    vendor/ruby/1.9.1/gems/newrelic_rpm-3.5.5.38/lib/new_relic/agent/method_tracer.rb:491:in `block in render_with_trace_View_path_r_2_Rendering'
    vendor/ruby/1.9.1/gems/newrelic_rpm-3.5.5.38/lib/new_relic/agent/method_tracer.rb:240:in `trace_execution_scoped'
    vendor/ruby/1.9.1/gems/newrelic_rpm-3.5.5.38/lib/new_relic/agent/method_tracer.rb:486:in `render_with_trace_View_path_r_2_Rendering'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/template.rb:205:in `render_template'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/base.rb:265:in `render'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/base.rb:352:in `_render_with_layout'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_view/base.rb:262:in `render'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:1252:in `render_for_file'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:936:in `render'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/benchmarking.rb:51:in `block in render_with_benchmark'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/benchmarking.rb:51:in `render_with_benchmark'
    vendor/ruby/1.9.1/gems/thoughtbot-clearance-0.8.2/app/controllers/clearance/sessions_controller.rb:8:in `new'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:1333:in `perform_action'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/filters.rb:617:in `call_filters'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
    vendor/ruby/1.9.1/gems/newrelic_rpm-3.5.5.38/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:270:in `block in perform_action_with_newrelic_trace'
    vendor/ruby/1.9.1/gems/newrelic_rpm-3.5.5.38/lib/new_relic/agent/method_tracer.rb:240:in `trace_execution_scoped'
    vendor/ruby/1.9.1/gems/newrelic_rpm-3.5.5.38/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:263:in `perform_action_with_newrelic_trace'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:532:in `process'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/filters.rb:606:in `process_with_filters'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:391:in `process'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:386:in `call'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/routing/route_set.rb:438:in `call'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:87:in `dispatch'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:121:in `_call'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
    vendor/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/query_cache.rb:29:in `call'
    vendor/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/query_cache.rb:29:in `block in call'
    vendor/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
    vendor/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/query_cache.rb:9:in `cache'
    vendor/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/query_cache.rb:28:in `call'
    vendor/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
    vendor/ruby/1.9.1/gems/newrelic_rpm-3.5.5.38/lib/new_relic/rack/browser_monitoring.rb:12:in `call'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/string_coercion.rb:25:in `call'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/params_parser.rb:15:in `call'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/session/cookie_store.rb:99:in `call'
    vendor/ruby/1.9.1/gems/hoptoad_notifier-2.4.9/lib/hoptoad_notifier/rack.rb:27:in `call'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/failsafe.rb:26:in `call'
    vendor/ruby/1.9.1/gems/hoptoad_notifier-2.4.9/lib/hoptoad_notifier/user_informer.rb:12:in `call'
    <internal:prelude>:10:in `synchronize'
    vendor/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:106:in `call'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/request_handler.rb:96:in `process_request'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:275:in `block in handle_spawn_application'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:479:in `safe_fork'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:180:in `start'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:219:in `block (2 levels) in spawn_rails_application'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:214:in `block in spawn_rails_application'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
    <internal:prelude>:10:in `synchronize'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    /usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:99:in `<main>'

The file 'all.css' does not exist in the tree.

Removing line #7 of app/views/layouts/application.html.erb makes it work with no stylesheet.

Thanks

@lukebaker
Copy link
Member

The application is attempting to create all.css, but is unable to create the file due to permissions. I think you want to verify that the passenger user has the ability to create files in /var/websites/pairwise-api/public/stylesheets/.

@solstag
Copy link
Author

solstag commented Sep 20, 2013

Ok, I assigned a user to the app and gave it write on stylesheets, which solves the issue.

Is there any other directory in the tree that needs to be writable by the app?

It would be nice if this could be included in the documentation, and even better if writing to the filesystem could be avoided. :)

Thank you,
ale

@lukebaker
Copy link
Member

Thanks for your feedback. I've update the documentation to reflect this requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants