Proxy crashes backend mongrel when URL ends with ?

inspirix

Active Member
#1
I'm proxying lsws to a mongrel backend serving my rails app in my development environment.

Ive noticed that a url such as /locations/6/edit? causes lsws and mongrel to go crazy. Mongrel ends up dying. lsws debug output of what its trying to do is here:

http://stat.im/lsws.error.log.txt

Mongrel does this:

#<RangeError: 0x1d4e8dc is recycled object>
#<RangeError: 0x1d4c640 is recycled object>
#<RangeError: 0x1d4dcca is recycled object>
#<RangeError: 0x1d4e36e is recycled object>
#<RangeError: 0x1d4c064 is recycled object>
.... a bunch more times ....
#<RangeError: 0x1d4d310 is recycled object>
Illegal instruction

It looks to me like its trying to connect to mongrel an amazing amount of times and keeps getting rejected.

If I hit mongrel with the same url with the ? at the end it works. So im not sure if there is some translation process occurring that is modifying something?

Unfortunately, I have no idea if this is a lsws proxy issue or a mongrel issue, so sorry in advance.

Joe
 

mistwang

LiteSpeed Staff
#2
Can try capturing the data going back and forth between LSWS and mongrel with tcpdump?
something like "tcpdump -i lo -s 0 -X"

Looks like mongrel does not like the request forwarded by LSWS, you can verify the request it with tcpdump output.
 

mistwang

LiteSpeed Staff
#4
The request looks all right, mongrel does not like it, and close connection upon receiving it.
Code:
	0x0030:  73ac aab4 4745 5420 2f61 6363 6f75 6e74  s...GET./account
	0x0040:  2f6c 6f63 6174 696f 6e73 2f36 2f65 6469  /locations/6/edi
	0x0050:  743f 0048 5454 502f 312e 310d 0a48 6f73  t?.HTTP/1.1..Hos
	0x0060:  743a 206c 6f63 616c 732e 6465 760d 0a55  t:.locals.dev..U
	0x0070:  7365 722d 4167 656e 743a 204d 6f7a 696c  ser-Agent:.Mozil
	0x0080:  6c61 2f35 2e30 2028 4d61 6369 6e74 6f73  la/5.0.(Macintos
	0x0090:  683b 2055 3b20 496e 7465 6c20 4d61 6320  h;.U;.Intel.Mac.
	0x00a0:  4f53 2058 3b20 656e 2d55 533b 2072 763a  OS.X;.en-US;.rv:
	0x00b0:  312e 382e 312e 3629 2047 6563 6b6f 2f32  1.8.1.6).Gecko/2
	0x00c0:  3030 3730 3732 3520 4669 7265 666f 782f  0070725.Firefox/
	0x00d0:  322e 302e 302e 360d 0a41 6363 6570 743a  2.0.0.6..Accept:
	0x00e0:  2074 6578 742f 786d 6c2c 6170 706c 6963  .text/xml,applic
	0x00f0:  6174 696f 6e2f 786d 6c2c 6170 706c 6963  ation/xml,applic
	0x0100:  6174 696f 6e2f 7868 746d 6c2b 786d 6c2c  ation/xhtml+xml,
	0x0110:  7465 7874 2f68 746d 6c3b 713d 302e 392c  text/html;q=0.9,
	0x0120:  7465 7874 2f70 6c61 696e 3b71 3d30 2e38  text/plain;q=0.8
	0x0130:  2c69 6d61 6765 2f70 6e67 2c2a 2f2a 3b71  ,image/png,*/*;q
	0x0140:  3d30 2e35 0d0a 4163 6365 7074 2d4c 616e  =0.5..Accept-Lan
	0x0150:  6775 6167 653a 2065 6e2d 7573 2c65 6e3b  guage:.en-us,en;
	0x0160:  713d 302e 350d 0a41 6363 6570 742d 456e  q=0.5..Accept-En
	0x0170:  636f 6469 6e67 3a20 677a 6970 2020 2020  coding:.gzip....
	0x0180:  2020 2020 0d0a 4163 6365 7074 2d43 6861  ......Accept-Cha
	0x0190:  7273 6574 3a20 4953 4f2d 3838 3539 2d31  rset:.ISO-8859-1
	0x01a0:  2c75 7466 2d38 3b71 3d30 2e37 2c2a 3b71  ,utf-8;q=0.7,*;q
	0x01b0:  3d30 2e37 0d0a 4b65 6570 2d41 6c69 7665  =0.7..Keep-Alive
	0x01c0:  3a20 3330 300d 0a43 6f6e 6e65 6374 696f  :.300..Connectio
	0x01d0:  6e3a 206b 6565 702d 616c 6976 650d 0a43  n:.keep-alive..C
	0x01e0:  6f6f 6b69 653a 205f 7365 7373 696f 6e5f  ookie:._session_
	0x01f0:  6964 3d30 3261 3938 3066 3836 3663 3963  id=02a980f866c9c
	0x0200:  3565 6265 3965 3834 3230 6537 6266 6636  5ebe9e8420e7bff6
	0x0210:  3731 320d 0a58 2d46 6f72 7761 7264 6564  712..X-Forwarded
	0x0220:  2d46 6f72 3a20 3132 372e 302e 302e 310d  -For:.127.0.0.1.
	0x0230:  0a0d 0a
 

inspirix

Active Member
#5
Small update, just FYI and in case anyone ever stumbles upon this problem. Its not a litespeed problem. Its not a mongrel problem. Its a ruby problem. Specifically, its a ruby 1.8.6 problem. rubyonrails.org recommends 1.8.5, however the guide they point to for installation does 1.8.6, and ive seen many OSX port install guides using 1.8.6 (which is what I had done).

So in short, use 1.8.5 :)

Joe
 
Top