goreplay icon indicating copy to clipboard operation
goreplay copied to clipboard

Bad replay response when using tengine as Proxy

Open hankl opened this issue 11 years ago • 5 comments

When I replaying test traffic to production using middleware, the middleware received such replay response: 3 08d6d6e1812c3fd08f6312f928a0287ff14fa3c3 266404715 HTTP/1.1 524 Accepted Date: Mon, 30 Nov 2015 16:57:13 CST Content-Length: 0 Content-Type: text/plain; charset=utf-8

The http status is 524??? and no content.

The correct replay response should be like this: 3 95a93027b930236f797aa94ed4e5c002211bf95f 23985174 HTTP/1.1 200 OK Server: nginx/1.5.6 Date: Mon, 30 Nov 2015 08:57:54 GM Content-Type: application/json;charset=utf-8 Connection: close

{"id":6071895148555575786,"fullname":"aaa","username":null,"email":null,"enterpriseUser":false,"defaultAvatar":true}

Replaying test traffic to test environment is OK.

Could someone help me, how to resolve this problem? Thanks.

hankl avatar Nov 30 '15 09:11 hankl

[DEBUG][PID 27103][1448935292301568533][0.304927ms] [EMITTER] input: 1 5977f98b244305a98f9ac30c7afa5f2422560c18 1448934603007412831 POST /oauth2/token?grant_type=password HTTP/1.0 Host: 127.0.0.1:8800 Connection: close Content-Length: 42 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 Cache-Control: no-cache Origin: chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm Authorization: Basic UTRtOEl2NVFaYmoyYWhhaFl6Mk1wOVJEQ3VXMVdaMEc6ckx1Uno2bDZxWTNOdVhtYk53eHdzUmZMMnh1dWxhVkU= Content- 804 from: Modifying traffic using './middleware.jar' command [DEBUG][PID 27103][1448935292301825305][0.256772ms] [HTTPClient] Connecting: https://account.glodon.com:443 [DEBUG][PID 27103][1448935292461554131][159.728826ms] [HTTPClient] Response read error EOF &{0xc20a564000 true {0 0} 771 true 0xc208001560 true false 49169 [] [0xc20a578000 0xc20a578480 0xc20a578900] [] [245 193 10 108 140 192 120 74 11 117 71 233] false {{0 0} 0xc20802a080 771 0xc20a579200 {0xc20805acc0} [0 0 0 0 0 0 0 3] 0xc208630150 [75 160 113 162 224 229 71 1 8 247 221 187 104 224 244 30 86 230 239 254] []} {{0 0} 771 0xc20a578d80 {0xc20805ac00} [0 0 0 0 0 0 0 2] 0xc2086300f0 [] [181 4 209 224 182 55 218 48 66 35 36 40 229 66 182 89 120 32 50 87]} {[20 0 0 12 23 204 86 171 210 114 105 79 113 207 209 252] 16 [0 0 0 0] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 2} [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]} [DEBUG][PID 27103][1448935292461811120][0.256989ms] Request error: EOF [DEBUG][PID 27103][1448935292461921913][0.110793ms] [OUTPUT-HTTP] Received response: HTTP/1.1 524 Accepted Date: Tue, 01 Dec 2015 10:01:32 CST Content-Length: 0 Content-Type: text/plain; charset=utf-8

hankl avatar Dec 01 '15 02:12 hankl

Do you use smth like cloudflare as proxy server? 524 is custom status invented by CloudFlare saying that timeout occurred https://support.cloudflare.com/hc/en-us/articles/200171926-Error-524-A-timeout-occurred

buger avatar Dec 01 '15 08:12 buger

We used nginx as proxy.
I have set timeout to 30s : ./gor --input-file "account.gor|100%" --output-http "https://account.glodon.com" --middleware "./middleware.jar" --verbose=true --debug=true --output-http-timeout 30s
Still it has this problem.

I have tried curl at the replay server. The response is OK.

This error only occured when replaying to another network environment.

hankl avatar Dec 02 '15 01:12 hankl

This issue is solved. The proxy we used is Tengine (another version of nginx, http://tengine.taobao.org/), not nginx. When changed to nginx, It is OK.

I don't know why it not work with tengine……

hankl avatar Dec 02 '15 05:12 hankl

Interesting, i will try tengine when will have some time.

buger avatar Dec 02 '15 06:12 buger