Passenger/Nginx error "unexpected end of file detected." - ruby-on-rails

I'm trying to run my applications under Passenger 3.0.2 on Mac OSX 10.6.4 with Rails 2.3.8 and 3.0.4. Using Ruby EE v2011.01. And Nginx.
I have completed this successfully on my laptop, and on a Redhat server. However, on my Mac Pro I am getting the following on both apps:
Passenger encountered the following error:
The application spawner server exited unexpectedly: Unexpected end-of-file detected.
Nginx log file shows a segmentation fault:
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/utils.rb:708: [BUG] Segmentation fault
ruby 1.8.7 (2010-12-23 patchlevel 330) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2011.01
I KNOW this has to be some gem issue. Unfortunately Passenger is not reporting it, and I have it's log level set to 3.
I have seen a few logging issues in Passenger that have caused me some headaches. I'm not complaining, it's free and it's fast. But I don't know how to get past this one.

Looks like some kind of Ruby bug to me. Try 1.9? It looks like the Ruby core developers give 1.9 more attention than 1.8 these days.

I got same problem with Ruby Enterprise (ree) 1.8.7-2011.02 and install Passenger that bundle with it.
Server is OpenSuSe 11.x
Ruby Enterprise 1.8.7-2011.02
Passenger 3.0.2
/var/log/apache2/error_log show looks like this
*** glibc detected *** Passenger ApplicationSpawner: /srv/www/apps/xxxxxx/current: munmap_chunk(): invalid pointer: 0x0000000000ccd400 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x73226)[0x7f40d5d1e226]
/lib64/libnsl.so.1(+0xfd4a)[0x7f40d40f3d4a]
/lib64/libpthread.so.0(pthread_once+0x53)[0x7f40d5a9a943]
/lib64/libnsl.so.1(_nsl_default_nss+0x21)[0x7f40d40f3e61]
/lib64/libnss_compat.so.2(_nss_compat_initgroups_dyn+0x594)[0x7f40d4301de4]
/lib64/libc.so.6(+0x9cc1b)[0x7f40d5d47c1b]
/lib64/libc.so.6(initgroups+0x6c)[0x7f40d5d47e7c]
/opt/ruby-enterprise-1.8.7-2011.02/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/phusion_passenger/native_support.so(+0xf48)[0x7f40d4b5af48]
so, solution is install Passenger gem to your MRI Ruby.
sudo gem install passenger
sudo passenger-install-apache2-module
Last report of passenger should give you apache's configuration to MRI ruby /usr/bin/ruby
It is slower but till new patch is out, this is only solution for me.

Had the same error (on ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.5.0],
passenger 3.0.2, Mac OS X 10.6.6 dual Quad-Core) and reverting to Passenger 2.2.15 also worked for me. Weird! Thank you.

Backing off to Passenger 2.2.15 fixed my problem. Note that this error only occurs on Mac OS X 10.6.4 on my Mac Pro dual quad core CPU machine, NOT on my MacBook Pro laptop running the same version of the OS.

Related

Rails Server won't start after Ruby upgrade - Segmentation Fault

After upgrading my Ruby to 1.9.3-p429, I tried to start the Rails server. It told me rails was not installed so, I boldly did a 'gem install rails'. Now when I try to start the server, I'm getting this:
andrunix#amp-laptop~/code/madrilla$ rails s
/Users/andrunix/.rvm/gems/ruby-1.9.3-p429/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
Abort trap: 6
I have no idea why that says, "ruby 1.8.7" in that output. Perhaps that's a clue to my problem.
But anyway, super frustrated at this point.
And by the way, this is on OS X.
Help me please!
Try to set the version you've installed as the default for your whole system:
rvm --default use ruby-1.9.3-p429

pg gem Trace/BPT trap: 5 error on MAC OS X lion

I recently upgraded my snow leopard to lion and in one of my apps i get
=> Booting WEBrick
=> Rails 3.0.4 application starting in development on http://0.0.0.0:4000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-08-16 17:47:27] INFO WEBrick 1.3.1
[2011-08-16 17:47:27] INFO ruby 1.9.2 (2011-07-09) [x86_64-darwin11.0.0]
[2011-08-16 17:47:27] INFO WEBrick::HTTPServer#start: pid=3460 port=4000
Trace/BPT trap: 5
the app quits and there is no other output , it does run with sqlite3 as the db gem.
I commented all other gems but this one and still got the erros. i see this error not when the app is loading but when it tries to answer the first request.
Anyone knows another gem to connect to postgresql or any workaround?
EDIT: OK here is some clarification.
I started this project on snow leopard and it worked perfectly, I had rvm installed , the pg gem, webrick and ruby 1.9.2-p180, I upgraded to lion and keep working on other projects, when the time come to update this project , i got the Trace/BPT trap: 5 error, and the server gives no other clue of what is going on. My guess is that this is something very low level and the ruby interpreter does not even gets the chance to show the exception and this message is STDIO related.
Trying to fix this i have: reinstalled rvm , installed ruby 1.9.2-p290, reinstalled postgresql, deleted and rebuild the gemset for the project, installed mongrel and still the app crashes web it gets the first web request, note that it does work on the rails console.
EDIT 2: It is now running on ruby-1.8.7-352 so it seem is a 1.9.2 related issue on MAC OS X 10.7
EDIT 3: Is a XCODE 4.1 issue that has to do with llvm compiler and the "optimization" it does when there is need to build with native extension. The solution is to install a compatible Xcode, more info can be found at the RVM site.
I fixed this - it was a simple issue of a missing "gem 'pg'" in my Gemfile. For various reasons it had been commented out.
Try the following:
gem uninstall pg
env ARCHFLAGS="-arch x86_64" gem install pg
I had the same problem and this solution worked for me. I am running Ruby 1.9.2 p136, Rails 3.0.1, Postgresql 9.0.4 and the pg gem version 0.11.0.
I am of course assuming that you have also correctly configured your Gemfile to use the 'gem pg', and that you don't have any other database gems active in there, and that you have a working database that you can access with psql coupled with a properly configured database.yml file in rails.
Hope this works for you,
Erik

Passenger 3.0 and debugger

I have problems using passenger standalone with a debugger. If I try this:
passenger start --debugger
I get this error:
Your version of ruby-debug is too old. Please upgrade to the latest version.
My Ruby is: ruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.02
Ruby debug:
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
So, has anyone successfully used Passenger 3.0 with a debugger?
It isn't supposed to work, the flag was experimental but we forgot to remove it for 3.0.0, that's why it isn't documented. It'll be removed for 3.0.1.
You can run a debugger in Passenger by using rack-debug
It works by having a client connect to the Passenger process at the breakpoints you set. A bit more complicated than using Thing/Mongrel with a debugger. But pretty simple to setup.

Ruby Enterprise Edition crashes in gc_sweep

My Rails application crashes intermittently with the following message:
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/multibyte/utils.rb:52: [BUG] gc_sweep(): unknown data type 0x0(0xbdc2ca0)
ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.01
I am running the app on Nginx / Passenger.
Ruby 1.8.7 Enterprise Edition 2010.10, Rails 2.3.5, Ubuntu 9.10 32bit.
Does anybody have an idea how to fix this?
I had to switch back to Ruby MRI. It is a temporary solution though. Hopefully, this problem will be fixed in the next release of REE.
try opening an issue at:
http://github.com/FooBarWidget/rubyenterpriseedition187-248/issues

phusion passenger and ruby 1.9.1 is it working already?

i have a production and a development machine, both running ubuntu 8.10 and both are running the latest phusion passenger. as i am using ruby 1.9.1 on my local development machine on osx, i wondered if people out there are already using phusion passenger with ruby 1.9.1 or even 1.9.2 already?
if so, please tell us your setup!
furthermore, is ther a way to run both ruby 1.8.7 (ree) and 1.9.1 with phusion passenger on apache?
thanks for any pointers, i could not find any hints on this anywhere...
Yes it's officially supported since some 2.2.x release for which I can't remember the exact number. It was written in the release notes. The past few 2.2 releases have only continued to add 1.9-related bug fixes. The upcoming 3.0 release will officially support 1.9.2 as well (though this doesn't imply that 1.9.2 doesn't already work).
You can't run two Ruby versions simultaneously yet but it's on the todo list.

Resources