oggy / rack_after_reply

Rack hook which fires after the socket to the client is closed.
http://github.com/oggy/rack_after_reply
MIT License
25 stars 2 forks source link

Not working with Passenger 4.0.5 #4

Open mikecarroll opened 11 years ago

mikecarroll commented 11 years ago

After installing the gem (version 0.0.3) in my Rails 3 app and firing up Passenger, get this error related the Passenger preloader:

=============== Phusion Passenger Standalone web server started ===============
PID file: /Users/woodchip/Aqua/Brahma/tmp/pids/passenger.3000.pid
Log file: /Users/woodchip/Aqua/Brahma/log/passenger.3000.log
Environment: development
Accessible via: http://0.0.0.0:3000/

You can stop Phusion Passenger Standalone by pressing Ctrl-C.
===============================================================================
[ 2013-09-01 11:55:48.3427 6132/0x10e0a4000 Pool2/Spawner.h:739 ]: [App 6141 stdout] 
[ 2013-09-01 11:55:52.7428 6132/0x10e0a4000 Pool2/Implementation.cpp:774 ]: Could not spawn process for group /Users/woodchip/Aqua/Brahma#default: An error occured while starting up the preloader.
     in 'void Passenger::ApplicationPool2::SmartSpawner::handleErrorResponse(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:455)
     in 'std::string Passenger::ApplicationPool2::SmartSpawner::negotiatePreloaderStartup(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:558)
     in 'void Passenger::ApplicationPool2::SmartSpawner::startPreloader()' (SmartSpawner.h:206)
     in 'virtual Passenger::ApplicationPool2::ProcessPtr Passenger::ApplicationPool2::SmartSpawner::spawn(const Passenger::ApplicationPool2::Options&)' (SmartSpawner.h:744)
     in 'void Passenger::ApplicationPool2::Group::spawnThreadRealMain(const Passenger::ApplicationPool2::SpawnerPtr&, const Passenger::ApplicationPool2::Options&, unsigned int)' (Implementation.cpp:707)

[ 2013-09-01 11:55:52.7431 6132/0x10e01e000 agents/HelperAgent/RequestHandler.h:1889 ]: [Client 21] Cannot checkout session. An error occured while starting up the preloader.
Error page:
uninitialized constant PhusionPassenger::Rack::RequestHandler (NameError)
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/rack_after_reply-0.0.3/lib/rack_after_reply/adapter/passenger.rb:5:in `apply'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/rack_after_reply-0.0.3/lib/rack_after_reply/adapter/base.rb:6:in `apply'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/rack_after_reply-0.0.3/lib/rack_after_reply.rb:17:in `apply'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/rack_after_reply-0.0.3/lib/rack_after_reply.rb:39:in `<top (required)>'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
  /Users/woodchip/Aqua/Brahma/config/application.rb:7:in `<top (required)>'
  /Users/woodchip/Aqua/Brahma/config/environment.rb:2:in `require'
  /Users/woodchip/Aqua/Brahma/config/environment.rb:2:in `<top (required)>'
  config.ru:3:in `require'
  config.ru:3:in `block in <main>'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:82:in `eval'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:82:in `preload_app'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:127:in `<module:App>'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:6:in `<module:PhusionPassenger>'
  /Users/woodchip/.rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:5:in `<main>'

I'm not familiar enough with Passenger to figure out the problem here myself--any ideas? (Gem works with Thin beautifully, but unfortunately the production server is using Passenger...)

kmcq commented 9 years ago

Hey @mikecarroll , did you ever figure out what to do here? We're looking to upgrade Passenger but can't until we figure out a solution for this.

kmcq commented 9 years ago

FYI, For now we decided that Rails' built-in after_filter was good enough.