views:

2361

answers:

7

Hi, Upgraded to Rails 2.3.2 and Passenger 2.2.4 on Ubuntu hardy slice at slicehost with Apache2

I'm getting this same above discussed error in my Apache error.log of system /var/logs/apache2/

[ pid=4249 file=ext/apache2/Hooks.cpp:638 time=2009-07-04
11:47:32.752 ]:
  No data received from the backend application (process 4383) within
45000 msec. Either the backend application is frozen, or your TimeOut
value of 45 seconds is too low. Please check whether your application
is frozen, or increase the value of the TimeOut configuration
directive.
*** Exception Errno::EPIPE in Passenger RequestHandler (Broken pipe)
(process 4391):
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/rack/request_handler.rb:93:in `write'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/rack/request_handler.rb:93:in `process_request'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_request_handler.rb:206:in `main_loop'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/railz/application_spawner.rb:376:in
`start_request_handler'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/railz/application_spawner.rb:334:in
`handle_spawn_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/utils.rb:182:in `safe_fork'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/railz/application_spawner.rb:332:in
`handle_spawn_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_server.rb:351:in `__send__'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_server.rb:351:in `main_loop'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_server.rb:195:in `start_synchronously'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_server.rb:162:in `start'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/railz/application_spawner.rb:213:in `start'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/spawn_manager.rb:261:in `spawn_rails_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/spawn_manager.rb:254:in `spawn_rails_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/spawn_manager.rb:153:in `spawn_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/spawn_manager.rb:286:in `handle_spawn_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_server.rb:351:in `__send__'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_server.rb:351:in `main_loop'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/
phusion_passenger/abstract_server.rb:195:in `start_synchronously'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/bin/passenger-spawn-
server:61
*** Exception Errno::EPIPE in Passenger RequestHandler (Broken pipe)
(process 4383):

and these too.

pid=4362 file=ext/apache2/Hooks.cpp:638 time=2009-07-04
11:55:19.251 ]:
  No data received from the backend application (process 4383) within
45000 msec. Either the backend application is frozen, or your TimeOut
value of 45 seconds is too low. Please check whether your application
is frozen, or increase the value of the TimeOut configuration
directive.
[ pid=4298 file=ext/apache2/Hooks.cpp:638 time=2009-07-04
11:55:19.255 ]:
  No data received from the backend application (process 4252) within
45000 msec. Either the backend application is frozen, or your TimeOut
value of 45 seconds is too low. Please check whether your application
is frozen, or increase the value of the TimeOut configuration
directive.
[Sat Jul 04 11:55:19 2009] [error] [client 86.96.226.13] Premature end
of script headers: 41, referer: http://domain.com/
[ pid=4373 file=ext/apache2/Hooks.cpp:638 time=2009-07-04
11:55:19.559 ]:

Its getting me mad and on the browser, sometimes its show and when refreshed, Application Error 500 shows up in frequent basis. any directions??

+1  A: 

It looks like the bug you're having was merged into Passenger master but not yet released. You can try it out by checking Passenger out from the following repository:

http://github.com/FooBarWidget/passenger/tree/master

Once you've checked it out, you want to run:

./bin/passenger-install-apache2-module

for Apache Passenger, or:

./bin/passenger-install-nginx-module

for Nginx Passenger. Since this particular issue was addressed, it should work for you.

Yehuda Katz
Thanks for the reply, Yehuda.I solved this problem just couple of hours ago. Addressed by Honlilai at http://bit.ly/1axdfOthe issue was mainly with that log file permission.
Millisami
I'm getting Errno::EPIPE constantly, the server is unusable due to fact that it takes couple of seconds (5+) to get a response, even for Rails cached pages. All logs are growing in size (no perm. problem). Here is my nginx.conf http://pastie.org/958895 . Using passenger-2.2.11 on debian
skrat
A: 

I updated to Passenger version 2.2.7 though this error was still occurring. I found that updating TimeOut and KeepAliveTimeout in my Apache configuration seemed to fix the problem. (They changed from 1 and 2 to 10 and 20 respectively). Hope that helps someone!

Gav
A: 

Hi Gav,

I am facing exactly the same error you have got, enclosed below.

=================================================================================

The HTTP client closed the connection before the response could be completely sent. As a result, you will probably see a 'Broken Pipe' error in this log file. Please ignore it, this is normal. *** Exception Errno::EPIPE in Passenger RequestHandler (Broken pipe) (process 14125): from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/phusion_passenger/rack/request_handler.rb:108:in write' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/phusion_passenger/rack/request_handler.rb:108:in process_request' from /var/rails/releases/20090911095700/vendor/rails/actionpack/lib/action_controller/response.rb:155:in each_line' from /var/rails/releases/20090911095700/vendor/rails/actionpack/lib/action_controller/response.rb:155:in each' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/phusion_passenger/rack/request_handler.rb:107:in process_request' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/phusion_passenger/abstract_request_handler.rb:206:in main_loop' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/phusion_passenger/railz/application_spawner.rb:376:in start_request_handler' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/phusion_passenger/railz/application_spawner.rb:334:in handle_spawn_application'

=================================================================================

I have changed both the Timeout from 300 to 900 sec as well as the KeepAliveTimeout from 15 secs to 120 secs. I did not upgrade the version of the passenger from 2.2.4 to 2.2.7.

Inspite of these changes, I keep getting this error continuousy. Please guide me, if the upgrade is necessary and any other alternate place swhwre I can tune the configuration.

Regards, Andy,

Andy
A: 

We faced this problem for about a week ago. There seems to be no solution. Since it totally killed out server we're now switching off from passenger :-(

kostia
A: 

Facing the exact same problem for two weeks now and didn't found a solution...

Zitooon
+1  A: 

I had this problem too and fixed it by upgrading from passenger-2.1.2 to passenger-2.2.15.

To be clear it's not a rails issue, it's a passenger bug.

Error log output:

[ pid=13571 file=Hooks.cpp:508 time=2010-04-28 17:46:16.878 ]:
  Backend process 22235 did not return a valid HTTP response. It returned no data.
*** Exception Errno::EPIPE in Passenger RequestHandler (Broken pipe) (process 22235):
    from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/rack/request_handler.rb:67:in `write'
deepwell
A: 

excellent solution deepwell.. it worked!!!

raj