503 error with Rails 2.3.2

Discussion in 'Ruby/Rails' started by jmackin, Apr 27, 2009.

  1. jmackin

    jmackin New Member

    I'm not sure if I'm bringing up and old hat but I just upgrade to Rails 2.3.2 on my slicehost that runs litespeed and although litespeed doesn't seem to choke on it according to the logs it serves me with an 503 error.

    I saw a post that was kind of addressing this issue but I didn't seem to understand too well, what's going on or how to fix it.

    Is it an issue with litespeed? Can I solve it?

    Any help is appreciated.

    JM
  2. mistwang

    mistwang LiteSpeed Staff

    Have you upgrade Litespeed to the latest?
  3. jmackin

    jmackin New Member

    I'm still trying... I just messed up my server doing it... Bugger! Doesn't seem to be automatic at all!!!

    I'll have to deal with this, but I'll be back to report on how it goes.

    So you reckon the latest upgrade will do the trick?

    JM
  4. jmackin

    jmackin New Member

    I finally got the latest version of litespeed installed. BTW, nothing wrong with your docs. It turns out, that I can't read that well. :)

    Anyway, after upgrading to 4.0.2 I was able to run the Rails app with version 2.3.2 no worries at all.

    Thanks.

    JM
  5. jmackin

    jmackin New Member

    Actually cancel that... I just realized that I still had some pages in cache and after clearing that out, LiteSpeed still chokes on Rails 2.3.2.

    So, we are back on square 1 except this time I have the current version of LiteSpeed installed.

    Would you mind picking the issue up again?

    JM
  6. mistwang

    mistwang LiteSpeed Staff

    Is there any Ruby processes get started?
    Anything in Rails logs file? LSWS error.log and stderr.log?

    4.x comes with a new RailsRunner.rb to support Rack, if you revert back to 3.3.24, you should copy over the old RailsRunner.rb, but 3.3.24 wont work with Rails 2.3.2 , only earlier Rails releases.
  7. jmackin

    jmackin New Member

    LSWS error.log is fine
    Rails access.log, error.log, production.log are fine

    LSWS stderr.log ouput:

    2009-04-29 02:04:53.921 [NOTICE] [78.46.95.46:39068-0#23point7.com] [uds://tmp/lshttpd/23point7.com:_.sock] Request in process stage, fail with 503

    This output is not constant. My latest tests have not revealed the same behavior.

    I watched the ruby process with top and when I start the virtual host, either with 2.2.2 or 2.3.2 a couple of ruby processes jump up and disappear but only with 2.2.2 one ruby process reappears presumably because the website is served.
  8. mistwang

    mistwang LiteSpeed Staff

    Does your app run properly under 2.3.2 with mongrel or webrick?
    We tried the default rails app generated with 2.3.2, works fine.
  9. jmackin

    jmackin New Member

    Yes, it runs find under Mongrel (my development system) and Webrick (my production server).

    I'm yet to test a blank rails app... I'll do that today and report back.

    JM
  10. jmackin

    jmackin New Member

    I created an app from scratch and used ./script/generate scaffold post title:string body:text to create some functionality and database access.

    I simply copied the folder on the server and restarted the virtual host with the LS web console but neither 2.2.2 nor 2.3.2 seem to work now. 503 is omnipresent.

    See the error output: http://pastie.org/466422

    I'm getting more confused than find clarity. What could cause this strange behavior?

    JM
  11. mistwang

    mistwang LiteSpeed Staff

    I think an App generated by Rails 2.3.2 is likely to break with 2.2.2.
    I only care about the result with 2.3.2.
    If the app can be easily packed, please send it to bug@... , we can try it in our lab.
  12. jmackin

    jmackin New Member

    Done... it's on its way.
  13. mistwang

    mistwang LiteSpeed Staff

    Your app works fine in our lab. So, it must be your local environment.
    Please double check the RailsRunner.rb against the one in our installation package 4.0.2

    Check if there are multiple version of Ruby installed and the correct one has been used.
  14. amaltemara

    amaltemara New Member

    any luck?

    I'm having 503 errors as well...

    They seem to come more often when the server is under load, or this is the first request of this rails app since litespeed restarted...

    I tried updating the timeouts in the rails virtual host conf... but they're pretty long, and still it's happening...
  15. jmackin

    jmackin New Member

    OK... good to hear that it works at least.

    Now, I'd probably need some help with all those checks because I'm not that solid in linux etc. But this is how far I've gotten:

    First I did look for RailsRunner.rb on my server and this is the output:

    /home/jms/sources/lsws-3.1/fcgi-bin/RailsRunner.rb
    /home/jms/sources/lsws-4.0.2/fcgi-bin/RailsRunner.rb
    /home/jms/sources/lsws-4.0.2/fcgi-bin/RailsRunner.rb.2.3
    /usr/local/lsws/autoupdate/lsws-3.3.1/fcgi-bin/RailsRunner.rb
    /usr/local/lsws/fcgi-bin/RailsRunner.rb
    /usr/local/lsws/fcgi-bin/RailsRunner.rb.2.3

    I have no RailsRunner.rb installed on my local machine.

    I checked the versions with 'ruby -v'

    Local: ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux]
    Server: ruby 1.8.6 (2007-09-23 patchlevel 110) [i686-darwin9.1.0]

    I found the ruby installations here:

    Local: /opt/local/lib/ruby/1.8
    Server: /usr/lib/ruby/1.8

    I can't seem to find other installations but I'm not sure how to look for them.

    Is there anything else you'd need to know?
  16. pguy

    pguy New Member

    Copy /home/jms/sources/lsws-4.0.2/fcgi-bin/RailsRunner.rb.2.3 to /usr/local/lsws/fcgi-bin/RailsRunner.rb

    & /home/jms/sources/lsws-4.0.2/fcgi-bin/RailsRunner.rb.2.3 to /usr/local/lsws/fcgi-bin/RailsRunner.rb.2.3

    and over write to ensure you have the latest RailsRunner.rb & .rb.2.3
  17. jmackin

    jmackin New Member

    So far it looks like it's working... Extensive testing to come.

    Thanks for your help. It's greatly appreciated.
  18. amaltemara

    amaltemara New Member

    outdated RailsRunner.rb??



    Is this something we must manually do everytime we upgrade?

    Also, How can we serve both rails v2.3 and rails v2.2 on the save server? Does our virtual host automatically choose between the two?
  19. mistwang

    mistwang LiteSpeed Staff

    Please check the RailsRunner.rb in the latest 4.0.x release, it should be compatible with both v2.2 and v2.3.

    You may need to explicitly specify the rails version with "RAILS_GEM_VERSION" in environment.rb if you want to use rails 2.3.x
  20. palb

    palb New Member

    I got the same problem. Works with WEBRick server.

Share This Page