Rails app won't run on Dreamhost - "incomplet headers" error

Ah, thanks guys. I’ve checked the .htaccess and the shebang line but
they all match. I’ve followed almost all of the standard troubleshooting
procedures that I can, such as 775’ing, the shebang line, .htaccess,
production, and others. I have written to Dreamhost support about the
SSH access, does anyone know how to activate it or another way to run
dispatch.fcgi?

Siva J. wrote:

just try running dispatch.fcgi manually
it will show u if it has any problems

Okay, after running dispatch.fcgi, it says I have an error on line 21,
which reads:

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

Could part of the problem be that I didn’t create this via “rails
appname”? What do you think I should do?

Thanks for all the help!

just try running dispatch.fcgi manually
it will show u if it has any problems

On 1/31/06, Dave [email protected] wrote:


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Rgds,
–Siva J.
http://www.varcasa.com/
My First Rails Project. Powered by Typo and soon by RForum too

Rich B. wrote:

Well, this brings up another problem. Maybe I don’t have it turned on or
something, but I can’t log in via SSH. Putty just automatically closes
afer I login.

I second what david said.

That is a problem, another problem is that I don’t have my DB set up
with the proper tables yet, but if that happens, shouldn’t I get a
DB-specific rails error, instead of an “application failed?”

perhaps, but if you can’t successfully request dispatch.fcgi, then the
app will never load in the first place to make an entry to the log.

I have also heard that syntax errors could cause Rails to not start.
Anyway to check these errors? They work fine locally.

ruby dispatch.fcgi from the command line :slight_smile:

Well, if you run dispatch.fcgi from the command line, all you get is:

“Status: 500 Internal Server Error”

And in the error log you get:

Sun Feb 5 02:47:45 2006] [error] [client 12.222.74.240] FastCGI: comm
with (dynamic) server “/path-to-app/public/dispatch.fcgi” aborted:
(first read) idle timeout (120 sec)
[Sun Feb 5 02:47:45 2006] [error] [client 12.222.74.240] FastCGI:
incomplete headers (0 bytes) received from server
“/path-to-app/public/dispatch.fcgi”

This is an infrastructure issue meaning that either Dreamhost can’t
figure out how to get ruby running or Ruby just isn’t ready for use as
anything clost to a production application. Webbrick/development works
great – ruby+apache/fastcgi just plain sucks!

Rails works on Dreamhost, my apps are running there without problem.

To enable ssh access:

http://panel.dreamhost.com
login to your account
Click users
Click manage user
Click on your user id
Click edit
Check the box next to shell
Click Save Changes


Jon S.
[email protected]

On 2/5/06, Rich [email protected] wrote:

This is an infrastructure issue meaning that either Dreamhost can’t
figure out how to get ruby running or Ruby just isn’t ready for use as
anything clost to a production application. Webbrick/development works
great – ruby+apache/fastcgi just plain sucks!

Dreamhost is working just fine using Apache for me.

Did you do:
panel.dreamhost.com
domains/manage domains/.edit
Web Directory

And point Apache at your Rails app? You need to point into the public
directory.


Jon S.
[email protected]

On Feb 5, 2006, at 3:13 AM, Rich wrote:

with the proper tables yet, but if that happens, shouldn’t I get a
ruby dispatch.fcgi from the command line :slight_smile:
[Sun Feb 5 02:47:45 2006] [error] [client 12.222.74.240] FastCGI:
incomplete headers (0 bytes) received from server
“/path-to-app/public/dispatch.fcgi”

This is an infrastructure issue meaning that either Dreamhost can’t
figure out how to get ruby running or Ruby just isn’t ready for use as
anything clost to a production application. Webbrick/development works
great – ruby+apache/fastcgi just plain sucks!

Do not use running dispatch.fcgi from the command line as a test for
anything. If your app is configured properly, you will always get a
500 error from dispatch.fcgi on the command line. It expects to be
spoken to using the fcgi protocol and when you run it from the cli it
doesn’t get that so it gives the 500 error. Dispatch.cgi on the other
hand can be run from the cli. Just and FYI

Cheers-
-Ezra Z.
WebMaster
Yakima Herald-Republic Newspaper
[email protected]
509-577-7732

On 2/5/06, Rich [email protected] wrote:

When you copied your app up to the host, did you include the hidden
.htaccess file generated by Rails in the public directory?


Jon S.
[email protected]

although it will potentially shed light on an improperly configured
app, such as typos, unknown method errrors and the like. I had a typo
in my production environment and the command line is how I was able to
catch it.

On 2/5/06, Ezra Z. [email protected] wrote:

Yakima Herald-Republic Newspaper
[email protected]
509-577-7732


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


http://brantinteractive.com
[email protected]
4034 skippack pike
v. 267.640.2195
f. 215.689.1454

“No such file or directory - …/config/…/config/database.yml”

Looks like your database.yml is missing from config. Is it possible
you’ve
got something like database.yml.sample and forgotten to copy it as
database.yml?

RSL

On 2/28/07, Christer [email protected] wrote:

Hey guys.

I might add that rake db:migrate works fine, so database.yml is not the
problem. Also, i created an empty rails app and that worked fine. Must
be something with one of the files or a dependency… grr…

Rich B. wrote:

although it will potentially shed light on an improperly configured
app, such as typos, unknown method errrors and the like. I had a typo
in my production environment and the command line is how I was able to
catch it.

On 2/5/06, Ezra Z. [email protected] wrote:

Yakima Herald-Republic Newspaper
[email protected]
509-577-7732


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


http://brantinteractive.com
[email protected]
4034 skippack pike
v. 267.640.2195
f. 215.689.1454

Hey guys.

I have the exact same problem trying to get Beast running on Dreamhost.
I have followed all the help in the wiki and i have other rails apps
working there, so i suspect its something else with the Beast files.

From error.log:

[Wed Feb 28 06:46:02 2007] [error] [client 213.112.85.87] FastCGI: comm
with (dynamic) server “/home/cb
ermar/cepta.deepdarkhole.net/http/dispatch.fcgi” aborted: (first read)
idle timeout (60 sec)
[Wed Feb 28 06:46:02 2007] [error] [client 213.112.85.87] FastCGI:
incomplete headers (0 bytes) receive d from server
“/home/cbermar/cepta.deepdarkhole.net/http/dispatch.fcgi”

When running dispatch.fcgi and dispatch.cgi from command line i get
this:

[silk]$ ruby dispatch.fcgi
./…/config/boot.rb:38:Warning: require_gem is obsolete. Use gem
instead.
/usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:523:in
read': No such file or directory - ../config/../config/database.yml (Errno::ENOENT) from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:523:in database_configuration’
from
/usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:228:in
initialize_database' from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:88:in process’
from
/usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in send' from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in run’
from ./…/config/environment.rb:13
from dispatch.fcgi:21:in require' from dispatch.fcgi:21 [silk]$ ruby dispatch.cgi ./../config/boot.rb:38:Warning: require_gem is obsolete. Use gem instead. /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:523:in read’: No such file or directory - …/config/…/config/database.yml
(Errno::ENOENT)
from
/usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:523:in
database_configuration' from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:228:in initialize_database’
from
/usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:88:in
process' from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in send’
from
/usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in run' from ./../config/environment.rb:13 from dispatch.cgi:3:in require’
from dispatch.cgi:3
[silk]$

Any ideas? Cant understand what i did wrong…

Russell N. wrote:

“No such file or directory - …/config/…/config/database.yml”

Looks like your database.yml is missing from config. Is it possible
you’ve
got something like database.yml.sample and forgotten to copy it as
database.yml?

RSL

On 2/28/07, Christer [email protected] wrote:

Hey guys.

Hey,

Dont know why that happend to be honest, i started from scratch getting
source, setting up the paths etc from the wiki and now i get this when
running dispatch.fcgi.

[silk]$ ruby dispatch.fcgi
./…/config/boot.rb:38:Warning: require_gem is obsolete. Use gem
instead.
Install the ruby-openid gem to enable OpenID support
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.
rb:266:in load_missing_constant': uninitialized constant ActiveRecord::VERSION (NameError) from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ dependencies.rb:452:in const_missing’
from
/usr/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/active_record
.rb:49
from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_ original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in requ
ire’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:495:in require' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ dependencies.rb:342:in new_constants_in’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:495:in require' from /usr/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/rails.rb:435 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in gem_
original_require’
from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in requ ire' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ dependencies.rb:495:in require’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:342:in new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ dependencies.rb:495:in require’
from ./…/config/environment.rb:69
from dispatch.fcgi:21:in `require’
from dispatch.fcgi:21

Seems to be complaining about ActiveRecord::VERSION not being set. Is
there any other logs that can be examined to find the cause of the
problem? I still only get a HTTP 500 when i try to run the app.

Thanks,

Christer

Did you by chance edit your app on a Windows machine? You might want to
run
dos2unix on the files if so. I know that’s been a problem for more than
a
few people on Dreamhost. Including myself before I switched to
developing in
Linux.

RSL

Russell N. wrote:

Did you by chance edit your app on a Windows machine? You might want to
run
dos2unix on the files if so. I know that’s been a problem for more than
a
few people on Dreamhost. Including myself before I switched to
developing in
Linux.

RSL

No, i grabbed source (Beast) from their subversion repository, and used
vi to edit the files on the dreamhost servers. Thanks for the tip tho.

No more ideas? Starting to doubt i will get this running if there are no
logs to tell me what fails. A bit hard to debug then. I guess the output
from dispatch.fcgi above suggests that there is a problem with
ActiveRecord (ActiveRecord::VERSION) but i dont know how that could be
since its a core module of rails.

Could it be some environment setting missing or such? Would really
appreciate any help here.

Rich B., if you read this, would you mind mailing me personally? If
you could send me a zip with your app’s files i would be most greatful.
Might be something in there. I check all in panel and the wiki tutorial
so im really clueless what it could be.

Cheers.

Oh, incase i dont get it running, are there any other nice Rails forum
alternatives for Beast? Would really like to get one up, not necessarily
Beast.

Thanks.

This one, RForum, you can find it at http://rforum.andreas-s.net/

Nick

Compare Rails hosting companies

Nick S. wrote:

This one, RForum, you can find it at http://rforum.andreas-s.net/

Nick

http://www.railshostinginfo.com
Compare Rails hosting companies

Hi, looks pretty nice but i would prefer to get Beast running. Has a
richer styling and seems to have most needed features.

I started all over again, following these steps:

  1. in dreamhost control panel, create a sub-domain called y.x.com.
  2. make sure FastCGI is enabled.
  3. point the web root to y.x.com/trunk/public.
  4. svn checkout http://svn.techno-weenie.net/projects/beast/trunk.
  5. rake freeze_edge.
  6. gem install RedCloth (already installed).
  7. copy config/database.example.yml to database.yml and set it
    correctly.
  8. rake db:schema:load RAILS_ENV=production (complains about
    ActiveRecord::VERSION, without RAILS_ENV param works fine).
  9. change SALT in config/environment.rb.
  10. update .htaccess so RewriteRule points to dispatch.fcgi.
  11. add the RailsFCGIHandler class in dispatch.fcgi as dreamhost wiki
    explains.
  12. update shebang line in public/dispatch.cgi, public/dispatch.fcgi and
    public/dispatch.rb.
  13. set ENV[‘RAILS_ENV’] to ||= ‘production’ in config/environment.rb.
  14. check permissions, specially public and log dirs (u+rwX,go-w).
  15. check if all worked - alas, std 500 error response:

Application error
Rails application failed to start properly

Log files contains this:

logs/production:

Logfile created on Fri Mar 02 09:53:33 -0800 2007 by logger.rb/1.5.2.9

logs/y.x.com/http/error.log:

[Fri Mar 02 10:05:48 2007] [error] [client 213.112.85.87] FastCGI: comm
with (dynamic) server
“/home/cbermar/c.deepdarkhole.net/trunk/public/dispatch.fcgi” aborted:
(first read) idle timeout (60 sec)
[Fri Mar 02 10:05:48 2007] [error] [client 213.112.85.87] FastCGI:
incomplete headers (0 bytes) received from server
“/home/cbermar/c.deepdarkhole.net/trunk/public/dispatch.fcgi”

Question: Where can i find more logs that might contain explain what the
problem is? Any ideas how to fix it? Im getting really bummed here,
please help out.

Cheers.