3

So I've started upgrading our app to Rails 3.1 from Rails 3.0.9.

It's working great in the development environment. The time has come to put it up onto the staging server so we can run some full acceptance tests -- but oh, no! We're getting the horrible "Internal Server Error" pages served back at us half of the time, seemingly randomly. We're using Ruby 1.9.2 (p290) Apache (2) and Passenger (3.0.9).

Absolutely nothing is being written to our app's log file when these happen (even at the lowest log level).

The only thing being written to the Apache log is the following:

[Fri Dec 02 14:36:15 2011] [error] [client <my ip>] Premature end of script headers: <requested path>, referer: <http://domain.com/referrer>

Obviously this is far too generic an error for me to ask "fix it!", but some advice on where I can start looking to debug what's going on would be greatly appreciated. This is driving me nuts.

UPDATE: This problem does not occur with Sprockets disabled (i.e. config.assets.enabled = false) Never mind, it still does...

Edd Morgan
  • 2,873
  • 17
  • 22

2 Answers2

8

I found what was causing it.

It seems this is a problem with Rack middleware. A gem somewhere along the chain was breaking stuff (in my case it was the Airbrake (formerly known as Hoptoad) gem, which may explain why no exception was being logged anywhere). Removing the errant gem or updating it to the latest version (installing from git rather than the canonical rubygems source) fixed it for me.

If anyone else stumbles upon this issue, I'd advise you to check that part of your stack.

Edd Morgan
  • 2,873
  • 17
  • 22
0

Try reading through this, and seeing if it gains you any insight: http://htmlfixit.com/cgi-tutes/tutorial_Common_Web_dev_error_messages_and_what_they_mean.php#premature

jefflunt
  • 33,527
  • 7
  • 88
  • 126
  • Thanks, but unfortunately this gives me just enough insight to know it's probably an issue somewhere in my app. I'm hoping to coax a helpful error message out of Rails, but I'm not sure where to begin. – Edd Morgan Dec 02 '11 at 15:16