2021-03-08 16:03:54.665 31274-31274/? W/System.err: okhttp3.internal.http2.StreamResetException: stream was reset: INTERNAL_ERROR
2021-03-08 16:03:54.665 31274-31274/? W/System.err: at okhttp3.internal.http2.Http2Stream$FramingSource.read(Http2Stream.java:384)
2021-03-08 16:03:54.665 31274-31274/? W/System.err: at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
2021-03-08 16:03:54.665 31274-31274/? W/System.err: at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:249)
2021-03-08 16:03:54.665 31274-31274/? W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
2021-03-08 16:03:54.665 31274-31274/? W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
2021-03-08 16:03:54.665 31274-31274/? W/System.err: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
2021-03-08 16:03:54.665 31274-31274/? W/System.err: at okhttp3.RealCall.execute(RealCall.java:81)
2021-03-08 16:03:54.665 31274-31274/? W/System.err: at retrofit2.OkHttpCall.execute(OkHttpCall.java:204)
2021-03-08 16:03:54.666 31274-31274/? W/System.err: okhttp3.internal.http2.StreamResetException: stream was reset: INTERNAL_ERROR
2021-03-08 16:03:54.666 31274-31274/? W/System.err: at okhttp3.internal.http2.Http2Stream$FramingSource.read(Http2Stream.java:384)
2021-03-08 16:03:54.666 31274-31274/? W/System.err: at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
2021-03-08 16:03:54.666 31274-31274/? W/System.err: at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:249)
2021-03-08 16:03:54.666 31274-31274/? W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
2021-03-08 16:03:54.666 31274-31274/? W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
2021-03-08 16:03:54.666 31274-31274/? W/System.err: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
2021-03-08 16:03:54.666 31274-31274/? W/System.err: at okhttp3.RealCall.execute(RealCall.java:81)
2021-03-08 16:03:54.666 31274-31274/? W/System.err: at retrofit2.OkHttpCall.execute(OkHttpCall.java:204)
今天发现okhttp报错了,调用接口发现,后端返回的json数据少了一部分,导致出现上面的问题。经过沟通是nginx反向代理请求响应报文大数据量时的json报文返回不完整。具体参考这个链接:链接