1

I'm trying to send request from my laravel application to my elasticsearch node to get an index but the application return Elasticsearch \ Common \ Exceptions \ Forbidden403Exception (403)

This is my php code:

$client = ClientBuilder::create()->build();
$params = ['index' =>'$message'];
$response = $client->indices()->getSettings($params);
print_r($response);
2
  • It looks like you don't have sufficient privileges to do your request. Commented Apr 24, 2018 at 9:03
  • You're right @NicolasCami thank you for your response Commented Apr 24, 2018 at 10:03

1 Answer 1

1

This error is raised because you don't have the sufficient privileges to send this request. According to the documentation, you may:

Sign up to request clarification or add additional context in comments.

11 Comments

I disabled the X-pack security in the elasticsearch.yml file but the same issue when I try to send request from my laravel application @Nicolas Cami
Right now I have 2 suggestions: can you try to use the elastic user to perform your request? Can you enable logging and see what shows up?
The return of the log file is when I tried to run my laravel application :elasticsearch_access.log is [2018-04-25T16:12:40,867] [rest] [anonymous_access_denied] origin_address=[127.0.0.1], uri=[/a1ff2535-dbc3-494c-b706-e5ad680e5d02/doc/P10_P3_recv_20170906.log__05%3A02%3A54%3A5182940_5852.10149_DataCmd] This is what I've added to elasticsearch.yml file xpack.security.enabled : true xpack.security.audit.enabled : true
Did you enable the anonymous access?
This is what I've added to elasticsearch.yml file : xpack.security.enabled : true xpack.security.audit.enabled : true xpack.security.authc: anonymous: username: anonymous_user roles: all authz_exception: true
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.