java-client
java-client copied to clipboard
org.apache.http.impl.execchain.RetryExec : NoHttpResponseException
The problem
Exception: org.apache.http.impl.execchain.RetryExec execute INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:64451: The target server failed to respond
Above said exception is been thrown after few cases executed. However there are no parallel cases been executed.
Environment
Appium : 1.10.0 java version : 1.8.0_191 Android sdk : 28 node: v11.9.0 uiAutomator2 android emulator
Please attach the full server log
I figured out problem, issue was somehow app is going to background and a icon used to come on foreground. So appium time out was happening after 10min(which was set). But I don't understand why retry(RetryExec execute) is happening every 10min.
Feb 17, 2019 6:45:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:50380: The target server failed to respond Feb 17, 2019 6:45:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: Retrying request to {}->http://0.0.0.0:50380 Feb 17, 2019 6:55:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:50380: The target server failed to respond Feb 17, 2019 6:55:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: Retrying request to {}->http://0.0.0.0:50380 Feb 17, 2019 7:05:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:50380: The target server failed to respond Feb 17, 2019 7:05:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: Retrying request to {}->http://0.0.0.0:50380 Feb 17, 2019 7:25:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:50380: The target server failed to respond Feb 17, 2019 7:25:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: Retrying request to {}->http://0.0.0.0:50380 Feb 17, 2019 7:35:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:50380: The target server failed to respond Feb 17, 2019 7:35:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: Retrying request to {}->http://0.0.0.0:50380 Feb 17, 2019 7:45:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:50380: The target server failed to respond Feb 17, 2019 7:45:17 PM org.apache.http.impl.execchain.RetryExec execute INFO: Retrying request to {}->http://0.0.0.0:50380
!---- ERROR: [02-17-2019 07:55:17 090] Test case :"xyz" got failed... Failure Reason:org.openqa.selenium.WebDriverException: org.apache.http.NoHttpResponseException: 0.0.0.0:50380 failed to respond
And finally after 8 retry control is exiting.
Moving to java client
Can someone please respond if anybody has thoughts/Ideas on how to fix it?
@geetha5 @GaneshvrBhat Can you share sample code and sample app to reproduce this error as I could not reproduce it locally.
We are also seeing same logs (httpclient-4.5.12). Anyone found any solution for this.
int timeOut = 60000 int defaultMaxPerRoute = 50; RestTemplate restTemplate = new RestTemplate(getRequestFactory(timeOut, defaultMaxPerRoute));
private HttpComponentsClientHttpRequestFactory getRequestFactory(int timeout, int defaultMaxPerRoute) { HttpComponentsClientHttpRequestFactory clientHttpRequestFactory = new HttpComponentsClientHttpRequestFactory(); if (timeout > 0) { clientHttpRequestFactory.setConnectTimeout(timeout); clientHttpRequestFactory.setReadTimeout(timeout); } CloseableHttpClient client = HttpClientBuilder.create() .setConnectionManager(poolingConnectionManager(defaultMaxPerRoute)).build(); clientHttpRequestFactory.setHttpClient(client); return clientHttpRequestFactory; }
private PoolingHttpClientConnectionManager poolingConnectionManager(int defaultMaxPerRoute) {
PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager();
poolingConnectionManager.setDefaultMaxPerRoute(defaultMaxPerRoute);
return poolingConnectionManager;
}