我们的 consul dashboard(基于 consul ui 源码,新增了权限控制,独立部署)突然出现 504 异常。
打开浏览器调试器的 network,查看异常的请求。
/v1/* 接口,向部署的node应用发送请求,node 应用再将请求通过插件( express-http-proxy )代理转发至 consul server。
很奇怪,其他所有机房都没有问题。而且,多刷几次,偶尔可以正常响应。
服务
这一台机器的 Java 服务报了奇怪的 \n not found: limit=0 content=�~@� 异常。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[ERROR 2021-03-15 20:21:39.114] com...init(ConsulBase.java:58) [[consul] init consul base failed, e=[com.orbitz.consul.ConsulException: Error connecting to Consul at com.orbitz.consul.AgentClient.ping(AgentClient.java:69) at com.orbitz.consul.Consul$Builder.build(Consul.java:708) ... Caused by: java.io.IOException: unexpected end of stream on http://127.0.0.1:8500/... at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:205) at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:105) ... at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184) at okhttp3.RealCall.execute(RealCall.kt:66) at retrofit2.OkHttpCall.execute(OkHttpCall.java:186) at com.orbitz.consul.AgentClient.ping(AgentClient.java:62) ... 14 more Caused by: java.io.EOFException: \n not found: limit=0 content=�~@� at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:231) at okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.kt:210) at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:181) ... 35 more