Hello,
As suggested I have enabled server-side trace logging.
Will summarize the issue again:
- I have disabled expensive queries (search.allow_expensive_queries: false) in our Elasticsearch cluster. After this changes :
- If the user has "superuser role" access then only i am able to login.
- Other than superuser, no other users are able to login. Example : I have a user with only viewier (in-built) access. It is giving error in this case
- If I enable expensive queries in our Elasticsearch cluster, then everything is working fine.
Currently, expensive queries are disabled. Below are logs for both the user.
i. User having superuser role
{"username":"kibanauser","roles":["viewer","superuser"],"full_name":"kibanaview","email":"","metadata":{},"enabled":true,"authentication_realm":{"name":"default_native","type":"native"},"lookup_realm":{"name":"default_native","type":"native"},"authentication_type":"realm"}
ii. User with non-superuser role
{"error":{"root_cause":[{"type":"exception","reason":"[prefix] queries cannot be executed when 'search.allow_expensive_queries' is set to false. For optimised prefix queries on text fields please enable [index_prefixes]."}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":".security-7","node":"OfKm4JGPRVeE0hxRjBFO9w","reason":{"type":"query_shard_exception","reason":"failed to create query: [prefix] queries cannot be executed when 'search.allow_expensive_queries' is set to false. For optimised prefix queries on text fields please enable [index_prefixes].","index_uuid":"YS35eNaIQMaSMyhLYObY6Q","index":".security-7","caused_by":{"type":"exception","reason":"[prefix] queries cannot be executed when 'search.allow_expensive_queries' is set to false. For optimised prefix queries on text fields please enable [index_prefixes]."}}}],"caused_by":{"type":"exception","reason":"[prefix] queries cannot be executed when 'search.allow_expensive_queries' is set to false. For optimised prefix queries on text fields please enable [index_prefixes]."}},"status":400}