# 500 Error: Synonym file can't be read

**URL:** <https://discuss.elastic.co/t/500-error-synonym-file-cant-be-read/62345>\
**Category:** Elasticsearch\
**Created:** [October 6, 2016, 7:49am UTC](https://discuss.elastic.co/t/500-error-synonym-file-cant-be-read/62345 "2016-10-06T07:49:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee\_Gee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lee_gee/32/1217_2.png) [@Lee\_Gee](https://discuss.elastic.co/u/Lee_Gee)\
**Post date:** [October 6, 2016, 7:49am UTC](https://discuss.elastic.co/t/500-error-synonym-file-cant-be-read/62345/1 "2016-10-06T07:49:30Z")

</div>

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'

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [October 6, 2016, 8:12am UTC](https://discuss.elastic.co/t/500-error-synonym-file-cant-be-read/62345/2 "2016-10-06T08:12:33Z")

</div>

`"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.

---

<div class="post-metadata">

**Author:** ![Lee\_Gee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lee_gee/32/1217_2.png) [@Lee\_Gee](https://discuss.elastic.co/u/Lee_Gee)\
**Post date:** [October 6, 2016, 9:09am UTC](https://discuss.elastic.co/t/500-error-synonym-file-cant-be-read/62345/3 "2016-10-06T09:09:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [October 6, 2016, 9:17am UTC](https://discuss.elastic.co/t/500-error-synonym-file-cant-be-read/62345/4 "2016-10-06T09:17:45Z")

</div>

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

> **[Setting changes | Elasticsearch Guide \[2.4\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/breaking_20_setting_changes.html#_custom_analysis_file_paths)**

> [@Lee\_Gee](#):
>
> Thanks! How can I get the docs/guide updated to state that?

Go to the [documentation page for the synonym token filter](https://github.com/elastic/elasticsearch/blob/master/docs/reference/analysis/tokenfilters/synonym-tokenfilter.asciidoc) 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.

---

<div class="post-metadata">

**Author:** ![Lee\_Gee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lee_gee/32/1217_2.png) [@Lee\_Gee](https://discuss.elastic.co/u/Lee_Gee)\
**Post date:** [October 19, 2016, 10:37am UTC](https://discuss.elastic.co/t/500-error-synonym-file-cant-be-read/62345/5 "2016-10-19T10:37:13Z")

</div>

> <https://github.com/elastic/elasticsearch/pull/21015>

Thank _you!_

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:11pm UTC](https://discuss.elastic.co/t/500-error-synonym-file-cant-be-read/62345/6 "2017-07-05T22:11:19Z")

</div>


