dousi2029 2018-12-27 20:37
浏览 112

在Heroku上偶尔出现“ http:代理错误:读取tcp:I / O超时” [关闭]

I'm getting this error sporadically on Heroku:

Proxy service:

Dec 27 14:53:05 betalo-turnpike-production app/web.2:  { [...] } 

Dec 27 14:53:08 my-proxy app/web.2:  {
    "level":"error",
    "ts":"2018-12-27T14:53:07.771Z",
    "caller":"httputil/reverseproxy.go:393","msg":"http: proxy error: read tcp [REDACTED]->[REDACTED]: i/o timeout",
    "stacktrace":"log.(*Logger).Output

    /app/tmp/cache/go1.11.4/go/src/log/log.go:172
log.(*Logger).Printf
    /app/tmp/cache/go1.11.4/go/src/log/log.go:179
net/http/httputil.(*ReverseProxy).logf
    /app/tmp/cache/go1.11.4/go/src/net/http/httputil/reverseproxy.go:393
net/http/httputil.(*ReverseProxy).defaultErrorHandler
    /app/tmp/cache/go1.11.4/go/src/net/http/httputil/reverseproxy.go:158
net/http/httputil.(*ReverseProxy).defaultErrorHandler-fm
    /app/tmp/cache/go1.11.4/go/src/net/http/httputil/reverseproxy.go:166
net/http/httputil.(*ReverseProxy).ServeHTTP
    /app/tmp/cache/go1.11.4/go/src/net/http/httputil/reverseproxy.go:234
net/http/httputil.(*ReverseProxy).ServeHTTP-fm
    [...]
net/http.HandlerFunc.ServeHTTP
    /app/tmp/cache/go1.11.4/go/src/net/http/server.go:1964
net/http.serverHandler.ServeHTTP
    /app/tmp/cache/go1.11.4/go/src/net/http/server.go:2741
net/http.(*conn).serve
    /app/tmp/cache/go1.11.4/go/src/net/http/server.go:1847"} 

Dec 27 14:53:08 my-proxy app/web.2:  { [...] "status":502} 

Dec 27 14:53:09 my-proxy heroku/router:  sock=backend at=error code=H18 desc="Server Request Interrupted" [...] dyno=web.2 connect=0ms service=4453ms status=503 protocol=https 

Called service:

Dec 27 14:53:05 my-service app/web.1:  { [...] } 
Dec 27 14:53:08 my-service app/web.1:  { [...] "status":400} 
Dec 27 14:53:08 my-service heroku/router:  sock=client at=warning code=H27 desc="Client Request Interrupted" [...] dyno=web.1 connect=1ms service=2995ms status=499 bytes=0 protocol=https 

Anyone knows what is wrong?

  • 写回答

1条回答 默认 最新

  • dongshi1207 2018-12-27 22:12
    关注

    externally, my proxy returns 502 (upstream gone away) my proxy talks to my service which returns 400 (client error) the router layer returns 499 (client closed request)

    what is happening is that the external caller is dropping the connection while the "my service" is preparing a result to go back on the connection to "my proxy". This means that the socket drops from the "my proxy" side.

    The router at the my service side logs a 499 and so the app logs a 400

    There is nothing wrong with your code. The external clients using your web service are dropping their connections early and this is how the application responds in logs

    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?