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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > Premature end of response header, and 503 service errors (maybe related, maybe not)

Reply
 
Thread Tools Display Modes
  #11  
Old 12-09-2006, 01:02 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
I tried your configuration, proper 404 page was returned.

Quote:
How would I get the PID of the actual ruby process? Does it have the same name as "ruby /opt/lsws/fcgi-bin/RailsRunner.rb"? Each "process" really starts two of these? It thought it was the web server that handled the forking/etc...?
LSWS only start one ruby process, this process will fork children process to handle all requests. This way, the startup cost of RoR framework is the lowest.

To get PID of the children process, send a normal request without resulting in 503 first, so the child process will be forked already, you should see two "ruby ...RailsRunner.rb" process at this moment, the child process should have a higher PID number. strace that process.

And check if the child process disappeared after processing the 404 request, it should not. if it does, means it crashed for some reason.
Reply With Quote
  #12  
Old 12-09-2006, 05:29 PM
fantasydreaming fantasydreaming is offline
Senior Member
 
Join Date: Sep 2006
Posts: 76
Default Solved!

It appears that the problem was that I was being stupid (doh!) and using a relative url to render the 404 file, "../../public/404.html". Switching it to "#{RAILS_ROOT}/public/404.html" solved the problem.

The parent-fork thing must change the working directory, which caused the discrepancy between litespeed and other servers. It might be better to reset the cmd if possible, just to keep it consistent.

Stracing the proper pid let me see that it was getting the error, though i'm still not sure why 1) rails crashes like that, or 2) litespeed shows it as a 503 rather than 500. It's not a timeout, it happens right away...

write(1, "Rendering public/404.html (404)\n", 32) = 32
open("public/404.html", O_RDONLY) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
getcwd("/usr/local/bin", 200) = 15
getcwd("/usr/local/bin", 200) = 15
getcwd("/usr/local/bin", 200) = 15
open("public/404.html", O_RDONLY) = -1 ENOENT (No such file or directory)
write(4, "set aph:session:f802551cd64f1e21"..., 961) = 961
read(4, "STORED\r\n", 1024) = 8
gettimeofday({1165712051, 488544}, NULL) = 0
fstat(1, {st_mode=S_IFREG|0644, st_size=5343777, ...}) = 0
write(1, "MemCache Put session:f802551cd64"..., 64) = 64
rt_sigaction(SIGINT, {SIG_DFL}, {0x46b990, [INT], SA_RESTORER|SA_RESTART, 0x3cfa62e410}, 8) = 0
close(4) = 0
munmap(0x2a97b36000, 4096) = 0
close(4) = -1 EBADF (Bad file descriptor)
munmap(0x2a97b35000, 4096) = 0
poll([{fd=5, events=POLLIN|POLLPRI}], 1, 0) = 0
setsockopt(5, SOL_SOCKET, SO_SNDTIMEO, "\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
write(5, "\1\0\0\0\1", 5) = 5
shutdown(5, 2 /* send and receive */) = 0
close(5) = 0
exit_group(1) = ?
Process 13473 detached

Thanks again! You guys rock! Litespeed is the bestest project ever....
Reply With Quote
  #13  
Old 12-09-2006, 06:00 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Glad you find the problem, we will address the compatibility issue in next ruby-lsapi release for sure.

What exactly is the result of getcwd() under other environment? #{RAILS_ROOT}/public?
Reply With Quote
  #14  
Old 12-11-2006, 04:21 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Please try the fix in
http://www.litespeedtech.com/support...=3710#post3710
with your original code, see if it works.
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 01:57 PM.



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