Fcgi dispatcher crashing


#1

I’m trying to set deploy an app on apache2 with the fcgid module, but
can’t
seem to get anywhere.

Things work fine with cgi, but when i switch to fcgi, i’m stuck with a
‘503:
Service Temporarily Unavailable’. There’s no error being logged
anywhere,
afaik.

Trying to run dispatch.fcgi from the shell doesn’t work either. It bombs
out, and the following is written to ‘railsapp/log/fastcgi.crash.log’:

[07/Mar/2006:16:15:34 :: 29789] starting
[07/Mar/2006:16:15:34 :: 29789] Dispatcher failed to catch: undefined
method
is_cgi?' for FCGI:Class (NoMethodError) /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:593:ineach_cgi’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
process!' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:inprocess!’
./dispatch.fcgi:24
almost killed by this error
[07/Mar/2006:16:15:34 :: 29789] Dispatcher failed to catch: undefined
method
is_cgi?' for FCGI:Class (NoMethodError) /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:593:ineach_cgi’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
process!' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:inprocess!’
./dispatch.fcgi:24
killed by this error

Line 24 would be ‘RailsFCGIHandler.process!’.

Suggestions on what to try next?

Environment: Ruby 1.8.4 (2005-12-24) [i386-linux], rails (1.0.0), fcgi
(0.8.6.1), apache2, fcgid 1.0.8…


View this message in context:
http://www.nabble.com/fcgi-dispatcher-crashing-t1240350.html#a3282773
Sent from the RubyOnRails Users forum at Nabble.com.


#2

Started from the shell, dispatch.cgi prints ‘Status: 500 Internal Server
Error’, while there’s no output from dispatch.fcgi.


View this message in context:
http://www.nabble.com/fcgi-dispatcher-crashing-t1240350.html#a3282844
Sent from the RubyOnRails Users forum at Nabble.com.


#3

All,

I am looking to return Model objects [mainly for demo purposes] as Web
Services. So I defined my Web Service as follows:

class StringLengthApi < ActionWebService::API::Base
api_method :findLength, :expects => [:string], :returns =>
[PersonContact]
end

Here is the definition of my model object:

class PersonContact < ActiveRecord::Base
set_table_name “person_contact”
set_primary_key “contact_id”
has_one :user,
:class_name => “User”,
:foreign_key => “user_id”
has_one :buyer_role,
:class_name => “BuyerRole”,
:foreign_key => “buyer_id”
has_many :notes,
:class_name => “Note”,
:foreign_key => “contact_id”
has_many :tasks,
:class_name => “Task”,
:foreign_key => “contact_id”

end

What happens when the WSDL generation occurs, is that it does not
traverse my relationships at all. I have attached the generated WSDL
for example purposes.

Thanks in advance,

Ron


#4

Kent,

That makes sense and is likely best practice any way. Although it would
be nice to proved some sort of depth indicator to say how deep into an
AR the WSDL generation should go.

Ron


From: removed_email_address@domain.invalid on behalf of Kent S.
Sent: Tue 3/7/2006 11:01 AM
To: removed_email_address@domain.invalid
Subject: Re: [Rails] Web Services WSDL Generation Question

No, AWS it doesn’t traverse activerecord associations. Mostly I think
because it’s difficult to answer the question of when to stop. In your
example, if User model object has further associations, should AWS
traverse them too?

I’d recommend you to create a AWS::Struct object for each web service
method that returns a complex data structure. This way you can manage
how much data will be transferred when it’s called.

Kent.

On 3/7/06, Ron DiFrango removed_email_address@domain.invalid wrote:

class PersonContact < ActiveRecord::Base
:foreign_key => “contact_id”
Ron


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Kent

http://www.datanoise.com


#5

No, AWS it doesn’t traverse activerecord associations. Mostly I think
because it’s difficult to answer the question of when to stop. In your
example, if User model object has further associations, should AWS
traverse them too?

I’d recommend you to create a AWS::Struct object for each web service
method that returns a complex data structure. This way you can manage
how much data will be transferred when it’s called.

Kent.

On 3/7/06, Ron DiFrango removed_email_address@domain.invalid wrote:

class PersonContact < ActiveRecord::Base
:foreign_key => “contact_id”
Ron


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Kent

http://www.datanoise.com


#6

Found a solution at the very bottom of
http://wiki.rubyonrails.com/rails/pages/FastCGI . Seems the native fcgi
library didn’t get loaded.

Regret not trying to load the fcgid module now, but switched to fastcgi
once
i saw this, and as things seem to be working…


View this message in context:
http://www.nabble.com/fcgi-dispatcher-crashing-t1240350.html#a3298981
Sent from the RubyOnRails Users forum at Nabble.com.


#7

On 3/7/06, Lucifron removed_email_address@domain.invalid wrote:

Started from the shell, dispatch.cgi prints ‘Status: 500 Internal Server
Error’, while there’s no output from dispatch.fcgi.

dispatch.fcgi from the shell should also give you the ‘Status: 500
Internal Server Error’ message.

Go back thru your fcgi setup and make sure you have everything setup
right.

In particular make sure you have the fcgi gem installed.

“gem list” will give you a list of your installed gems.

Greg

Greg F.
The Norcross Group
Forensics for the 21st Century