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

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > trouble on redirect_to's

Reply
 
Thread Tools Display Modes
  #1  
Old 09-11-2006, 03:19 PM
djsodom djsodom is offline
Member
 
Join Date: Sep 2006
Posts: 37
Default trouble on redirect_to's

I've narrowed down the problem I've been having with litespeed to methods where I am using redirect_to. For example, something like:

def create
@workbook.track_results(params[:answer_id])
if @workbook.total == @workbook.items.size
redirect_to history_url(@workbook.game)
else
redirect_to quiz_url(@workbook.items[@workbook.total])
end
end

Maybe 50% of the time with litespeed the redirects die and nothing happens. For example, there is no response listed in firebug. I have no problem with webrick or lightty.

Any ideas what this could be?

Here is an output from my rails development log:

Code:
Processing HistoriesController#create (for 127.0.0.1 at 2006-09-11 17:06:15) [POST]
  Session ID: 5eeed2ea942628caabd47d2066deff40
  Parameters: {"action"=>"create", "id"=>"25", "answer_id"=>"3", "controller"=>"histories"}
  History Columns (0.003766)   SHOW FIELDS FROM histories
  SQL (0.000208)   BEGIN
 UPDATE users SET `created_at` = '2006-05-23 18:45:41', `play_total` = 10, `login` = 'thomasB', `crypted_password` = 'a0fb71a7ec39a1c2267438c81f647e8fb18cf9fb', `bio` = '', `create_count` = 13, `remember_token_expires_at` = NULL, `salt` = '4dd6bb2d535ab77097623fa7c8856c364aead978', `play_correct` = 10, `edit_count` = 111, `remember_token` = NULL, `note` = '', `is_stats_visible` = 1, `email` = 'thomasb@gmail.com', `password_reset_code` = NULL, `updated_at` = '2006-09-11 17:06:15' WHERE id = 9
  SQL (0.000647)   COMMIT
Redirected to http://localhost:3000/histories/0911061706086998
Completed in 0.07699 (12 reqs/sec) | DB: 0.02403 (31%) | 302 Found
Thanks
Steve
Reply With Quote
  #2  
Old 09-11-2006, 05:41 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Maybe the redirect URL is mis-formated under LiteSpeed LSAPI, there are subtle differences in request paramters that Rails received between LiteSpeed LSAPI and webrick.
Run the app under Litespeed and dump the URL.
Reply With Quote
  #3  
Old 09-11-2006, 06:51 PM
djsodom djsodom is offline
Member
 
Join Date: Sep 2006
Posts: 37
Perhaps. My redirect URL is a little unconventional:
http://localhost/quizzes/index/sport...7&curator_id=1

..where "sports" is a non-numeric id.

When you say dump the URL, how do you mean?
Reply With Quote
  #4  
Old 09-11-2006, 06:56 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
"Dump the URL" means that write the URL to the log file or somewhere.
I need to get an idea about how the URL looks like, and it will be even better if you can log the whole redirect response sent back to LSWS by Rails.
Reply With Quote
  #5  
Old 09-14-2006, 06:05 PM
djsodom djsodom is offline
Member
 
Join Date: Sep 2006
Posts: 37
Thanks George. I will work on this and get you some info. I put it aside for awhile to work on something else.


Quote:
Originally Posted by mistwang View Post
"Dump the URL" means that write the URL to the log file or somewhere.
I need to get an idea about how the URL looks like, and it will be even better if you can log the whole redirect response sent back to LSWS by Rails.
Reply With Quote
  #6  
Old 09-15-2006, 12:00 PM
djsodom djsodom is offline
Member
 
Join Date: Sep 2006
Posts: 37
Okay, I used livehttpheaders to dump the URLs using both Litespeed and Lighttpd for contrast.

I've attached both text files it generated (though I deleted some of the calls to my stylesheets for example for brevity).

What I'm doing is basically an ajax quiz.

A question is presented. the user clicks on a question, which posts the data to the db, and is then redirected to another question that renders as a partial replacing the html of the previous question.
---------------
i can't seem to get the text files to actually attach to this message, so I'll just post the text here:

Lightspeed
Code:
http://localhost:82/quizzes/presidents;list

GET /quizzes/presidents;list HTTP/1.1
Host: localhost:82
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Accept: application/x-shockwave-flashapplication/x-shockwave-flashapplication/x-shockwave-flashapplication/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf
Cache-Control: max-age=0

HTTP/1.x 200 OK
Content-Type: text/html
Set-Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf; path=/
Cache-Control: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
Transfer-Encoding: chunked
Server: LiteSpeed
Date: Fri, 15 Sep 2006 11:58:59 GMT
----------------------------------------------------------
http://localhost:82/quizzes/index/presidents?tid=8&curator_id=4

POST /quizzes/index/presidents?tid=8&curator_id=4 HTTP/1.1
Host: localhost:82
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Accept: text/javascript, text/html, application/xml, text/xml, */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: close
X-Requested-With: XMLHttpRequest
X-Prototype-Version: 1.5.0_pre0
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.x 302 Found
Content-Type: text/html
Set-Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf; path=/
Cache-Control: no-cache
Location: http://localhost:82/quizzes/12
Content-Encoding: gzip
Vary: Accept-Encoding
Transfer-Encoding: chunked
Server: LiteSpeed
Date: Fri, 15 Sep 2006 12:00:16 GMT
Connection: close
----------------------------------------------------------
http://localhost:82/quizzes/12

GET /quizzes/12 HTTP/1.1
Host: localhost:82
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Accept: application/x-shockwave-flashapplication/x-shockwave-flashapplication/x-shockwave-flashapplication/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.x 200 OK
----------------------------------------------------------
http://mozilla.ziply.com//firefox/releases/1.5.0.7/update/mac/en-US/firefox-1.5.0.7.complete.mar

GET //firefox/releases/1.5.0.7/update/mac/en-US/firefox-1.5.0.7.complete.mar HTTP/1.1
Host: mozilla.ziply.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Accept: application/x-shockwave-flashapplication/x-shockwave-flashapplication/x-shockwave-flashapplication/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Range: bytes=2555904-2621439

HTTP/1.x 206 Partial Content
Date: Fri, 15 Sep 2006 12:00:57 GMT
Server: Apache/1.3.35 (Unix) mod_perl/1.29 PHP/5.1.4
Last-Modified: Thu, 14 Sep 2006 06:57:40 GMT
Etag: "15b2811-e7cd72-4508fd64"
Accept-Ranges: bytes
Content-Length: 65536
Content-Range: bytes 2555904-2621439/15191410
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/plain
----------------------------------------------------------
Lighttpd
Code:
 http://localhost:3000/quizzes/presidents;list

GET /quizzes/presidents;list HTTP/1.1
Host: localhost:3000
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Accept: application/x-shockwave-flashapplication/x-shockwave-flashapplication/x-shockwave-flashapplication/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf

HTTP/1.x 200 OK
Transfer-Encoding: chunked
Content-Type: text/html
Set-Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf; path=/
Cache-Control: no-cache
Date: Fri, 15 Sep 2006 12:06:34 GMT
Server: lighttpd/1.4.11
----------------------------------------------------------
----------------------------------------------------------
http://localhost:3000/quizzes/index/presidents?tid=8&curator_id=4

POST /quizzes/index/presidents?tid=8&curator_id=4 HTTP/1.1
Host: localhost:3000
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Accept: text/javascript, text/html, application/xml, text/xml, */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: close
X-Requested-With: XMLHttpRequest
X-Prototype-Version: 1.5.0_pre0
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.x 302 Found
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
Set-Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf; path=/
Cache-Control: no-cache
Location: http://localhost:3000/quizzes/12
Date: Fri, 15 Sep 2006 12:06:38 GMT
Server: lighttpd/1.4.11
----------------------------------------------------------
http://localhost:3000/quizzes/12

GET /quizzes/12 HTTP/1.1
Host: localhost:3000
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Accept: application/x-shockwave-flashapplication/x-shockwave-flashapplication/x-shockwave-flashapplication/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.x 200 OK
Transfer-Encoding: chunked
Content-Type: text/javascript
Set-Cookie: _session_id=3d0d46d90b342fa7f560653feb949abf; path=/
Cache-Control: no-cache
Date: Fri, 15 Sep 2006 12:06:38 GMT
Server: lighttpd/1.4.11
----------------------------------------------------------
Reply With Quote
  #7  
Old 09-15-2006, 12:17 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
The log shows that the request for "/quizzes/12" failed when LSWS is used. Only get "200 OK ..." line, other header lines are missing.

You can try this request directly, without redirection, redirection is working fine.

Take a look at how this request being handled by rails, and anything special makes LSWS fail then I can fix it.

You can use comnand "lynx -mime_header http://localhost:82/quizzes/12" to dump the whole response, wget can do it as well, I forgot the command line parameter.
Reply With Quote
  #8  
Old 09-21-2006, 11:36 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Please give http://www.litespeedtech.com/package...api-1.9.tar.gz a try, your problem might be fixed already.
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
APC trouble murp PHP 2 05-30-2007 07:35 AM
Having trouble with virtual hosts--need some help DavidPesta Install/Configuration 1 01-13-2007 08:47 AM
503 Service Unavailable George Install/Configuration 14 02-11-2004 01:23 AM


All times are GMT -7. The time now is 06:29 AM.



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