# Curl works but Hive can't connect to ES

**URL:** <https://discuss.elastic.co/t/curl-works-but-hive-cant-connect-to-es/186760>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [June 20, 2019, 8:20pm UTC](https://discuss.elastic.co/t/curl-works-but-hive-cant-connect-to-es/186760 "2019-06-20T20:20:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_Felgueiras](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_felgueiras/32/48474_2.png) [@A\_Felgueiras](https://discuss.elastic.co/u/A_Felgueiras)\
**Post date:** [June 20, 2019, 8:20pm UTC](https://discuss.elastic.co/t/curl-works-but-hive-cant-connect-to-es/186760/1 "2019-06-20T20:20:26Z")

</div>

Hi,

From an Hadoop cluster I can request my index using curl, like this : `curl -u user:pwd -X GET http://mynode:9020/myindex`, it works,

but when I try to request using Hive (Beeline) I have the famous exception " **Cannot detect ES version**".

My external table has been created using ES handler like this :

> CREATE EXTERNAL TABLE json (data STRING)  
> STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'  
> TBLPROPERTIES('es.resource' = 'myindex', 'es.input.json` = 'yes', 'es.nodes' = 'XXXX', 'es.port' = '9020');

and a select request on this table returns the ES version error.

My ES instance and Hive instance are on the same LAN, ping, telnet and curl are ok. I tried to set 'es.nodes.wan.only' to true but same result. In verbose mode on Beeline there is nothing more I can use to resolve this, only a " **org.elasticsearch.hadoop.rest.EsHadoopInvalidRequest: null**".

Thanks for your help

---

<div class="post-metadata">

**Author:** ![A\_Felgueiras](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_felgueiras/32/48474_2.png) [@A\_Felgueiras](https://discuss.elastic.co/u/A_Felgueiras)\
**Post date:** [June 24, 2019, 1:51am UTC](https://discuss.elastic.co/t/curl-works-but-hive-cant-connect-to-es/186760/2 "2019-06-24T01:51:22Z")

</div>

Adding monitor role to Elastic user we use on Hive and permission on slash resolved this error. It seems at the end that the user has to have this role at least to detect ES version.

---

<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:** [July 22, 2019, 1:51am UTC](https://discuss.elastic.co/t/curl-works-but-hive-cant-connect-to-es/186760/3 "2019-07-22T01:51:24Z")

</div>

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