Rails API alternatively throws 404

69 views
Skip to first unread message

Tenzin Chemi

unread,
Apr 13, 2016, 6:53:35 AM4/13/16
to Phusion Passenger Discussions
We have rails API deployed and at some point of time the service starts throwing 404 alternatively. By alternatively, It responds with 200 and 404 alternatively. I have captured one of the logs here. I couldn't figure out after looking at the stacktrace. For current work around, i did a httpd restart and the service is back to normal behaviour. Has anyone face similar issue and tell me what was the resolution to prevent this? I surely don't want to do httpd restart from time to time. Looking for help, thanks.

`{
"timestamp":"2016-04-11T09:19:02Z",
"severity":"FATAL","type":"exception",
"message":"ActionController::RoutingError(No route matches [HEAD] \"/library-service/authors\"):
 vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'",
"exception_id":"d39ef109fc87cd75b225cce1ceb03e5ed2103d5c",
"class":"ActionController::RoutingError",
"backtrace":[
"vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'",
"vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'",
"vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `block in instrument'",
"vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'",
"vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `instrument'",
"vendor/bundle/ruby/2.2.0/gems/request_store-1.3.0/lib/request_store/middleware.rb:9:in `call'",
"vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/request_id.rb:21:in `call'",
"vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'",
"vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'",
"vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'",
"vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'",
"vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:518:in `call'",
"vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/application.rb:165:in `call'",
"passenger (5.0.18) lib/phusion_passenger/rack/thread_handler_extension.rb:94:in `process_request'",
"passenger (5.0.18) lib/phusion_passenger/request_handler/thread_handler.rb:157:in `accept_and_process_next_request'",
"passenger (5.0.18) lib/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'",
"passenger (5.0.18) lib/phusion_passenger/request_handler.rb:415:in `block (3 levels) in start_threads'",
"passenger (5.0.18) lib/phusion_passenger/utils.rb:112:in `block in create_thread_and_abort_on_exception'"
],
"causes":null}`

Daniel Knoppel

unread,
Apr 13, 2016, 7:26:45 AM4/13/16
to Phusion Passenger Discussions
Looks like you didn't declare a route for a HEAD (not GET) request to /library-service/authors ?

- Daniel
Reply all
Reply to author
Forward
0 new messages