503 error after rails 2 upgrade

foxxx

New Member
#1
I've upgraded from rails 1.8.6 to rails 2.0.2.

My app is ok, it loads fine and works fine with mongrel. But I can't get it to work with litespeed anymore for some reason - nothing in litespeed has changed, and the app hasn't changed.

error log outputs below.

-----------------------------------
Code:
foxxx@engine:/opt/lsws/logs$ cat stderr.log
./config/environment.rb:13: uninitialized constant Rails (NameError)
        from /opt/lsws/fcgi-bin/RailsRunner.rb:5:in `require'
        from /opt/lsws/fcgi-bin/RailsRunner.rb:5
./config/environment.rb:13: uninitialized constant Rails (NameError)
        from /opt/lsws/fcgi-bin/RailsRunner.rb:5:in `require'
        from /opt/lsws/fcgi-bin/RailsRunner.rb:5
./config/environment.rb:13: uninitialized constant Rails (NameError)
        from /opt/lsws/fcgi-bin/RailsRunner.rb:5:in `require'
        from /opt/lsws/fcgi-bin/RailsRunner.rb:5
foxxx@engine:/opt/lsws/logs$ cat error.log
2008-06-02 14:57:58.128 [DEBUG] Failed to execute 'mpstat' command: No such file or directory
2008-06-02 14:58:03.127 [DEBUG] Failed to execute 'mpstat' command: No such file or directory
2008-06-02 14:58:04.145 [DEBUG] [*:9000] New connection from 192.168.1.8:54885.
2008-06-02 14:58:04.145 [DEBUG] [*:9000] 1 connections accepted!
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0] HttpIOLink::handleEvents() events=1!
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0] HttpConnection::onReadEx(), state: 0!
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0] readToHeaderBuf().
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0] Read from client: 521
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0] read 521 bytes to header buffer
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0] processHeader() return 0, header state: 3.
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0] readToHeaderBuf() return 0.
2008-06-02 14:58:04.145 [NOTICE] [192.168.1.8:54885-0#bpml] Content len: 0, Request line:
GET / HTTP/1.1
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0#bpml] Find context with URI: [/], location: [/var/sites/bpml/public/]
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0#bpml] File not found [/var/sites/bpml/public/index.html]
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0#bpml] processContextPath() return 25
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0#bpml] processNewReq() return 25.
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0#bpml] HttpConnection::sendHttpError(),code=404 Not Found
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0#bpml] redirect to:
        URI=[/dispatch.lsapi],
        QueryString=[]
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0#bpml] Find context with URI: [/dispatch.lsapi], location: []
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0#bpml] processContextPath() return 0
2008-06-02 14:58:04.145 [DEBUG] [192.168.1.8:54885-0#bpml] run lsapi processor.
2008-06-02 14:58:04.146 [INFO] [Rails:bpml:/] add child process pid: 27690
2008-06-02 14:58:04.146 [INFO] [Rails:bpml:/] pid list size: 1
2008-06-02 14:58:04.146 [DEBUG] [uds://tmp/lshttpd/bpml:_.sock] request [192.168.1.8:54885-0#bpml:lsapi] is assigned with connection!
2008-06-02 14:58:04.146 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] [ExtConn] reconnect()
2008-06-02 14:58:04.146 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] [ExtConn] connecting to [uds://tmp/lshttpd/bpml:_.sock]...
2008-06-02 14:58:04.146 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::onWrite()
2008-06-02 14:58:04.146 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] request header is done
2008-06-02 14:58:04.146 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::continueRead()
2008-06-02 14:58:04.146 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] Request body done!
2008-06-02 14:58:04.146 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::suspendWrite()
2008-06-02 14:58:04.152 [INFO] Remove pid: 27690
2008-06-02 14:58:04.152 [INFO] Pid: 27690 associated with [Rails:bpml:/]
2008-06-02 14:58:04.152 [INFO] [Rails:bpml:/] pid list size: 0, pid stop list size: 0
2008-06-02 14:58:04.152 [NOTICE] [Rails:bpml:/] stop worker processes
2008-06-02 14:58:04.152 [INFO] [Rails:bpml:/] 1 request being processed, kill external app later.
2008-06-02 14:58:04.152 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::onRead()
2008-06-02 14:58:04.152 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] LsapiConn::doRead()
2008-06-02 14:58:04.152 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] process packet header -1 bytes
2008-06-02 14:58:04.152 [INFO] [192.168.1.8:54885-0#bpml:lsapi] connection to [uds://tmp/lshttpd/bpml:_.sock] on request #0, error: Connection reset by peer!
2008-06-02 14:58:04.152 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] [ExtConn] close()
2008-06-02 14:58:04.152 [DEBUG] [uds://tmp/lshttpd/bpml:_.sock] No Request has been processed successfully through this connection, the maximum connections allowed will be reduced!
 

foxxx

New Member
#2
Code:
2008-06-02 14:58:04.152 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpExtConnector::tryRecover()...
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] trying to recover from connection problem, attempt: #1!
2008-06-02 14:58:04.153 [INFO] [Rails:bpml:/] add child process pid: 27691
2008-06-02 14:58:04.153 [INFO] [Rails:bpml:/] pid list size: 1
2008-06-02 14:58:04.153 [DEBUG] [uds://tmp/lshttpd/bpml:_.sock] request [192.168.1.8:54885-0#bpml:lsapi] is assigned with connection!
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] [ExtConn] reconnect()
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] [ExtConn] connecting to [uds://tmp/lshttpd/bpml:_.sock]...
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::onWrite()
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] request header is done
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::continueRead()
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] Request body done!
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::suspendWrite()
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::onError()
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::onRead()
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] LsapiConn::doRead()
2008-06-02 14:58:04.153 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] process packet header 0 bytes
2008-06-02 14:58:04.159 [INFO] Remove pid: 27691
2008-06-02 14:58:04.159 [INFO] Pid: 27691 associated with [Rails:bpml:/]
2008-06-02 14:58:04.159 [INFO] [Rails:bpml:/] pid list size: 0, pid stop list size: 0
2008-06-02 14:58:04.159 [NOTICE] [Rails:bpml:/] stop worker processes
2008-06-02 14:58:04.159 [INFO] [Rails:bpml:/] 1 request being processed, kill external app later.
2008-06-02 14:58:04.159 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::onRead()
2008-06-02 14:58:04.159 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] LsapiConn::doRead()
2008-06-02 14:58:04.159 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] process packet header -1 bytes
2008-06-02 14:58:04.159 [INFO] [192.168.1.8:54885-0#bpml:lsapi] connection to [uds://tmp/lshttpd/bpml:_.sock] on request #0, error: Connection reset by peer!
2008-06-02 14:58:04.159 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] [ExtConn] close()
2008-06-02 14:58:04.159 [DEBUG] [uds://tmp/lshttpd/bpml:_.sock] No Request has been processed successfully through this connection, the maximum connections allowed will be reduced!
2008-06-02 14:58:04.159 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpExtConnector::tryRecover()...
2008-06-02 14:58:04.159 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] trying to recover from connection problem, attempt: #2!
2008-06-02 14:58:04.159 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] try to restart external application [Rails:bpml:/] at [uds://tmp/lshttpd/bpml:_.sock]...
2008-06-02 14:58:04.160 [INFO] [Rails:bpml:/] add child process pid: 27692
2008-06-02 14:58:04.160 [INFO] [Rails:bpml:/] pid list size: 1
2008-06-02 14:58:04.160 [DEBUG] [uds://tmp/lshttpd/bpml:_.sock] request [192.168.1.8:54885-0#bpml:lsapi] is assigned with connection!
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] [ExtConn] reconnect()
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] [ExtConn] connecting to [uds://tmp/lshttpd/bpml:_.sock]...
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::onWrite()
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] request header is done
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::continueRead()
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] Request body done!
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::suspendWrite()
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::onError()
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::onRead()
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] LsapiConn::doRead()
2008-06-02 14:58:04.160 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] process packet header 0 bytes
2008-06-02 14:58:04.166 [INFO] Remove pid: 27692
2008-06-02 14:58:04.166 [INFO] Pid: 27692 associated with [Rails:bpml:/]
2008-06-02 14:58:04.166 [INFO] [Rails:bpml:/] pid list size: 0, pid stop list size: 0
2008-06-02 14:58:04.166 [NOTICE] [Rails:bpml:/] stop worker processes
2008-06-02 14:58:04.166 [INFO] [Rails:bpml:/] 1 request being processed, kill external app later.
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] ExtConn::onRead()
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] LsapiConn::doRead()
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] process packet header -1 bytes
2008-06-02 14:58:04.166 [INFO] [192.168.1.8:54885-0#bpml:lsapi] connection to [uds://tmp/lshttpd/bpml:_.sock] on request #0, error: Connection reset by peer!
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] [ExtConn] close()
2008-06-02 14:58:04.166 [DEBUG] [uds://tmp/lshttpd/bpml:_.sock] No Request has been processed successfully through this connection, the maximum connections allowed will be reduced!
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpExtConnector::tryRecover()...
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpIOLink::continueWrite()...
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] write resumed!
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpIOLink::handleEvents() events=4!
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpIOLink::suspendWrite()...
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpConnection::sendHttpError(),code=503 Service Unavailable
2008-06-02 14:58:04.166 [NOTICE] [192.168.1.8:54885-0#bpml:lsapi] oops! 503 Service Unavailable
2008-06-02 14:58:04.166 [NOTICE] [192.168.1.8:54885-0#bpml:lsapi] Content len: 0, Request line:
GET / HTTP/1.1
2008-06-02 14:58:04.166 [NOTICE] [192.168.1.8:54885-0#bpml:lsapi] Redirect: #2, URL: /dispatch.lsapi
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpConnection::flush()!
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] Written to client: 621
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpConnection::nextRequest()!
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpExtConnector::cleanUp() ...
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] abort request...
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] release ExtProcessor!
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] Non-KeepAlive, CLOSING!
2008-06-02 14:58:04.166 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] Shutting down out-bound socket ...
2008-06-02 14:58:04.167 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] HttpIOLink::handleEvents() events=17!
2008-06-02 14:58:04.167 [DEBUG] [192.168.1.8:54885-0#bpml:lsapi] Close socket ...
foxxx@engine:/opt/lsws/logs$
 

mistwang

LiteSpeed Staff
#3
Do you have any idea why you get this
Code:
./config/environment.rb:13: uninitialized constant Rails (NameError)
        from /opt/lsws/fcgi-bin/RailsRunner.rb:5:in `require'
        from /opt/lsws/fcgi-bin/RailsRunner.rb:5
line 5 is
Code:
require 'config/environment'
 

foxxx

New Member
#4
Yeah NO idea why at all, webbrick loads file, mongrel loads fine, and it loads fine on my 1.2.5 rails servers (staging and production environments), that hasnt changed EXCEPT for a litespeed upgrade...

I'm now running NGINX in all my enviroments and it works perfect, no issues... only litespeed wont run it.

well line 13 in the enviroment.rb is

Rails::Initializer.run do |config|



Code:
# Be sure to restart your web server when you modify this file.

# Uncomment below to force Rails into production mode when 
# you don't control web/app server and can't set it the proper way
#ENV['RAILS_ENV'] ||= 'production'

# Specifies gem version of Rails to use when vendor/rails is not present
#RAILS_GEM_VERSION = '1.2.6' unless defined? RAILS_GEM_VERSION

# Bootstrap the Rails environment, frameworks, and default configuration
 require File.join(File.dirname(__FILE__), 'boot')

Rails::Initializer.run do |config|

  config.action_mailer.delivery_method = :smtp
  config.plugins = ["engines", "*"]


end
 

mistwang

LiteSpeed Staff
#6
I have upgrade our rails test environment to 2.1.0, created a test rails application, it works fine with LiteSpeed, maybe the rails 2.0.2 is buggy.
 
Top