# Intermittent unknown host exception in elasticsearch

**URL:** <https://discuss.elastic.co/t/intermittent-unknown-host-exception-in-elasticsearch/193958>\
**Category:** Elasticsearch\
**Created:** [August 6, 2019, 8:03am UTC](https://discuss.elastic.co/t/intermittent-unknown-host-exception-in-elasticsearch/193958 "2019-08-06T08:03:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vivek\_Vardhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_vardhan/32/49429_2.png) [@Vivek\_Vardhan](https://discuss.elastic.co/u/Vivek_Vardhan)\
**Post date:** [August 6, 2019, 8:03am UTC](https://discuss.elastic.co/t/intermittent-unknown-host-exception-in-elasticsearch/193958/1 "2019-08-06T08:03:14Z")

</div>

Hi Team,

I am getting intermittently, unknown host exception while bulk inserting data in elasticsearch.

```
[INFO] 2019-08-05 07:29:54.859 [pool-4-thread-1] ElasticSearchRestClient - Total Time taken: 1326
[INFO] 2019-08-05 07:29:55.158 [pool-4-thread-2] ElasticSearchRestClient - Total Time taken: 1074

```

These were success messages and suddenly the error started

```
[ERROR] 2019-08-05 07:29:55.418 [pool-4-thread-4] ElasticSearchRestClient - Error in bulkUpdate with Type: java.net.UnknownHostException: xxxxxxxx.southcentralus.cloudapp.azure.com: unknown error
[ERROR] 2019-08-05 07:29:55.418 [pool-4-thread-4] ElasticSearchRestClient - Error in bulkUpdate with Type: java.net.UnknownHostException: xxxxxxxx: unknown error
[ERROR] 2019-08-05 07:29:55.418 [pool-4-thread-4] EsMessageHandler - ES-INGEST-FAILURE	
java.net.UnknownHostException: xxxxxxxx.southcentralus.cloudapp.azure.com: unknown error

at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:1.8.0_77]
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) ~[?:1.8.0_77]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) ~[?:1.8.0_77]
at java.net.InetAddress.getAllByName0(InetAddress.java:1276) ~[?:1.8.0_77]
at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[?:1.8.0_77]
at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[?:1.8.0_77]
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45) ~[httpclient-4.5.3.jar!/:4.5.3]
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112) ~[httpclient-4.5.3.jar!/:4.5.3]
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359) ~[httpclient-4.5.3.jar!/:4.5.3]
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381) ~[httpclient-4.5.3.jar!/:4.5.3]
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237) ~[httpclient-4.5.3.jar!/:4.5.3]
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) ~[httpclient-4.5.3.jar!/:4.5.3]
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.3.jar!/:4.5.3]
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111) ~[httpclient-4.5.3.jar!/:4.5.3]
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[httpclient-4.5.3.jar!/:4.5.3]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) ~[httpclient-4.5.3.jar!/:4.5.3]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) ~[httpclient-4.5.3.jar!/:4.5.3]
at io.searchbox.client.http.JestHttpClient.executeRequest(JestHttpClient.java:136) ~[jest-6.3.0.jar!/:?]
at io.searchbox.client.http.JestHttpClient.execute(JestHttpClient.java:70) ~[jest-6.3.0.jar!/:?]
at io.searchbox.client.http.JestHttpClient.execute(JestHttpClient.java:63) ~[jest-6.3.0.jar!/:?]

```

What can be the reasons for these. my ES cluster is deployed in Azure Kubernetes and in pod logs nothing is there.

The code -

```
try {
Bulk bulk = new Bulk.Builder().defaultIndex(indexName).setHeader("Authorization","Basic xxxxxxxxxxxxxxxxxxxx").defaultType(DEFAULT_DOC_TYPE).addAction(indexDocList).build();
		BulkResult bulkResult = client.execute(bulk);
		if (bulkResult.isSucceeded()) {
			LOG.info("Total Time taken: " + (endTime - startTime));
		} else {
			endTime = System.currentTimeMillis();
			LOG.error("Error in bulk Request: " + bulkResult.getErrorMessage());
			for (BulkResultItem bulkResultItem : bulkResult.getFailedItems()) {
				LOG.error("Error while uploading item " + bulkResultItem.id + " error: " + bulkResultItem.error);
			}
		}
} catch (Exception ex) {
		LOG.error("Total Time taken on failure: " + (endTime - startTime));
		LOG.error("Error in bulkUpdate with Type: " + ex);
	}
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 3, 2019, 8:03am UTC](https://discuss.elastic.co/t/intermittent-unknown-host-exception-in-elasticsearch/193958/2 "2019-09-03T08:03:20Z")

</div>

Closed on September 3, 2019, 8:03am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
