java-client icon indicating copy to clipboard operation
java-client copied to clipboard

org.apache.http.impl.execchain.RetryExec : NoHttpResponseException

Open GaneshvrBhat opened this issue 6 years ago • 6 comments

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

GaneshvrBhat avatar Feb 17 '19 04:02 GaneshvrBhat

Please attach the full server log

mykola-mokhnach avatar Feb 17 '19 07:02 mykola-mokhnach

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.

GaneshvrBhat avatar Feb 17 '19 15:02 GaneshvrBhat

Moving to java client

mykola-mokhnach avatar Feb 17 '19 17:02 mykola-mokhnach

Can someone please respond if anybody has thoughts/Ideas on how to fix it?

geetha5 avatar Apr 08 '19 15:04 geetha5

@geetha5 @GaneshvrBhat Can you share sample code and sample app to reproduce this error as I could not reproduce it locally.

SrinivasanTarget avatar Apr 10 '19 03:04 SrinivasanTarget

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;
}

vknayanar avatar Jul 28 '20 20:07 vknayanar