Security_exception creating snapshot with Python client

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(['','',''],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?

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.

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