# Curator failed to connect to local Elasticsearch (on Ubuntu VM)

**URL:** <https://discuss.elastic.co/t/curator-failed-to-connect-to-local-elasticsearch-on-ubuntu-vm/272060>\
**Category:** Elasticsearch\
**Tags:** curator\
**Created:** [May 4, 2021, 10:57am UTC](https://discuss.elastic.co/t/curator-failed-to-connect-to-local-elasticsearch-on-ubuntu-vm/272060 "2021-05-04T10:57:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![111441](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111441/32/83630_2.png) [@111441](https://discuss.elastic.co/u/111441)\
**Post date:** [May 4, 2021, 10:57am UTC](https://discuss.elastic.co/t/curator-failed-to-connect-to-local-elasticsearch-on-ubuntu-vm/272060/1 "2021-05-04T10:57:14Z")

</div>

I have Elasticsearch on Ubuntu VM.  
I installed curator on the hosting windows server and succeeded to connect to elasticsearch, using the VM IP in the config file (and also succeeded to delete indices)  
But when I installed Curator on the Ubuntu VM and try to connect using 127.0.0.1 or the VM IP, it fails.  
I get "HTTP 503 error: ... A communication error occurred: "Operation timed out"... "

My curator config file is the initial ordinary config file from [Configuration File | Curator Reference [5.8] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/configfile.html)

My command line in the Terminal is:  
$ sudo curator --config /curator/curator-config.yml /curator/actions.yml

I can connect to elasticsearch from filefox - when I type [http://127.0.0.1:9200/](http://127.0.0.1:9200/) in the browser I do get elasticsearch JSON response

I can also connect to elastic from the terminal - when I type $ curl 127.0.0.1:9200 I do get elasticsearch JSON response

What might cause the connection failure?

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [May 4, 2021, 2:19pm UTC](https://discuss.elastic.co/t/curator-failed-to-connect-to-local-elasticsearch-on-ubuntu-vm/272060/2 "2021-05-04T14:19:27Z")

</div>

Not sure how your VM is installed or configured, but it seems odd, indeed, that localhost is not working there. Have you tried pointing Curator to the VM IP from within the VM, instead of `127.0.0.1`?

Also, getting a 503 here is a strange response. Curator only logs the responses it receives (it received a 503), so that is whatever Curator is connecting to saying, "we can't process something here, sorry we failed." In other words, if it were Curator's problem, it would be a 4xx error, meaning "Curator made a bad request." A 5xx error, like the 503 you received, implies that the server had a problem. Since you clearly can access the host and port from outside and inside using Curl, something else is going on here. I do not know how VMs networking is handled in Windows, but it certainly sounds strange.

If you set `blacklist: []` and also set `loglevel: debug` in your configuration file, you will receive a lot more logging data. Perhaps something else will show up and help in debugging this.

---

<div class="post-metadata">

**Author:** ![111441](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111441/32/83630_2.png) [@111441](https://discuss.elastic.co/u/111441)\
**Post date:** [May 4, 2021, 2:58pm UTC](https://discuss.elastic.co/t/curator-failed-to-connect-to-local-elasticsearch-on-ubuntu-vm/272060/3 "2021-05-04T14:58:59Z")

</div>

> [@theuntergeek](#):
>
> tried pointing Curator to the VM IP from within the VM, instead of `127.0.0.1`

Yes. It didn't work as well.

> [@theuntergeek](#):
>
> If you set `blacklist: []` and also set `loglevel: debug`

I got a very long log. Here is the interesting part:

```auto
INFO curator.utils get_client:1030 Testing client connectivity
2021-05-04 17:53:20,794 DEBUG urllib3.connectionpool _new_conn:227 Starting new HTTP connection (1): 15.90.78.11:8080
2021-05-04 17:53:20,841 DEBUG urllib3.connectionpool _make_request:452 http://15.90.78.11:8080 "GET http://127.0.0.1:9200/ HTTP/1.1" 301 None
2021-05-04 17:53:20,842 DEBUG urllib3.connectionpool _get_conn:272 Resetting dropped connection: 15.90.78.11
2021-05-04 17:54:36,557 DEBUG urllib3.connectionpool _make_request:452 http://15.90.78.11:8080 "GET http://15.17.232.53 HTTP/1.1" 503 751
2021-05-04 17:54:36,557 WARNING elasticsearch log_request_fail:285 GET http://127.0.0.1:9200/ [status:503 request:75.765s]
2021-05-04 17:54:36,558 DEBUG elasticsearch log_request_fail:302 > None
2021-05-04 17:54:36,558 DEBUG elasticsearch log_request_fail:307 < <HTML><HEAD>
<TITLE>Network Error</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Network Error (tcp_error)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
A communication error occurred: "Operation timed out"
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML>

2021-05-04 17:54:36,558 WARNING elasticsearch _raise_error:320 Undecodable raw error response from server: Expecting value: line 1 column 1 (char 0)
2021-05-04 17:54:36,559 DEBUG urllib3.connectionpool _get_conn:272 Resetting dropped connection: 15.90.78.11
2021-05-04 17:54:36,575 DEBUG urllib3.connectionpool _make_request:452 http://15.90.78.11:8080 "GET http://127.0.0.1:9200/ HTTP/1.1" 301 None
2021-05-04 17:54:36,576 DEBUG urllib3.connectionpool _get_conn:272 Resetting dropped connection: 15.90.78.11

```

I don't understand why it is looking for 15.90.78.11. Is it a normal curator action or i should look for configuration of proxy of some type?

Thank you so much for your help

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [May 4, 2021, 4:41pm UTC](https://discuss.elastic.co/t/curator-failed-to-connect-to-local-elasticsearch-on-ubuntu-vm/272060/4 "2021-05-04T16:41:24Z")

</div>

Do you have a system-level proxy configured? This may be an automatic behavior. Curator won't automatically query a proxy, so I presume this is enforced at the network level, either with the host OS, or the VM itself. It seems an _extremely_ odd thing to do to make a localhost connection reach through a proxy. I do not know a way to work around this, as I do not use VMs in Windows.

---

<div class="post-metadata">

**Author:** ![111441](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111441/32/83630_2.png) [@111441](https://discuss.elastic.co/u/111441)\
**Post date:** [May 5, 2021, 10:56am UTC](https://discuss.elastic.co/t/curator-failed-to-connect-to-local-elasticsearch-on-ubuntu-vm/272060/5 "2021-05-05T10:56:23Z")

</div>

Thanks to your help and some additional digging, I found the solution.  
I will write it here, maybe it will help someone in the future:

My proxy configuration on the VM does point to 15.90.78.11  
But the localhost and VM IP are in the NO\_PROXY list:

```auto
NO_PROXY=15.17.232.53,localhost,127.0.0.1,127.0.0.0/8,::1
HTTPS_PROXY=http://15.90.78.11:8080/
HTTP_PROXY=http://15.90.78.11:8080/

```

So, I expected curator to ignore the proxy for 127.0.0.1 or the VM IP, but it didn't.  
Since it is Ubuntu, I thought it might be related to case sensitivity, so I added another environment variable:

```auto
no_proxy=15.17.232.53,localhost,127.0.0.1,127.0.0.0/8,::1

```

(now I have both NO\_PROXY and no\_proxy)  
And Curator is working as expected!

---

<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:** [June 2, 2021, 10:56am UTC](https://discuss.elastic.co/t/curator-failed-to-connect-to-local-elasticsearch-on-ubuntu-vm/272060/6 "2021-06-02T10:56:34Z")

</div>

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