MappingBird / web-application

1 stars 0 forks source link

Sometime got 502 Bad Gateway from POST /image #186

Closed yurenju closed 9 years ago

yurenju commented 9 years ago

I got 502 Bad when trying to reproduce MappingBird/Extension#7, but the weird thing is it can not 100% reproduce when I use curl, but it can 100% reproduce when I follow the steps which mentioned on MappingBird/Extension#7.

here is what I got from curl:

command:

curl 'https://mappingbird.com/api/images' \
  -H 'Origin: chrome-extension://igcfogcbldlglphpecbdgcenpbndfmmc' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Accept-Language: zh-TW,zh;q=0.8,zh-CN;q=0.6,en;q=0.4,ja;q=0.2' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36' \
  -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: */*' -H 'Cookie: csrftoken=AbJ3W0RJ1TrusJ8luIpiGouSAquxurDT; sessionid=cu3vqdy08mdtzgisqfq7f3c2p8rg3oug; _ga=GA1.2.1351899236.1421915112; __uvt=; uvts=25KBHyeVdBLcilTM' \
  -H 'Connection: keep-alive' -H 'sessionid: cu3vqdy08mdtzgisqfq7f3c2p8rg3oug' \
  -H 'X-CSRFToken: AbJ3W0RJ1TrusJ8luIpiGouSAquxurDT' \
  --data 'point=778&url=http%3A%2F%2Fpic.pimg.tw%2Fjulialkpkpk%2F1395590032-2844649526.jpg' --compressed

result:

<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page --> 
Eric0329 commented 9 years ago

I'm tracing the root. I'll keep u posted if any update.

yurenju commented 9 years ago

@Eric0329, Did you find the root cause? I can always reproduce it by adding Eiffel tower to MappingBird

Eric0329 commented 9 years ago

hi @yurenju, please help valid this issue, thx

yurenju commented 9 years ago

502 Bad Gateway is no longer exist but still have issue, I filed another issue #203

Eric0329 commented 9 years ago

this issue is still alive. reopen.

Eric0329 commented 9 years ago

proxy_connect_timeout 50;

Eric0329 commented 9 years ago

client (extension) upload too many image to handle by current server ability.

Eric0329 commented 9 years ago

hi @yurenju, could you please do limit image number (<=5) while customer clicks save?

Eric0329 commented 9 years ago

fixed by extend "proxy_read_timeout" to 50.

nginx config - /etc/nginx/sites-enabled/default i.e. server { listen 443; server_name www.mappingbird.com; ... location @django { ... proxy_read_timeout 50; proxy_pass http://localhost:9001; } }

Eric0329 commented 9 years ago

http://www.ipeen.com.tw/comment/435580 solved