Rails 2.3.2 issue with production mode

#1
Hi,

I know there are a lot of 2.3.2 threads but I couldn't find one that quite had these details; if there is one please point me that way.

I'm running litespeed 4.0.10 (tried on 4.0.6 as well) and I just recently upgraded my app to Rails 2.3.2 (from 2.2.2) and I'm having issues with getting it to run at all. I'm getting 500 errors all the time. The strange part is that no errors are being logged. The access log shows that the request is made and returns 500, but I don't see any issues in stderr.log or on the rails log side.

I started poking around and I discovered that it would run if I changed the environment to Development, or if I hardcoded ENV['RAILS_ENV'] to production in environment.rb. (neither of these being desirable obviously, although the latter is at least a work around). This lead me to some investigation (in tandum with some BackgrounDRb investigation too) which seems to show that Rails 2.3.2 has changed its handling of the constant RAILS_ENV vs. the environment variable ENV['RAILS_ENV']; the latter is now deprecated. I'm not sure exactly what is going on, but it appears that the RailsRunner new usage of Rack and such is getting confused somewhere and from my experience with tracking down my BackgrounDRb issue, I'm guessing it has to do with the environment being Production (since that's what lsws sets it as) but at the time of launching the Rack stack RAILS_ENV is still Development (haven't tracked down when this is set). I'd love to be able to prove this, but the fact that nothing is being logged is causing issues with that.

At any rate, anyone experiencing similar issues? Does my theories sound somewhat reasonable, or am I barking up the wrong tree? I imagine some people are running 2.3.2 in production, so perhaps there's something else I have wrong? Are there things I can do/get to provide more information so someone can help me troubleshoot? I haven't tried swapping in RailsRunner.rb.2.3 but since I'm using LSWS 4.0.10 it seems like the default RailsRunner.rb has the if check and I've verified that its following down the 2.3 path correctly.

Side note; I have made one update to RailsRunner.rb; similar to an issue I had with LSWS's 3.X series, there was an issue with Postgres where it would periodically have random issues with the connection. After clear_active_connections! is called I then call establish_connection before the fork. This should probably roll into the LSWS 4.0 code base at some time. Here's the 3.X thread if it helps: http://www.litespeedtech.com/support/forum/showthread.php?t=2690.

Thanks,
\Peter
 
Top