LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > Having issues after upgrade to LSWS 4.0.3 and Rails 2.3.2.1

Reply
 
Thread Tools Display Modes
  #1  
Old 05-14-2009, 08:09 PM
malffred malffred is offline
Member
 
Join Date: Dec 2006
Location: Hawaii
Posts: 27
Question Having issues after upgrade to LSWS 4.0.3 and Rails 2.3.2.1

Hey guys,

Hopefully you can help me out a bit on this, I might just have a problem with my config.

The situation is this:
  1. Upgraded app to Rails 2.3.2.1 from 2.1.1
  2. Upgraded LSWS to 4.0.3 from 3.3.23 (whatever the last release was for the version 3 branch)
  3. We have a staging server where the app worked fine in 2.1.1
  4. The app in 2.3.2.1 works fine on our dev boxes (running mongrel)
  5. When we deploy to our staging server, it startups up an lsapi process for a few seconds but then it goes away and we get a 503 Service Unavailable error

Looking at the LSWS logs, I see this error happening upon the requests:

Code:
2009-05-14 14:16:59.518 [NOTICE] Loading LiteSpeed/4.0.3 Standard ...
2009-05-14 14:16:59.721 [NOTICE] [ADMIN] server socket: uds://opt/lsws/admin/tmp/admin.sock.7248
2009-05-14 14:16:59.722 [NOTICE] Loading configuration from /opt/lsws/conf/httpd_config.xml ...
2009-05-14 14:16:59.723 [NOTICE] Recovering server socket: [*:80]
2009-05-14 14:16:59.723 [NOTICE] Recovering server socket: [*:443]
2009-05-14 14:16:59.723 [NOTICE] Recovering server socket: [*:81]
2009-05-14 14:16:59.723 [INFO] old priority: -15, new priority: -15
2009-05-14 14:16:59.723 [INFO] [config:server:basic] For better obscurity, server version number is hidden in the response header.
2009-05-14 14:16:59.730 [NOTICE] The maximum number of file descriptor limit is set to 1024.
2009-05-14 14:16:59.733 [NOTICE] lshttpd (20576) is ready
2009-05-14 14:16:59.735 [NOTICE] [child: 20578] Successfully change current user to nobody
2009-05-14 14:16:59.735 [NOTICE] [Child: 20578] Core dump is enabled.
2009-05-14 14:16:59.736 [INFO] [staging] add child process pid: 20579
2009-05-14 14:16:59.736 [INFO] [staging] pid list size: 1 
2009-05-14 14:16:59.736 [NOTICE] [Child: 20578] Setup swapping space...
2009-05-14 14:16:59.736 [NOTICE] [Child: 20578] LiteSpeed/4.0.3 Standard starts successfully!
2009-05-14 14:16:59.736 [NOTICE] [AutoRestarter] new child process with pid=20578 is forked!
2009-05-14 14:17:00.111 [NOTICE] [AutoUpdate] Checking for new releases...
2009-05-14 14:17:00.276 [INFO] [AutoUpdate] No new update.
2009-05-14 14:17:20.593 [INFO] Remove pid: 20579
2009-05-14 14:17:20.593 [INFO] Pid: 20579 associated with [staging]
2009-05-14 14:17:20.593 [INFO] [staging] pid list size: 0, pid stop list size: 0
2009-05-14 14:17:28.577 [INFO] [75.25.130.134:56746-0#dev.sugarstats.com] File not found [/home/sugardev/www/releases/20090514135308/public/index.html] 
2009-05-14 14:17:28.578 [INFO] [staging] add child process pid: 20605
2009-05-14 14:17:28.578 [INFO] [staging] pid list size: 1 
2009-05-14 14:17:33.070 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] No request delivery notification has been received from LSAPI process:-2, possible run away process.
2009-05-14 14:17:33.070 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] Retry with new process group.
2009-05-14 14:17:38.070 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] No request delivery notification has been received from LSAPI process:-2, possible run away process.
2009-05-14 14:17:38.070 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] Retry with new process group.
2009-05-14 14:17:43.069 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] No request delivery notification has been received from LSAPI process:-2, possible run away process.
2009-05-14 14:17:43.069 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] Retry with new process group.
2009-05-14 14:17:48.066 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] No request delivery notification has been received from LSAPI process:-2, possible run away process.
2009-05-14 14:17:48.066 [INFO] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] connection to [uds://tmp/lshttpd/staging.sock] on request #0, confirmed: 0, Connection timed out!
2009-05-14 14:17:48.066 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] Suspious request timeout, associtated process: -1, running: 0.
2009-05-14 14:17:48.066 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] Max retries has been reached, 503!
2009-05-14 14:17:48.066 [INFO] Remove pid: 20605
2009-05-14 14:17:48.066 [INFO] Pid: 20605 associated with [staging]
2009-05-14 14:17:48.066 [INFO] [staging] pid list size: 0, pid stop list size: 0
2009-05-14 14:17:48.067 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] oops! 503 Service Unavailable
2009-05-14 14:17:48.067 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] Content len: 0, Request line: 
(null)
2009-05-14 14:17:48.067 [NOTICE] [75.25.130.134:56746-0#dev.sugarstats.com:lsapi] Redirect: #2, URL: /dispatch.lsapi
As you can see I get the "possible run away process." message several times before the 503 is served for max retry limit.

We are using the dispatch.lsapi as this is our "staging" environment and no production (though it is supposed to duplicate production). Perhaps that is old practice to use that and it is no longer needed?

Any suggestion on how I can fix this problem? Thanks.
Reply With Quote
  #2  
Old 05-14-2009, 08:21 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
The log shows that the RailsRunner.rb failed to start. You should check other Rails 2.3.x discussion.
I think your RailsRunner.rb need to be updated with the one coming from 4.0.3 release to get Rails 2.3.x support.
Reply With Quote
  #3  
Old 05-14-2009, 09:06 PM
malffred malffred is offline
Member
 
Join Date: Dec 2006
Location: Hawaii
Posts: 27
Oh ok, so is RailsRunner coming from ruby-lsapi? I was running 3.3, I just updated the gem to 3.5. I restarted LSWS but it didn't seem to make a diff.

On our staging capistrano deploy script we have this custom after_update_code method run:

Code:
namespace :deploy do 
  task :after_update_code, :roles => :app do
    sudo <<-CMD
    sh -c "chown -R #{jail_user}:#{jail_group} #{release_path} &&
           chmod -R g+w #{release_path}"
    CMD
  
    # Put the dispatch.lsapi into the application (just required for staging).
    if rails_env == "staging"
      sudo "cp /usr/lib/ruby/gems/1.8/gems/ruby-lsapi-3.5/rails/dispatch.lsapi #{release_path}/public/dispatch.lsapi"
      sudo "chmod +x #{release_path}/public/dispatch.lsapi"
    end
  end
 
  task :restart, :roles => :app do 
    sudo "#{lsws_cmd} restart"
  end 
end
Or do I have to update other files to get RailsRunning up to date?

Here is a snippet from the stderr.log file:

Code:
2009-05-15 03:59:54.885 [STDERR] /home/sugardev/www/releases/20090515034617/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:145:in `method_missing': undefined method `configure' for #<ActiveScaffold::Config::Core:0x2b6e6ec76ae8> (NoMethodError)
2009-05-15 03:59:55.038 [STDERR] 	from /home/sugardev/www/releases/20090515034617/vendor/plugins/active_scaffold/lib/active_scaffold.rb:57:in `active_scaffold'
2009-05-15 03:59:55.038 [STDERR] 	from /home/sugardev/www/releases/20090515034617/app/controllers/admin/users_controller.rb:11
2009-05-15 03:59:55.038 [STDERR] 	from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
2009-05-15 03:59:55.038 [STDERR] 	from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2009-05-15 03:59:55.038 [STDERR] 	from /home/sugardev/www/releases/20090515034617/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require'
2009-05-15 03:59:55.038 [STDERR] 	from /home/sugardev/www/releases/20090515034617/vendor/rails/activesupport/lib/active_support/dependencies.rb:265:in `require_or_load'
2009-05-15 03:59:55.038 [STDERR] 	from /home/sugardev/www/releases/20090515034617/vendor/rails/activesupport/lib/active_support/dependencies.rb:224:in `depend_on'
2009-05-15 03:59:55.038 [STDERR] 	from /home/sugardev/www/releases/20090515034617/vendor/rails/activesupport/lib/active_support/dependencies.rb:136:in `require_dependency'
2009-05-15 03:59:55.038 [STDERR] 	 ... 7 levels...
2009-05-15 03:59:55.038 [STDERR] 	from /home/sugardev/www/current/public/../config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
2009-05-15 03:59:55.038 [STDERR] 	from /home/sugardev/www/current/public/../config/environment.rb:13
2009-05-15 03:59:55.038 [STDERR] 	from /home/sugardev/www/current/public/dispatch.lsapi:7:in `require'
2009-05-15 03:59:55.038 [STDERR] 	from /home/sugardev/www/current/public/dispatch.lsapi:7
2009-05-15 04:00:25.300 [STDERR] /home/sugardev/www/releases/20090515034617/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:145:in `method_missing': undefined method `configure' for #<ActiveScaffold::Config::Core:0x2b7aeb565c98> (NoMethodError)
2009-05-15 04:00:25.536 [STDERR] 	from /home/sugardev/www/releases/20090515034617/vendor/plugins/active_scaffold/lib/active_scaffold.rb:57:in `active_scaffold'
2009-05-15 04:00:25.536 [STDERR] 	from /home/sugardev/www/releases/20090515034617/app/controllers/admin/users_controller.rb:11
	from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /home/sugardev/www/releases/20090515034617/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require'
	from /home/sugardev/www/releases/20090515034617/vendor/rails/activesupport/lib/active_support/dependencies.rb:265:in `require_or_load'
2009-05-15 04:00:25.536 [STDERR] 	from /home/sugardev/www/releases/20090515034617/vendor/rails/activesupport/lib/active_support/dependencies.rb:224:in `depend_on'
	from /home/sugardev/www/releases/20090515034617/vendor/rails/activesupport/lib/active_support/dependencies.rb:136:in `require_dependency'
	 ... 7 levels...
2009-05-15 04:00:25.536 [STDERR] 	from /home/sugardev/www/current/public/../config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
	from /home/sugardev/www/current/public/../config/environment.rb:13
2009-05-15 04:00:25.537 [STDERR] 	from /home/sugardev/www/current/public/dispatch.lsapi:7:in `require'
	from /home/sugardev/www/current/public/dispatch.lsapi:7
Perhaps it's a gem issue or conflict? Again, this is only happening under LSWS, works fine on mongrel. Thanks for the help.
Reply With Quote
  #4  
Old 05-14-2009, 09:12 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
If you use "Rails" Context, it will be using lsws/fcgi-bin/RailsRunner.rb ,
The dispatch.lsapi wont work with Rails 2.3.x .
Reply With Quote
  #5  
Old 05-14-2009, 10:22 PM
malffred malffred is offline
Member
 
Join Date: Dec 2006
Location: Hawaii
Posts: 27
Oh ok, yeah the context now uses "/dispatch.lsapi". I'll switch it to use RailsRunner.rb and see if that works.
Reply With Quote
  #6  
Old 05-15-2009, 12:37 PM
malffred malffred is offline
Member
 
Join Date: Dec 2006
Location: Hawaii
Posts: 27
I've been playing around with all sorts of context, external app and virtual host setting with no success.

I think I'm just going to delete the vhost completely redo it from scratch.

So my question is, are there any tutorials that you know of which show how to setup LSWS under a different environment name?

If I follow this tutuorial: http://www.litespeedtech.com/support...uby_rails_easy What would I have to do different in order to make it work under the environment name "staging".

Other than the environment name, it's going to be identical to a typical production Rails 2.3 app install.

Thanks
Reply With Quote
  #7  
Old 07-29-2009, 12:09 PM
genroxbro genroxbro is offline
New Member
 
Join Date: Jul 2009
Location: Canada
Posts: 1
Default Having issues after upgrade to LSWS 4 0 3 and Rails 2 3 2 1

After some email exchanges with support. It appears that the issue is due to restrictive mysql server settings by site5. We might get a fix from rails in future.

But I have found that the following workaround worked for me:

Whenever you get this error, just issue the command
reload
in the console and immediately repeat the same command.


--Amit
_____________________________________
Website I designed for payday loans in bc company.
Reply With Quote
  #8  
Old 11-16-2009, 09:04 AM
Tarembah73 Tarembah73 is offline
New Member
 
Join Date: Oct 2009
Location: United States
Posts: 7
Default Having issues after upgrade to LSWS 4 0 3 and Rails 2 3 2 1

Hi Rails Experts

After sending the email from controller using actionmailer with :smtp option, The email is being sent, but, the control is not returning to the next step for render partial action. HTTP 500 error Rails application failed to start properly is being rendered on the page after sending the email.


I dont see any error messages in the logs too. I made sure the actionmailer logging enabled in production.rb by adding the below line...config.action_mailer.raise_delivery_errors = true.

Can anyone help me in this regard please?
Reply With Quote
  #9  
Old 11-16-2009, 10:32 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
It is a Rails internal problem I guess, you can try downgrade rails see if it helps.
Rails 2.3 has some major changes comparing to Rails 2.2 or earlier release.
Reply With Quote
  #10  
Old 08-24-2011, 04:22 AM
johntikolo johntikolo is offline
New Member
 
Join Date: Jun 2011
Posts: 1
After some email exchanges with support. It appears that the issue is due to restrictive mysql server settings by site5. We might get a fix from rails in future.
__________________
instant payday loans
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:25 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.