# Fcgi dispatcher crashing

**URL:** <https://www.ruby-forum.com/t/fcgi-dispatcher-crashing/54517>\
**Category:** Rails\
**Created:** [March 7, 2006, 4:36pm UTC](https://www.ruby-forum.com/t/fcgi-dispatcher-crashing/54517 "2006-03-07T16:36:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucifron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Lucifron](https://www.ruby-forum.com/u/Lucifron)\
**Post date:** [March 7, 2006, 4:36pm UTC](https://www.ruby-forum.com/t/fcgi-dispatcher-crashing/54517/1 "2006-03-07T16:36:26Z")

</div>

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:in `each\_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:in `process!’ ./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:in `each\_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:in `process!’ ./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](http://www.nabble.com/fcgi-dispatcher-crashing-t1240350.html#a3282773)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Lucifron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Lucifron](https://www.ruby-forum.com/u/Lucifron)\
**Post date:** [March 7, 2006, 4:39pm UTC](https://www.ruby-forum.com/t/fcgi-dispatcher-crashing/54517/2 "2006-03-07T16:39:29Z")

</div>

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](http://www.nabble.com/fcgi-dispatcher-crashing-t1240350.html#a3282844)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Lucifron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Lucifron](https://www.ruby-forum.com/u/Lucifron)\
**Post date:** [March 7, 2006, 4:45pm UTC](https://www.ruby-forum.com/t/fcgi-dispatcher-crashing/54517/3 "2006-03-07T16:45:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lucifron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Lucifron](https://www.ruby-forum.com/u/Lucifron)\
**Post date:** [March 7, 2006, 7:18pm UTC](https://www.ruby-forum.com/t/fcgi-dispatcher-crashing/54517/4 "2006-03-07T19:18:01Z")

</div>

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](mailto: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](http://lists.rubyonrails.org/mailman/listinfo/rails)

## – Kent

> **[DATANOISE.COM](https://www.datanoise.com/)**
>
> DATANOISE.COM - Contact us for any business inquiries

---

<div class="post-metadata">

**Author:** ![Lucifron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Lucifron](https://www.ruby-forum.com/u/Lucifron)\
**Post date:** [March 7, 2006, 5:03pm UTC](https://www.ruby-forum.com/t/fcgi-dispatcher-crashing/54517/5 "2006-03-07T17:03:47Z")

</div>

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](mailto: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](http://lists.rubyonrails.org/mailman/listinfo/rails)

## – Kent

> **[DATANOISE.COM](https://www.datanoise.com/)**
>
> DATANOISE.COM - Contact us for any business inquiries

---

<div class="post-metadata">

**Author:** ![Lucifron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Lucifron](https://www.ruby-forum.com/u/Lucifron)\
**Post date:** [March 8, 2006, 1:01pm UTC](https://www.ruby-forum.com/t/fcgi-dispatcher-crashing/54517/6 "2006-03-08T13:01:09Z")

</div>

Found a solution at the very bottom of  
[Peak Obsession](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](http://www.nabble.com/fcgi-dispatcher-crashing-t1240350.html#a3298981)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Lucifron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Lucifron](https://www.ruby-forum.com/u/Lucifron)\
**Post date:** [March 7, 2006, 11:07pm UTC](https://www.ruby-forum.com/t/fcgi-dispatcher-crashing/54517/7 "2006-03-07T23:07:25Z")

</div>

On 3/7/06, Lucifron [removed\_email\_address@domain.invalid](mailto: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
