Radiant on dremhost - incomplete dispatch.fcgi headers?

I have radiant installed over rubygems on dreamhost, and it works fine
with webbrick, but not with apache, for some reason. I get nothing on
the rails logs, and i get the following on apache’s error log:

[Thu Feb 22 10:39:12 2007] [error] FastCGI: comm with (dynamic) server
aborted: (first read) idle timeout (60 sec)
[Thu Feb 22 10:39:12 2007] [error] FastCGI: incomplete headers (0
bytes) received from server

any ideas of what could be causing this? i’ve tripled-checked the
recommendations on dreamhost’s wiki entry about running rails there,
and I have a couple of other rails apps running fine there with the
same configurations. I’ve even recreated the subdomain there and
reinstalled radiant, but no luck with that either.

  • Oliver

Do you see any other information in other log files?

As a test, try creating a fresh “empty” rails project.

Can you run

rails testproject
on the dreamhost ssh command line

See if you can get an empty rails site running.

Then compare the dispatch.fcgi and environment.rb of the test project
with the radiant you are trying to run.

Also try installing radiant as a full standalone app instead of using
the gem.

Hi Jacob,

no, the other log files are empty, aside from the db bootstraping info.

I do have a couple of other rails projects running on the same
account, and I’ve compared both environment and dispatch files,
nothing seems to be wrong… here’s my dispatch.fcgi:

require File.dirname(FILE) + “/…/config/environment”
require ‘fcgi_handler’

class RailsFCGIHandler
def frao_handler(signal)
dispatcher_log :info, “asked to terminate immediately”
dispatcher_log :info, “frao handler working its magic!”
alias_method :exit_now_handler, :frao_handler

RailsFCGIHandler.process! nil, 50

and my environment.rb is the standard one installed with radiant, I
just uncommented

ENV[‘RAILS_ENV’] ||= ‘production’

on it.

this problem is mentioned in a lot places on the web, but the
solutions given vary wildly - “force your GC to collect every 50
requests”, “run on dev mode first then run on production”, “check
permissions on /tmp and /log”… tried them all out.

There are threads mentioning hosting services (not just dreamhost)
deliberately killing off dispatch.fcgi processes from certain accounts
that have been “bad” with runaway processes. but thing is, the only
rails app I run full time here is running ok, and it doesn’t have much
traffic at all… I did send a support ticket asking whether that’s
happening, so let’s see how it goes.

meanwhile, i’m going to try running it as a standalone app as you

2007/2/22, Jacob B. [email protected]:

dreamhost responded saying I ran against a memory limit for the user
I’m running the app on. how i hit the limit with only development
sites with no traffic and ruby processes only running for a fraction
of the time, is a mistery to me. they suggested creating a new user
and installing everything over again… sigh…

anyway, thanks for all the help jakob

2007/2/22, Oliver B. [email protected]:

Ohh, good to know that the memory limit is tied to the user account.

I’ll have to start creating new users for each new site I setup.

I did notice one time my radiant on dreamhost crapped out while I was
doing a lot of intesive admin work. And it repeatedly failed to restart
after that for about 15 minutes… And then eventually it was fine
again without me doing anything.

I wonder if the memory limit is due to some extra startup logic or
checking etc…

What’s the first page you hit after killing all the crapping out fcgis?
This might make a difference. I’d think the best thing to do is hit a
page that is already cached before hitting the admin.

ok, now I’m able to see admin/pages/index and a few other pages, off
and on. can’t see the assets page at all, though the tab is there.

weird thing is, I can’t see any of the dispatch processes, with
neither users (main user and the new user I have set up for running

2007/2/24, Oliver B. [email protected]:

usually I just hit whatever page I was working on before… going to
try hitting a cached page first then.

so, I created a new user and installed everything again, this time
from svn, while keeping the original mysql data. I see the cached site
fine, and the login page for the admin as well. but when I login, I
get an “Application Error (Apache)” error.

production.log has the following error when trying to render

ActionView::TemplateError (The single-table inheritance mechanism
failed to locate the subclass: ‘MailerPage’. This error is raised
because the column ‘class_name’ is reserved for storing the class in
case of inheritance. Please rename this column if you didn’t intend it
to be used for storing the inheritance class or overwrite
Page.inheritance_column to use another column for that information.)
on line #44 of app/views/admin/page/_node.rhtml:
41: <% level = level + 1 -%>
42: <%
43: if expanded
44: page.children.each do |child|
45: -%>
46: <%= render_node child, :level => level, :simple => simple -%>
47: <%


instantiate_without_callbacks' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:204:in instantiate’
find_by_sql' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:427:in collect!’
find_by_sql' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:997:in find_every’
find' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:91:in find’
find_target' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:123:in load_target’
method_missing' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:98:in method_missing’
_run_rhtml_47app47views47admin47page47_node46rhtml' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in send’
compile_and_render_template' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:301:in render_template’
render_file' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:275:in render’
render_partial' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:30:in benchmark’
render_partial' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:287:in render’
#{RAILS_ROOT}/app/helpers/admin/page_helper.rb:4:in render_node' #{RAILS_ROOT}/app/views/admin/page/index.rhtml:14:in _run_rhtml_47app47views47admin47page47index46rhtml’
(leaving out rails-specific dump)

apache’s log is empty.

I have re-installed the Mailer extension and run rake
db:migrate:extensions… no output on the rake task though, should I
scrap the extension tables and migrate again?

2007/2/22, Jacob B. [email protected]: