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

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > Getting lots of application errors

Reply
 
Thread Tools Display Modes
  #1  
Old 09-07-2006, 12:40 PM
djsodom djsodom is offline
Member
 
Join Date: Sep 2006
Posts: 37
Default Getting lots of application errors

Hi,

I've got a fresh install. I keep getting 500 errors
Quote:
Application error (Apache)

Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html
Everything runs fine under WEBrick.

Using LS, these mysql connection errors keep popping up in my log:

Quote:
Rendering /srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.rhtml (500 Internal Error)
Mysql::Error: Lost connection to MySQL server during query: UPDATE sessions SET `data` = 'BAh7CjoNd29ya2Jvb2tvOg1Xb3JrQm9vaws6C0BzY29yZWkAO hBAY3VyYXRv\ncl9pZGkAOgtAaXRlbXNbCWkbaR1pHGkeOglAd GlkIgcxNDoLQHRvdGFsaQk6\nCkBnYW1lIhcwOTA3MDYxNDI2M TA5Mzg4MTE6C2xvY2FsZSIKZW4tVVM6DnJl\ndHVybl90byIRL 3F1ZXN0aW9ucy8xIgpmbGFzaElDOidBY3Rpb25Db250cm9s\nb GVyOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsAOgl1c2V yaQY=\n', `session_id` = '4ce5990a83a21877dd96e8f356d02450', `updated_at` = '2006-09-07 14:31:26' WHERE id = 1216
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:122:in `log'
I also have noticed when I using AJAX on a form and trace it using firebug, nothing shows up as a response.

Any ideas?

Thanks,

Steve
Reply With Quote
  #2  
Old 09-07-2006, 12:41 PM
djsodom djsodom is offline
Member
 
Join Date: Sep 2006
Posts: 37
I forgot to note too that I changed ownership of myrailsapp directory to a non-root user as I read to try in another post.
Reply With Quote
  #3  
Old 09-07-2006, 12:52 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Please try run WEBrick under the same user of the owner of myrailsapp directory. Make sure it works properly.
Check if process limit and memory limit is large enough for your application under "Rails" tab. change them to a large number.
Reply With Quote
  #4  
Old 09-07-2006, 01:08 PM
djsodom djsodom is offline
Member
 
Join Date: Sep 2006
Posts: 37
changed to the same user of the myrailsapp directory. turned on webrick. everything works fine.

Here is info from my Rails tab:
Quote:
Ruby Path /usr/local/bin/ruby
Rails Environment Development
Max Connections 5
Environment LSAPI_MAX_REQS=1000
LSAPI_MAX_IDLE=60
Initial Request Timeout (secs) 60
Retry Timeout (secs) 0
Connection Keepalive Timeout 60
Response Bufferring No
Back Log 50
Run On Start Up Yes
Max Idle Time 300
Priority 3
Memory Soft Limit (bytes) 150M
Memory Hard Limit (bytes) 200M
Process Soft Limit 100
Process Hard Limit 100
thanks,

Steve
Reply With Quote
  #5  
Old 09-07-2006, 01:24 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Configuration looks fine.
public/ folder is owned by the same of the myrailsapp directory, right? "ps -ef | grep ruby" should show that ruby is started by the same user.

Looks like you need to trace ruby process in order to find out what is wrong. do "strace -p <pid_of_child_ruby_process>", there should be two ruby processes, trace the child process. send a test request and check the output.
You can do the same to the WEBrick process, and compare the strace output.
Reply With Quote
  #6  
Old 09-07-2006, 02:13 PM
djsodom djsodom is offline
Member
 
Join Date: Sep 2006
Posts: 37
Quote:
Originally Posted by mistwang View Post
Configuration looks fine.
public/ folder is owned by the same of the myrailsapp directory, right? "ps -ef | grep ruby" should show that ruby is started by the same user.
I have two users steveodom (with is root) and steve. My railsapp folder and its public were previously owned by steveodom. I changed it to steve after having difficulty. Here are my processes:

PHP Code:
steve-odoms-computer:/usr/local steveodomps auxww grep rubysteveodo 23896   0.0  1.8    46932  18232  ??  SNs   4:04PM   0:01.21 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
steve    23897   0.0  2.0    49036  21008  
??  SNs   4:04PM   0:01.42 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
steveodo 23905   0.0  0.0    27356    424  p1  R
+    4:04PM   0:00.00 grep ruby
steve
-odoms-computer:/usr/local steveodom
So right now, it looks like ruby is started by a different user than myrailsapp owner. Dumb question - how do I start ruby with a different user?


Quote:
Looks like you need to trace ruby process in order to find out what is wrong. do "strace -p <pid_of_child_ruby_process>", there should be two ruby processes, trace the child process. send a test request and check the output.
You can do the same to the WEBrick process, and compare the strace output.
From my ps list above, which is my child_ruby_process?
Reply With Quote
  #7  
Old 09-07-2006, 02:24 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Quote:
So right now, it looks like ruby is started by a different user than myrailsapp owner. Dumb question - how do I start ruby with a different user?
By changing the owner of public/ folder.

Quote:
From my ps list above, which is my child_ruby_process?
None, you need do "killall ruby", then send a request again. you should see two ruby processes, the process with larger pid is the child process, if there is only one, then the child process probably dead due to the error.
Reply With Quote
  #8  
Old 09-08-2006, 09:24 AM
djsodom djsodom is offline
Member
 
Join Date: Sep 2006
Posts: 37
Okay, still working on this problem.

I'm on a intel mac and don't have the strace command available. I tried ktrace, but will have to do some research to get it working.

One thing I noticed is more RailsRunner.rb process get started with each error I have. For example...

Quote:
steve-odoms-computer:/srv/www/collectica steveodom$ ps auxww | grep ruby
steveodo 12342 0.0 1.8 46932 18220 ?? SNs 10:52AM 0:01.78 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
steveodo 12343 0.0 0.3 49036 3144 ?? SNs 10:52AM 0:02.21 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
steveodo 13136 0.0 0.3 49036 3068 ?? SNs 11:07AM 0:01.61 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
steveodo 13467 0.0 0.0 27356 424 p1 S+ 11:14AM 0:00.00 grep ruby
Then I have click on my site some more, I get more RailsRunner.rb's...
Quote:
steve-odoms-computer:/srv/www/collectica steveodom$ ps auxww | grep ruby
steveodo 13495 0.8 2.0 48700 20208 ?? SN 11:14AM 0:00.43 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
steveodo 13500 0.8 2.0 48700 20204 ?? SN 11:14AM 0:00.41 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
steveodo 12342 0.0 1.8 46932 18220 ?? SNs 10:52AM 0:01.80 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
steveodo 12343 0.0 0.3 49036 3144 ?? SNs 10:52AM 0:02.24 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
steveodo 13136 0.0 0.3 49036 3048 ?? SNs 11:07AM 0:01.63 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
steveodo 13502 0.0 0.0 27712 268 p1 R+ 11:14AM 0:00.00 grep ruby
steve-odoms-computer:/srv/www/collectica steveodom$
Does this point to anything?
Reply With Quote
  #9  
Old 09-08-2006, 09:39 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
I figured it is the same problem as yours.
http://www.litespeedtech.com/support...ead.php?p=2727

Please try the fix I came up with and let me know the result.
Thanks!
Reply With Quote
  #10  
Old 09-08-2006, 02:07 PM
djsodom djsodom is offline
Member
 
Join Date: Sep 2006
Posts: 37
I tried the fix, but still getting the same errors. On some clicks it works. Other times no. It seems to be worse when I have some dhtml/ajax call that hits the database and replaces something in a div.

PHP Code:
Rendering /srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.rhtml (500 Internal Error)
Mysql::ErrorLost connection to MySQL server during queryUPDATE sessions SET `data` = 'BAh7CjoNd29ya2Jvb2tvOg1Xb3JrQm9vaws6CkBnYW1lIhYwOTA4MDYxNTU2\nMjU4Mzg1MjoLQGl0ZW1zWw1pSmkRaUxpKGlLaSZpHmknOgtAdG90YWxpCjoL\nQHNjb3JlaQg6EEBjdXJhdG9yX2lkaQA6CUB0aWQiBjg6C2xvY2FsZSIKZW4t\nVVM6DnJldHVybl90byIRL3F1ZXN0aW9ucy8xOgl1c2VyaQYiCmZsYXNoSUM6\nJ0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2Vk\newA=\n', `session_id` = '4ce5990a83a21877dd96e8f356d02450', `updated_at` = '2006-09-08 15:58:34' WHERE id 1216
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:122:in `log'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:187:in 
`execute'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:202:in `update'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/base.rb:1767:in `update_without_lock'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:43:in 
`update_without_callbacks'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/callbacks.rb:267:in `update_without_timestamps'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/timestamp.rb:48:in `update'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/base.rb:1760:in 
`create_or_update_without_callbacks'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/callbacks.rb:242:in `create_or_update'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/base.rb:1523:in `save_without_validation'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/validations.rb:744:in 
`save_without_transactions'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/transactions.rb:120:in `save'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:51:in `transaction'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/transactions.rb:86:in 
`transaction'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/transactions.rb:112:in `transaction'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/transactions.rb:120:in `save'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:307:in 
`update'
/srv/www/collectica/config/../vendor/rails/activerecord/lib/active_record/base.rb:857:in `silence'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:307:in `update'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:314:in 
`close'
/usr/local/lib/ruby/1.8/cgi/session.rb:330:in `close'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/base.rb:1061:in `close_session'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/base.rb:1103:in 
`process_cleanup_without_flash'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/flash.rb:145:in `process_cleanup_without_filters'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:434:in `process_cleanup_without_session_management_support'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in 
`process_cleanup_without_components'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/components.rb:176:in `process_cleanup'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/base.rb:414:in `process_without_filters'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:372:in 
`process_without_session_management_support'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in `process'
/srv/www/collectica/config/../vendor/rails/actionpack/lib/action_controller/base.rb:321:in `process'
/srv/www/collectica/config/../vendor/rails/railties/lib/dispatcher.rb:41:in 
`dispatch'
/usr/local/lsws/fcgi-bin/RailsRunner.rb:11 
Plus, more RailsRunner.rb processes are started as I click through my app...

I can run ktrace and post the kdump file here if that would help. Or what else can I try?

Steve


Quote:
Originally Posted by mistwang View Post
I figured it is the same problem as yours.
http://www.litespeedtech.com/support...ead.php?p=2727

Please try the fix I came up with and let me know the result.
Thanks!
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Segfaults - protection errors gwhite Ruby/Rails 4 07-10-2007 02:03 PM
503 errors with lsws 3.1 + rails technix Ruby/Rails 2 07-05-2007 11:34 PM
Random 503 errors with LS admin subBlue Bug Reports 3 05-30-2007 07:59 AM
More Application Errors djsodom Ruby/Rails 6 02-19-2007 07:50 PM
500 error when executing lots of sqls. dlhhyct Ruby/Rails 3 09-17-2006 09:04 AM


All times are GMT -7. The time now is 10:12 PM.



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