500 Error: Synonym file can't be read

With latest ES on OSX Yosemite, Java 1.8.0_91, all process run by the same user, I'm getting a 500 error on index creation, with a message that my synonym file cannot be read due to permissions error:

lee:nodejs lee$ ls -la /Users/lee/src/nodejs/.config/synonyms.txt
-rw-r--r-- 1 lee staff 21 6 Oct 09:15 /Users/lee/src/nodejs/.config/synonyms.txt

[ERROR] { [Error: [index_creation_exception] failed to create index]
status: 500,
displayName: 'InternalServerError',
message: '[index_creation_exception] failed to create index',
path: '/test',
query: {},
body:
{ error:
{ root_cause: [Object],
type: 'access_control_exception',
reason: 'access denied ("java.io.FilePermission" "/Users/lee/src/nodejs/.config/synonyms.txt" "read")' },
status: 500 },
statusCode: 500,
response: '{"error":{"root_cause":[{"type":"index_creation_exception","reason":"failed to create index"}],"type":"access_control_exception","reason":"access denied (\"java.io.FilePermission\" \"/Users/lee/src/nodejs/.config/synonyms.txt\" \"read\")"},"status":500}',
toString: [Function],
toJSON: [Function] }
Error: [index_creation_exception] failed to create index
at respond (/Users/lee/src/nodejs/node_modules/elasticsearch/src/lib/transport.js:289:15)
at checkRespForFailure (/Users/lee/src/nodejs/node_modules/elasticsearch/src/lib/transport.js:248:7)
at HttpConnector. (/Users/lee/src/nodejs/node_modules/elasticsearch/src/lib/connectors/http.js:164:7)
at IncomingMessage.wrapper (/Users/lee/src/nodejs/node_modules/elasticsearch/node_modules/lodash/index.js:3095:19)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:913:12)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17) ' at ElasticGolem. in ../lib/ElasticGolem.js:134'

"reason":"access denied

Since 2.0 (introduction of security manager) it is no longer possible to set custom file path outside CONF_DIR for *_path settings in char or token filters. You must specify either relative path to CONF_DIR location or absolute path inside CONF_DIR location.

1 Like

Thanks! How can I get the docs/guide updated to state that?

Ok I see, it's currently only documented as part of the breaking changes:

Go to the documentation page for the synonym token filter in our Github repo, select the "Edit this file button" and commit the change as "Create a new branch for this commit and start a pull request."

Thank you very much for contributing.

2 Likes

Thank you!