# Security\_exception creating snapshot with Python client

**URL:** <https://discuss.elastic.co/t/security-exception-creating-snapshot-with-python-client/158183>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [November 26, 2018, 12:57pm UTC](https://discuss.elastic.co/t/security-exception-creating-snapshot-with-python-client/158183 "2018-11-26T12:57:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [November 26, 2018, 12:57pm UTC](https://discuss.elastic.co/t/security-exception-creating-snapshot-with-python-client/158183/1 "2018-11-26T12:57:50Z")

</div>

hi all,  
I'm trying to use the Python client to create and manage snapshot on my ELK cluster 5.6.x.  
A lot of time I face this error:

`elasticsearch.exceptions.AuthenticationException: AuthenticationException(401, 'security_exception', 'unable to authenticate user [admin] for REST request [/_nodes/_all/http]')`

here you can see the used command:

`es = Elasticsearch(['node1.dprod.net','node2.dprod.net','node3.dprod.com'],sniff_on_start=True,sniff_on_connection_fail=True,sniffer_timeout=60,http_auth=('admin','xxxxx'), scheme="https", port=9200,ssl_context=context, timeout=600)`

Am I doing something wrong or is there a way to handle this error?

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [December 2, 2018, 11:42pm UTC](https://discuss.elastic.co/t/security-exception-creating-snapshot-with-python-client/158183/2 "2018-12-02T23:42:06Z")

</div>

If you ever receive authentication errors in a client, you need to check the Elasticsearch logs for further details.  
We do not pass the full error details to the client (because it's unauthenticated, so we don't know if it can be trusted) and the only way to understand the underlying cause it to look at the server 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:** [December 30, 2018, 11:42pm UTC](https://discuss.elastic.co/t/security-exception-creating-snapshot-with-python-client/158183/3 "2018-12-30T23:42:11Z")

</div>

Closed on December 30, 2018, 11:42pm UTC

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