mapping.txt FilePermission on ES

I have the same problem as this:

Fresh install, external ES. ES log:
java.security.AccessControlException: access denied (“java.io.FilePermission” “/opt/bitnami/elasticsearch/conf/ja/mapping.txt” “read”)

All plugins available:

analysis-extension 7.6.0 This plugin provides an analysis library.
analysis-fess 7.6.0 FessAnalysis Plugin for Elasticsearch
configsync 7.6.0 ConfigSync plugin syncs up with configuration files in .configsync index.
dataformat 7.6.0 This plugin provides several response formats.
minhash 7.6.0 This plugin provides b-bit minhash algorism.

Did you check if elasticsearch user can access it?

1 Like

Yep. This is a bitnami pre-built ES image on AWS. elasticsearch:elasticsearch is the permissions set on the file.

Sooooo. This is due to needing permissions to the directory within your java.policy file.

Add within the grant section of java.policy within your jvm:

grant {
permission java.io.FilePermission “/yourpath/elasticsearch/config/-”, “read”;
permission java.io.FilePermission “/yourpath/elasticsearch/config/”, “read”;
};

Usually this is found in somewhere like:
… /java/conf/security/java.policy

And restart Elasticsearch.