I'm a noob at Elastic Cloud 6.0 and I'm using X-Pack for the first time.
I have been attempting to add some data into a cluster I created on elastic cloud. I created a new user (as I didn't want to use the elastic user for my python client). I created the user and created a role with privileges for the index and assigned it to the user. However, when I attempt to add data into the cluster, I get the following HTTP 401 error:
elasticsearch.exceptions.AuthenticationException: TransportError(401, u'security_exception', u'unable to authenticate user [some_user] for REST request [CLUSTER/INDEX]')
When I attempt the same request with the elastic user, I'm able to add data to my index. What am I missing?
That looks like an authentication error. Either the password for "some_user" is not being sent correctly in your request, or the user doesn't actually exist.
Since it's working for elastic it's probably a configuration problem rather than an actual bug in your code.
Check for typos, and also check that the user really was created in your cloud cluster.
The user that you created in Kibana will be able to use the API.
All I can suggest is to triple check that you have all the names and passwords correct, because that error is saying that you don't.
e.g. Your error message says some_user but your user JSON says some_script. I assume you've redacted those for public posting, but do make sure the username you are using in your code, is exactly the same as the user you created in Kibana.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.