# No Handlers could be found for logger "elasticsearch"

**URL:** <https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117>\
**Category:** Elasticsearch\
**Tags:** curator\
**Created:** [November 1, 2019, 5:46am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117 "2019-11-01T05:46:45Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 1, 2019, 5:46am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/1 "2019-11-01T05:46:45Z")

</div>

I have created a python script to create snapshot on elasticsearch including elasticsearch-curator library. How ever this script worked perfectly more than one year and suddenly I got following error. I tried adding logger code inside my script. But same observed.

How do I resolve this issue ?

```
[root@log-server backup_scripts]# python manual_snap.py

CREATING SNAPSHOT STARTED
No handlers could be found for logger "elasticsearch"
ERROR IN CREATING SNAPSHOT OF elasticindex_2000 
ConnectionError(('Connection aborted.', error(104, 'Connection reset by peer'))) caused by: ProtocolError(('Connection aborted.', error(104, 'Connection reset by peer')))
MANUALLY CREATE SNAPSHOT OF INDICIES ENDED

```

Below is my python script.

```
#!/usr/bin/env python

from elasticsearch import Elasticsearch
import curator

indices_list = [2000, 2001]

for indi in indices_list:

  REPOSITORY = 'index_backup'
  SOURCE = 'creation_date'
  DIRECTION = 'older'
  UNIT = 'days'
  UNIT_COUNT = 10
  INDEX_NAME = 'elasticindex_' + str(indi)

  print "CREATING SNAPSHOT STARTED"

  es = Elasticsearch(['http://192.166.5.1', 'http://192.168.5.2'], port=9200, timeout=3600)

  try:
	ilo = curator.IndexList(es)
	ilo.filter_by_age(source=SOURCE, direction=DIRECTION, unit=UNIT, unit_count=UNIT_COUNT)
	ilo.filter_by_regex(kind='prefix', value=INDEX_NAME)
	snap_indicies = curator.Snapshot(ilo, REPOSITORY, INDEX_NAME, skip_repo_fs_check=True)
	snap_indicies.do_action()

	get_snapshot_state = snap_indicies.get_state()
	if get_snapshot_state == 'SUCCESS':
		print "CREATING SNAPSHOT ENDED"
		print "SUCCESSFULLY CREATE SNAPSHOT OF " + INDEX_NAME
	else:
		print "FAILED TO CREATE SNAPSHOT OF " + INDEX_NAME
  except Exception as snapindicies:
		print "ERROR IN CREATING SNAPSHOT OF " + INDEX_NAME, snapindicies

print "MANUALLY CREATE SNAPSHOT OF INDICIES ENDED \n"
```

---

<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:** [November 1, 2019, 12:13pm UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/2 "2019-11-01T12:13:24Z")

</div>

Not having an actual `logger` means not having insight into what Curator and the Elasticsearch python module are doing—particularly the connection activity. Curator logging also includes timestamps, so you can see how long API calls are taking.

The `ConnectionError` error is therefore harder to diagnose. You are getting:

```auto
ConnectionError(('Connection aborted.', error(104, 'Connection reset by peer'))) caused by: ProtocolError(('Connection aborted.', error(104, 'Connection reset by peer')))

```

Your script is attempting to connect to `192.166.5.1` and `192.168.5.2`. The second IP is non-routable, an internal IP address. The first IP however, is external. I’m going to go out on a limb and suggest that the first IP should read `192.168.5.1` — a `168` instead of the `166`. The error message indicates it cannot connect to `192.166.5.1`, which probably doesn’t have an Elasticsearch instance running on port `9200`.

Additionally, you are including `http` in your hosts, but no port. When including the `http` you should include the port at the end of the line, e.g. `http://192.168.5.2:9200`, and omit the `port=9200` from the client definition.

So, my recommendation is to make the line:

```auto
es = Elasticsearch(['http://192.168.5.1:9200', 'http://192.168.5.2:9200'], timeout=3600)

```

and give it a try with that.

---

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 5, 2019, 3:15am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/3 "2019-11-05T03:15:40Z")

</div>

Due to privacy I have replace my original IP address with private address. There is no issue with the

```
es = Elasticsearch(['http://192.168.5.1:9200', 'http://192.168.5.2:9200'], timeout=3600)

```

In my production environment, both node IP addresses are in same subnet.

---

<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:** [November 5, 2019, 3:35am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/4 "2019-11-05T03:35:01Z")

</div>

So, what happens if you run

```
curl http://w.x.y.z:9200

```

From the same machine where Curator is not running?

---

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 5, 2019, 3:46am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/5 "2019-11-05T03:46:52Z")

</div>

![Image%206](https://us1.discourse-cdn.com/elastic/original/3X/e/c/ecbacb57b43a06352797ac1f437e771db4904504.jpeg)

![Image%207](https://us1.discourse-cdn.com/elastic/original/3X/6/9/69e20993690bd1a6913864fa94f7ae8ad4825a26.jpeg)

See the above output

---

<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:** [November 5, 2019, 4:08am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/6 "2019-11-05T04:08:36Z")

</div>

That looks like a browser. I mean for you to run curl at the console on the machine where you’re trying to run Curator.

---

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 5, 2019, 4:24am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/7 "2019-11-05T04:24:08Z")

</div>

curl output give following result,

curl [http://xxx.xxx.xxx.16:9200](http://xxx.xxx.xxx.16:9200)

Notification: Proxy Authorization Required body { font-family: Arial, Helvetica, sans-serif; font-size: 14px; color:#333333; background-color: #ffffff; } h1 { font-size: 18px; font-weight: bold; text-decoration: none; padding-top: 0px; color: #2970A6; } a:link { color: #2970A6; text-decoration: none; } a:hover { color: #2970A6; text-decoration: underline; } p.buttonlink { margin-bottom: 24px; } .copyright { font-size: 12px; color: #666666; margin: 5px 5px 0px 30px;

}  
.details {  
font-size: 14px;  
color: #969696;  
border: none;  
padding: 20px 20px 20px 20px;  
margin: 0px 10px 10px 35px;  
}

.shadow {  
border: 3px solid #9f9f9f;  
padding: 10px 25px 10px 25px;  
margin: 10px 35px 0px 30px;  
background-color: #ffffff;  
width: 600px;

-moz-box-shadow: 3px 3px 3px #cccccc;  
-webkit-box-shadow: 3px 3px 3px #cccccc;  
box-shadow: 3px 3px 3px #cccccc;  
/\* For IE 8 _/  
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='cccccc')";  
/_ For IE 5.5 - 7 \*/  
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='cccccc');  
}  
.logo {  
border: none;  
margin: 5px 5px 0px 30px;  
}

&nbsp;

# This Page Cannot Be Displayed

Authentication is required to access the Internet using this system. A valid user ID and password must be entered when prompted.

If you have questions, please contact Help Desk Team and provide the codes shown below.

Date: Tue, 05 Nov 2019 09:08:32 +0530  
Username:   
Source IP: xxx.xxx.xxx.14  
URL: GET http://xxx.xxx.xxx.16/  
Category:   
Reason: UNKNOWN  
Notification: PROXY\_AUTH\_REQUIRED

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 5, 2019, 5:32am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/8 "2019-11-05T05:32:12Z")

</div>

A couple of notes that are not directly related to the issue. You are running a very, very old version of Elasticsearch and should look to upgrade. You are also running two different versions in your cluster, which is bad. All nodes in a cluster should always use exactly the same version as indices created on the newer node can not be replicated or moved to the older node.

---

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 5, 2019, 6:27am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/9 "2019-11-05T06:27:16Z")

</div>

At this time, we can't proceed with to upgrade process due to limited resources and convert current indices to newer version.

The only thing is to fix this issue until we migrate the system.

The current python script work without any issue for long time. Two weeks back I got mentioned error suddenly and I tried to fix it. Unfortunately I don't have any idea to find what exact happen.

---

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 5, 2019, 11:26am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/10 "2019-11-05T11:26:24Z")

</div>

I have tried configure and run curator with configuration YML file as well

```
[root@server .curator]# curator --config curator.yml snapshot.yml

```

I got same error log for the same

```
2019-11-05 16:19:36,096 ERROR Failed to complete action: snapshot. <class 'elasticsearch.exceptions.ConnectionError'>: ConnectionError(('Connection aborted.', error(104, 'Connection reset by peer'))) caused by: ProtocolError(('Connection aborted.', error(104, 'Connection reset by peer')))

```

What is this elasticsearch connection exceptions ?

- Connection aborted
- Connection reset by peer

How do I start to trace this connection error to figure out exact issue ?

---

<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:** [November 5, 2019, 12:44pm UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/11 "2019-11-05T12:44:35Z")

</div>

The short answer is that Curator doesn’t fully support proxies, particularly ones requiring authentication. If you were able to run Curator from somewhere that can reach the cluster without needing to go through an authenticated proxy, it should be fine.

---

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 5, 2019, 12:53pm UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/12 "2019-11-05T12:53:17Z")

</div>

@theuntergeek

This server does not use any proxy and the script does not configure to run through proxy

---

<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:** [November 5, 2019, 1:24pm UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/13 "2019-11-05T13:24:20Z")

</div>

That may be. But the response you shared from trying to run curl showed that it was trying to go through a proxy.

Perhaps you need to unset some environment variables?

---

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 5, 2019, 1:45pm UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/14 "2019-11-05T13:45:10Z")

</div>

I have unset all proxy setting if any and restarted. But still I am getting same error !

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/a/ca3e1be20975c523320de38023738597b9e6abf2.png)

---

<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:** [November 5, 2019, 3:07pm UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/15 "2019-11-05T15:07:09Z")

</div>

If you restarted the computer, it probably reset the proxy settings. Trying running `env` and see if the HTTP\_PROXY environment variables are set.

---

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 6, 2019, 9:31am UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/16 "2019-11-06T09:31:04Z")

</div>

Issued env and checked whether proxy environment variables are set. Nothing set for proxies.

---

<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:** [November 6, 2019, 1:20pm UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/17 "2019-11-06T13:20:29Z")

</div>

I’m sorry. I can’t explain what you’re seeing, then. Somehow the connection between your Curator instance and Elasticsearch is being routed through an authenticated proxy. Currently, Curator can only connect directly, or through unauthenticated proxies using environment variables. I can’t troubleshoot beyond what I’ve suggested here so far. You’ll have to involve your IT department and ask what’s going on.

---

<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:** [December 4, 2019, 1:20pm UTC](https://discuss.elastic.co/t/no-handlers-could-be-found-for-logger-elasticsearch/206117/18 "2019-12-04T13:20:34Z")

</div>

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