okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL

471 Views Asked by At

We have troubleshooting about below exception. Our environment versions; openjdk version "11.0.18" nginx/1.14.0 com.squareup.okhttp3:okhttp:3.8.0

when we tried our local environment without nginx and classic load balancer, we did not receive any error.

when application running our live environment, sometimes (it is not regular) we got an error, for example, i checked requests, below request counts meaning success, for example 15 request success than got an exception, later 13 requests success, than again error. it is not regular or linear. 15,13,13,11,14,17,30,30,11,2,37,27,6,2,5,21,10,29,13,51.

I found some nginx configurations about proxy_redirect off; proxy_buffering off; and also found some bugs in nginx 1.15 but i did not approved this bug affected 1.14 version.

[email protected] [~] # cat /srv/www/gateway/logs/spring.log |grep '13:52:27.746' -A 30 2023-02-08 13:52:27.746 [https-jsse-nio-32752-exec-16] INFO JavaUtilLogger : [principal : null | request-id : 66420bde-abbe-4e9e-ba89-2a5b6e6390e9] HTTP CALL EXCEPTION: https://sandbox-api.example.com/api/v1/auth/token okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL at okhttp3.internal.http2.Http2Stream$FramingSource.read(Http2Stream.java:384) at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286) at okio.Buffer.writeAll(Buffer.java:1143) at okio.RealBufferedSource.readString(RealBufferedSource.java:203) at okhttp3.ResponseBody.string(ResponseBody.java:182) at common.restclient.HttpClient.doCall(HttpClient.java:92) at common.restclient.HttpClient.call(HttpClient.java:53) at common.restclient.RestClientImpl.postWithoutHeaders(RestClientImpl.java:45) at example.client.exampleClientImpl.login(exampleClientImpl.java:37) at com.dux.gateway.core.adapters.example.example.loginToexample(example.java:74) at com.dux.gateway.core.adapters.example.example.processTransaction(example.java:47) at com.dux.gateway.core.adapters.example.example.processTransaction(example.java:22) at com.dux.gateway.core.TransactionProcessorLoggerDecorator.processTransaction(TransactionProcessorLoggerDecorator.java:26) at com.dux.gateway.core.TransactionProcessorValidatorDecorator.processTransaction(TransactionProcessorValidatorDecorator.java:24) at com.dux.gateway.core.PaymentGateway.execute(PaymentGateway.java:87) at com.dux.gateway.api.controller.TransactionController.createTransaction(TransactionController.java:86) at jdk.internal.reflect.GeneratedMethodAccessor562.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1063) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)

when we tried our local environment without nginx and classic load balancer, we did not receive any error.

when application running our live environment, sometimes (it is not regular) we got an error, for example, i checked requests, below request counts meaning success, for example 15 request success than got an exception, later 13 requests success, than again error. it is not regular or linear. 15,13,13,11,14,17,30,30,11,2,37,27,6,2,5,21,10,29,13,51.

I found some nginx configurations about proxy_redirect off; proxy_buffering off; and also found some bugs in nginx 1.15 but i did not approved this bug affected 1.14 version.

0

There are 0 best solutions below