# GDAL not able to connect to Elastic Search

**URL:** <https://discuss.elastic.co/t/gdal-not-able-to-connect-to-elastic-search/308601>\
**Category:** Elasticsearch\
**Created:** [June 30, 2022, 3:32pm UTC](https://discuss.elastic.co/t/gdal-not-able-to-connect-to-elastic-search/308601 "2022-06-30T15:32:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Purnima\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/purnima_j/32/107780_2.png) [@Purnima\_J](https://discuss.elastic.co/u/Purnima_J)\
**Post date:** [June 30, 2022, 3:32pm UTC](https://discuss.elastic.co/t/gdal-not-able-to-connect-to-elastic-search/308601/1 "2022-06-30T15:32:18Z")

</div>

I am pretty new to Elasticsearch. I have installed both Elasticsearch and kibana. I am able to connect to Elasticsearch by [https://localhost:9200](https://localhost:9200).

I am trying to ingest geospatial data as mentioned in this blog - [How to ingest geospatial data into Elasticsearch with GDAL | Elastic Blog](https://www.elastic.co/blog/how-to-ingest-geospatial-data-into-elasticsearch-with-gdal)

However for some reason, I am not able to run this command -  
$ogrinfo ES:[http://localhost:9200](http://localhost:9200)

or this command  
$ogrinfo ES:[https://elastic](https://elastic):(my actual password)@localhost.com:9243 (which is for secutiry enabled like mine)  
I also tried -  
$ogrinfo ES:[https://elastic](https://elastic):(my actual password)@localhost.com:9200

For the commands above, GDAL was not able to connect to elasticsearch. Can anyone suggest what is going wrong? or what different I should do for loading the shapefile into Elasticsearch?

Thanks

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [July 1, 2022, 12:17am UTC](https://discuss.elastic.co/t/gdal-not-able-to-connect-to-elastic-search/308601/2 "2022-07-01T00:17:12Z")

</div>

Hi @Purnima_J

Can you share the error from GDAL?

---

<div class="post-metadata">

**Author:** ![Purnima\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/purnima_j/32/107780_2.png) [@Purnima\_J](https://discuss.elastic.co/u/Purnima_J)\
**Post date:** [July 8, 2022, 12:42am UTC](https://discuss.elastic.co/t/gdal-not-able-to-connect-to-elastic-search/308601/3 "2022-07-08T00:42:33Z")

</div>

Hi,

It says “ empty reply from the server” error 1: unable to open existing output datasource “ES:[http://localhost:9200](http://localhost:9200)” and another error that I got was ssl certificate problem! Self signed certificate in certificate chain when I tried to access by ogrinfo ES:[https://local](https://local) host:9200. I had to disable the xsecurity settings in Elasticsearch.yaml config file to connect to ogr as a temporary solution. However, I would like to set up security settings and make this work as permanent solution.

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [July 8, 2022, 1:45pm UTC](https://discuss.elastic.co/t/gdal-not-able-to-connect-to-elastic-search/308601/4 "2022-07-08T13:45:55Z")

</div>

Thanks Purnima,

- Can you tell me which version of Elasticsearch you are using?
- Also, can you tell me which version of GDAL you are using?

> I had to disable the xsecurity settings in Elasticsearch.yaml config file to connect to ogr as a temporary solution.

GDAL can connect to your Elasticsearch instance when security is disabled in Elasticsearch? Do you have a `.netrc` file in your `$HOME` directory?

---

<div class="post-metadata">

**Author:** ![Purnima\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/purnima_j/32/107780_2.png) [@Purnima\_J](https://discuss.elastic.co/u/Purnima_J)\
**Post date:** [July 28, 2022, 3:30pm UTC](https://discuss.elastic.co/t/gdal-not-able-to-connect-to-elastic-search/308601/5 "2022-07-28T15:30:54Z")

</div>

I do not have .netrc file in the home directory!  
I am using elasticsearch version 8.3.0 and GDAL version is GDAL 3.5.0

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [August 1, 2022, 5:22pm UTC](https://discuss.elastic.co/t/gdal-not-able-to-connect-to-elastic-search/308601/6 "2022-08-01T17:22:38Z")

</div>

Could you try running ogrinfo with `--debug ON` and see if there are any helpful errors?

If not, maybe try running with `--config CPL_CURL_VERBOSE ON` and see if there are helpful errors. Warning, this will print **a lot** of logs.

---

<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:** [August 29, 2022, 5:22pm UTC](https://discuss.elastic.co/t/gdal-not-able-to-connect-to-elastic-search/308601/7 "2022-08-29T17:22:58Z")

</div>

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