Passenger not spawning application

771 views
Skip to first unread message

Steel Fu

unread,
Jun 3, 2010, 7:43:20 PM6/3/10
to Phusion Passenger Discussions
I'm trying to get a Rails 3 app up w/ Ruby 1.9.2-preview3 using RVM.
Host is running Ubuntu 10.04.

I keep getting this error in the logs and I'm not sure where to dig
for more details on whats going on:

[ pid=8505 file=ext/apache2/Hooks.cpp:743 time=2010-06-03
23:37:26.901 ]:
Unexpected error in mod_passenger: Cannot spawn application '/var/
www/myapp/current': The spawn server has exited unexpectedly.
Backtrace:
(empty)


Any ideas?

Hongli Lai

unread,
Jun 3, 2010, 7:47:29 PM6/3/10
to phusion-...@googlegroups.com

Is that the only error? Nothing else?

Which Phusion Passenger version by the way?

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Steel Fu

unread,
Jun 4, 2010, 12:35:27 AM6/4/10
to Phusion Passenger Discussions
Passenger version 2.2.13

On Jun 3, 4:47 pm, Hongli Lai <hon...@phusion.nl> wrote:
> On Fri, Jun 4, 2010 at 1:43 AM, Steel Fu <stee...@gmail.com> wrote:
> > I'm trying to get a Rails 3 app up w/ Ruby 1.9.2-preview3 using RVM.
> > Host is running Ubuntu 10.04.
>
> > I keep getting this error in the logs and I'm not sure where to dig
> > for more details on whats going on:
>
> > [ pid=8505 file=ext/apache2/Hooks.cpp:743 time=2010-06-03
> > 23:37:26.901 ]:
> >  Unexpected error in mod_passenger: Cannot spawn application '/var/
> > www/myapp/current': The spawn server has exited unexpectedly.
> >  Backtrace:
> >     (empty)
>
> Is that the only error? Nothing else?
>
> Which Phusion Passenger version by the way?
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

Steel Fu

unread,
Jun 4, 2010, 1:19:19 AM6/4/10
to Phusion Passenger Discussions
RVM also throws this: /home/web/.rvm/bin/passenger_ruby: 2: source:
not found

However if I run passenger_ruby it throws this error but continues to
run properly.

Joshua Partogi

unread,
Jun 4, 2010, 9:07:26 AM6/4/10
to Phusion Passenger Discussions
I am also getting this error with Ruby Enterprise Edition and
Passenger 2.2.14

Kind regard,
Joshua

On Jun 4, 9:47 am, Hongli Lai <hon...@phusion.nl> wrote:
> On Fri, Jun 4, 2010 at 1:43 AM, Steel Fu <stee...@gmail.com> wrote:
> > I'm trying to get a Rails 3 app up w/ Ruby 1.9.2-preview3 using RVM.
> > Host is running Ubuntu 10.04.
>
> > I keep getting this error in the logs and I'm not sure where to dig
> > for more details on whats going on:
>
> > [ pid=8505 file=ext/apache2/Hooks.cpp:743 time=2010-06-03
> > 23:37:26.901 ]:
> >  Unexpected error in mod_passenger: Cannot spawn application '/var/
> > www/myapp/current': The spawn server has exited unexpectedly.
> >  Backtrace:
> >     (empty)
>
> Is that the only error? Nothing else?
>
> Which Phusion Passenger version by the way?
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

Hongli Lai

unread,
Jun 4, 2010, 9:16:47 AM6/4/10
to phusion-...@googlegroups.com
On Fri, Jun 4, 2010 at 3:07 PM, Joshua Partogi <joshua....@gmail.com> wrote:
> I am also getting this error with Ruby Enterprise Edition and
> Passenger 2.2.14

Steel Fu, how does your PassengerRuby directive look like?

Joshua, does it happen to you with every request or only for some requests?

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

Joshua Partogi

unread,
Jun 4, 2010, 10:01:25 AM6/4/10
to Phusion Passenger Discussions
Hi Hongli Lai,


I experience this on every request. Maybe because there is a recent
update on Rails 3?


Kind regards,
Joshua

On Jun 4, 11:16 pm, Hongli Lai <hon...@phusion.nl> wrote:
> On Fri, Jun 4, 2010 at 3:07 PM, Joshua Partogi <joshua.part...@gmail.com> wrote:
> > I am also getting this error with Ruby Enterprise Edition and
> > Passenger 2.2.14
>
> Steel Fu, how does your PassengerRuby directive look like?
>
> Joshua, does it happen to you with every request or only for some requests?
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

Hongli Lai

unread,
Jun 4, 2010, 10:47:26 AM6/4/10
to phusion-...@googlegroups.com
On Fri, Jun 4, 2010 at 4:01 PM, Joshua Partogi <joshua....@gmail.com> wrote:
> Hi Hongli Lai,
>
>
> I experience this on every request. Maybe because there is a recent
> update on Rails 3?

Let's find out what's going on. Can you restart your web server and
type passenger-memory-stats? What do you see?

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

Steel Fu

unread,
Jun 4, 2010, 12:34:42 PM6/4/10
to Phusion Passenger Discussions
Passenger memory stats:

---------- Apache processes ----------
PID PPID VMSize Private Name
--------------------------------------
18003 1 84.1 MB 0.5 MB /usr/sbin/apache2 -k start
18004 18003 83.9 MB 0.5 MB /usr/sbin/apache2 -k start
18021 18003 300.5 MB 0.8 MB /usr/sbin/apache2 -k start
18024 18003 300.5 MB 0.8 MB /usr/sbin/apache2 -k start
### Processes: 4
### Total private dirty RSS: 2.47 MB


-------- Nginx processes --------

### Processes: 0
### Total private dirty RSS: 0.00 MB


---- Passenger processes -----
PID VMSize Private Name
------------------------------
18016 87.1 MB 0.5 MB /home/web/.rvm/gems/ruby-1.9.2-preview3/gems/
passenger-2.2.13/ext/apache2/ApplicationPoolServerExecutable 0 /home/
web/.rvm/gems/ruby-1.9.2-preview3/gems/passenger-2.2.13/bin/passenger-
spawn-server /home/web/.rvm/bin/passenger_ruby /tmp/passenger.18003
### Processes: 1
### Total private dirty RSS: 0.46 MB


Directive:
PassengerRuby /home/web/.rvm/bin/passenger_ruby

#!/usr/bin/env sh
source "/home/web/.rvm/environments/ruby-1.9.2-preview3"
exec ruby "$@"


On Jun 4, 7:47 am, Hongli Lai <hon...@phusion.nl> wrote:
> On Fri, Jun 4, 2010 at 4:01 PM, Joshua Partogi <joshua.part...@gmail.com> wrote:
> > Hi Hongli Lai,
>
> > I experience this on every request. Maybe because there is a recent
> > update on Rails 3?
>
> Let's find out what's going on. Can you restart your web server and
> type passenger-memory-stats? What do you see?
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

Steel Fu

unread,
Jun 4, 2010, 4:07:50 PM6/4/10
to Phusion Passenger Discussions
Ok, so I just re-image'd the server and started from scratch. This
time using 2.2.14.

Got this in the logs:

/home/web/.rvm/bin/passenger_ruby: 2: source: not found
/home/web/.rvm/gems/ruby-1.9.2-preview3/gems/passenger-2.2.14/lib/
phusion_passenger/utils.rb:25:in `require': no such file to load --
rubygems (LoadError)
from /home/web/.rvm/gems/ruby-1.9.2-preview3/gems/passenger-2.2.14/
lib/phusion_passenger/utils.rb:25
from /home/web/.rvm/gems/ruby-1.9.2-preview3/gems/passenger-2.2.14/
bin/passenger-spawn-server:53:in `require'
from /home/web/.rvm/gems/ruby-1.9.2-preview3/gems/passenger-2.2.14/
bin/passenger-spawn-server:53
[ pid=414 file=ext/apache2/Hooks.cpp:743 time=2010-06-04
20:06:42.21 ]:
Unexpected error in mod_passenger: Cannot spawn application '/var/
www/limelight/current': The spawn server has exited unexpectedly.
Backtrace:
in 'virtual boost::shared_ptr<Passenger::Application::Session>
Passenger::ApplicationPoolServer::Client::get(const
Passenger::PoolOptions&)' (ApplicationPoolServer.h:471)
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:534)

Steel Fu

unread,
Jun 4, 2010, 4:55:06 PM6/4/10
to Phusion Passenger Discussions
Confirmed same error w/ REE 1.8.7-2010.01

Hongli Lai

unread,
Jun 4, 2010, 6:59:08 PM6/4/10
to phusion-...@googlegroups.com
On Fri, Jun 4, 2010 at 10:07 PM, Steel Fu <ste...@gmail.com> wrote:
> Ok, so I just re-image'd the server and started from scratch. This
> time using 2.2.14.
>
> Got this in the logs:
>
> /home/web/.rvm/bin/passenger_ruby: 2: source: not found
> /home/web/.rvm/gems/ruby-1.9.2-preview3/gems/passenger-2.2.14/lib/
> phusion_passenger/utils.rb:25:in `require': no such file to load --
> rubygems (LoadError)

This error here tells you that Ruby cannot load RubyGems and so the
spawn server (which is written in Ruby) bails out. You need to fix
your RubyGems installation.

Do you get the same error with REE?

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

Steel Fu

unread,
Jun 4, 2010, 7:04:49 PM6/4/10
to Phusion Passenger Discussions
I get the same error with REE.

On Jun 4, 3:59 pm, Hongli Lai <hon...@phusion.nl> wrote:
> On Fri, Jun 4, 2010 at 10:07 PM, Steel Fu <stee...@gmail.com> wrote:
> > Ok, so I just re-image'd the server and started from scratch. This
> > time using 2.2.14.
>
> > Got this in the logs:
>
> > /home/web/.rvm/bin/passenger_ruby: 2: source: not found
> > /home/web/.rvm/gems/ruby-1.9.2-preview3/gems/passenger-2.2.14/lib/
> > phusion_passenger/utils.rb:25:in `require': no such file to load --
> > rubygems (LoadError)
>
> This error here tells you that Ruby cannot load RubyGems and so the
> spawn server (which is written in Ruby) bails out. You need to fix
> your RubyGems installation.
>
> Do you get the same error with REE?
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

Anuj Dutta

unread,
Jun 4, 2010, 7:06:22 PM6/4/10
to phusion-...@googlegroups.com
On 5 June 2010 00:04, Steel Fu <ste...@gmail.com> wrote:
I get the same error with REE.


What happens when you run gem on the command line?

Anuj
 

--
You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
To post to this group, send email to phusion-...@googlegroups.com.
To unsubscribe from this group, send email to phusion-passen...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/phusion-passenger?hl=en.




--
Anuj DUTTA

Steel Fu

unread,
Jun 4, 2010, 7:10:00 PM6/4/10
to Phusion Passenger Discussions
Everything works fine outside of passenger. I can run the app w/
webrick w/ "rails server" and I it works fine w/ Unicorn.

On Jun 4, 4:06 pm, Anuj Dutta <dutta.a...@googlemail.com> wrote:
> > phusion-passen...@googlegroups.com<phusion-passenger%2Bunsubscr i...@googlegroups.com>
> > .

Steel Fu

unread,
Jun 4, 2010, 7:08:47 PM6/4/10
to phusion-...@googlegroups.com
Everything works fine outside of passenger. I can run the app w/ webrick w/ "rails server" and I it works fine w/ Unicorn.  

Hongli Lai

unread,
Jun 4, 2010, 7:13:52 PM6/4/10
to phusion-...@googlegroups.com
On Sat, Jun 5, 2010 at 1:08 AM, Steel Fu <ste...@gmail.com> wrote:
> Everything works fine outside of passenger. I can run the app w/ webrick w/
> "rails server" and I it works fine w/ Unicorn.

I'm guessing that your Ruby installation depends on some environment
variables that are set in the shell, but not in Apache/Nginx.
Apache/Nginx are usually started through a different mechanism and
doesn't inherit environment variables from the shell.

Let's compare the load paths between Ruby on the shell and Ruby as
started by the web server.

Can you type this in the shell and paste its output:
$ set
$ irb
>> require 'rubygems'
>> puts $LOAD_PATH
>> exit

Can you also modify
/home/web/.rvm/gems/ruby-1.9.2-preview3/gems/passenger-2.2.14/lib/phusion_passenger/utils.rb?
Just before "require 'rubygems'", insert:

puts ENV.each { |a, b| puts "#{a}=#{b}" }
puts $LOAD_PATH

Then start your web server. That will cause Passenger's environment
and load path to be printed to the web server error log. Can you paste
that?

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

Hongli Lai

unread,
Jun 4, 2010, 7:15:44 PM6/4/10
to phusion-...@googlegroups.com
Actually, now that I think about it, this error message is also highly
suspicious:

"/home/web/.rvm/bin/passenger_ruby: 2: source: not found"

I think this means you didn't set RVM's passenger_ruby script
correctly. Can you re-run 'rvm <some ruby name> --passenger' to have
passenger_ruby regenerated and check whether the problem still occurs?

Joshua Partogi

unread,
Jun 4, 2010, 7:23:30 PM6/4/10
to Phusion Passenger Discussions
Same here. Everything works fine with webrick, thin and Unicorn. I
even tried using Ruby 1.9.3-dev but caused passenger to fail also. =(

Hongli Lai

unread,
Jun 4, 2010, 7:27:58 PM6/4/10
to phusion-...@googlegroups.com
On Sat, Jun 5, 2010 at 1:23 AM, Joshua Partogi <joshua....@gmail.com> wrote:
> Same here. Everything works fine with webrick, thin and Unicorn. I
> even tried using Ruby 1.9.3-dev but caused passenger to fail also. =(

But does it fail for you with the exact same error? Emphasis on
*exact*; depending on the error message the reason why it fails can be
totally different.

Have you tried following the load path and environment check
instructions that I sent to Steel Fu?

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

Joshua Partogi

unread,
Jun 4, 2010, 8:11:45 PM6/4/10
to Phusion Passenger Discussions
Hi Hongli Lai,

This is what I get from my webserver log:

SHELL=/bin/bash
TERM=xterm
USER=root
LS_COLORS=rs=0:di=01;34:ln=01;36:hl=44;37:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;
41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=
01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.
tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.
7z=01;31:*.rz=0
1;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;
35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;3
5:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35 :*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.f
lv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01 ;
35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;3
6:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL=/var/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/opt/nginx/logs
SHLVL=1
HOME=/root
LOGNAME=root
LESSOPEN=| /usr/bin/lesspipe %s
LESSCLOSE=/usr/bin/lesspipe %s %s
_=/opt/nginx/sbin/nginx
OLDPWD=/opt
SERVER_SOFTWARE=nginx/0.7.65
ENV
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/
passenger-2.2.14/lib
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/
passenger-2.2.14/ext
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/x86_64-linux
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/vendor_ruby/1.8
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/vendor_ruby/1.8/x86_64-
linux
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/vendor_ruby
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/1.8
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/1.8/x86_64-linux

=====

And this is what I get when running irb:

foo@lucid:/opt/nginx/logs# /opt/ruby-enterprise-1.8.7-2010.01/bin/irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> puts $LOAD_PATH
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby/1.8/x86_64-linux
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/site_ruby
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/vendor_ruby/1.8
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/vendor_ruby/1.8/x86_64-
linux
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/vendor_ruby
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/1.8
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/1.8/x86_64-linux

====

Kind regards,
Joshua

On Jun 5, 9:27 am, Hongli Lai <hon...@phusion.nl> wrote:
> On Sat, Jun 5, 2010 at 1:23 AM, Joshua Partogi <joshua.part...@gmail.com> wrote:
> > Same here. Everything works fine with webrick, thin and Unicorn. I
> > even tried using Ruby 1.9.3-dev but caused passenger to fail also. =(
>
> But does it fail for you with the exact same error? Emphasis on
> *exact*; depending on the error message the reason why it fails can be
> totally different.
>
> Have you tried following the load path and environment check
> instructions that I sent to Steel Fu?
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

Steel Fu

unread,
Jun 7, 2010, 2:33:04 AM6/7/10
to Phusion Passenger Discussions
OK. Solved.

The "source: not found" looked really odd. After investigating I found
this: http://stackoverflow.com/questions/670191/getting-a-source-not-found-error-when-using-source-in-a-bash-script

RVM's wrapper script started with "#!/usr/bin/env sh", when I changed
it to "#!/bin/bash" it all worked fine.

Thank god, now I can move on with my life. Hope this fixes it for the
other guys as well.

On Jun 4, 5:11 pm, Joshua Partogi <joshua.part...@gmail.com> wrote:
> Hi Hongli Lai,
>
> This is what I get from my webserver log:
>
> SHELL=/bin/bash
> TERM=xterm
> USER=root
> LS_COLORS=rs=0:di=01;34:ln=01;36:hl=44;37:pi=40;33:so=01;35:do=01;35:bd=40; 33;01:cd=40;33;01:or=40;31;01:su=37;
> 41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz= 01;31:*.arj=01;31:*.taz=01;31:*.lzh=
> 01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*. bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.
> tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo= 01;31:*.cpio=01;31:*.
> 7z=01;31:*.rz=0
> 1;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01; 35:*.ppm=01;35:*.tga=01;35:*.xbm=01;
> 35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;3 5:*.mng=01;35:*.pcx=01;35:*.mov=01;3
> 5:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35: *.m4v=01;35:*.mp4v=01;35:*.vob=01;35     :*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.f lc=01;35:*.avi=01;35:*.fli=01;35:*.f

Wayne E. Seguin

unread,
Jun 15, 2010, 9:37:05 AM6/15/10
to Phusion Passenger Discussions
On Jun 7, 2:33 am, Steel Fu <stee...@gmail.com> wrote:
> OK. Solved.
>
> The "source: not found" looked really odd. After investigating I found
> this:http://stackoverflow.com/questions/670191/getting-a-source-not-found-...
>
> RVM's wrapper script started with "#!/usr/bin/env sh", when I changed
> it to "#!/bin/bash" it all worked fine.
>
> Thank god, now I can move on with my life. Hope this fixes it for the
> other guys as well.

FWIW, this was fixed last week in RVM head: rvm update --head
Reply all
Reply to author
Forward
0 new messages