# Access Denied Exception

**URL:** <https://discuss.elastic.co/t/access-denied-exception/114954>\
**Category:** Elasticsearch\
**Created:** [January 10, 2018, 8:24pm UTC](https://discuss.elastic.co/t/access-denied-exception/114954 "2018-01-10T20:24:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![satyan](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@satyan](https://discuss.elastic.co/u/satyan)\
**Post date:** [January 10, 2018, 8:24pm UTC](https://discuss.elastic.co/t/access-denied-exception/114954/1 "2018-01-10T20:24:23Z")

</div>

Hi,

I am using elasticsearch 6.1.1. When I create an index, it is moving to red state in a few seconds and I can see the below error in the log files,

I have given complete permission to the elasticsearch folder.

Also, it is trying to access "...index\_5\_Lucene50\_0.doc" file and this is not present in the particular folder.

Please help me out to resolve this issue.

[2018-01-11T01:38:24,298][WARN][o.e.i.e.Engine] [WO9G3Gz] [loginfo\_2018.01.11][0] failed engine [lucene commit failed]  
java.nio.file.AccessDeniedException: D:\IApps\elasticsearch\data\nodes\0\indices\UYGOMM6xTHOstydu6Wa3kg\0\index\_5\_Lucene50\_0.doc  
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83) ~[?:?]  
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) ~[?:?]  
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) ~[?:?]  
at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230) ~[?:?]  
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434) ~[?:1.8.0\_51]  
at java.nio.file.Files.newOutputStream(Files.java:216) ~[?:1.8.0\_51]  
at org.apache.lucene.store.FSDirectory$FSIndexOutput.(FSDirectory.java:413) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.store.FSDirectory$FSIndexOutput.(FSDirectory.java:409) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.store.FSDirectory.createOutput(FSDirectory.java:253) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.store.FilterDirectory.createOutput(FilterDirectory.java:73) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.store.LockValidatingDirectoryWrapper.createOutput(LockValidatingDirectoryWrapper.java:44) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.store.TrackingDirectoryWrapper.createOutput(TrackingDirectoryWrapper.java:43) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.codecs.lucene50.Lucene50PostingsWriter.(Lucene50PostingsWriter.java:105) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.codecs.lucene50.Lucene50PostingsFormat.fieldsConsumer(Lucene50PostingsFormat.java:423) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.codecs.perfield.PerFieldPostingsFormat$FieldsWriter.write(PerFieldPostingsFormat.java:138) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.index.FreqProxTermsWriter.flush(FreqProxTermsWriter.java:108) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.index.DefaultIndexingChain.flush(DefaultIndexingChain.java:162) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.index.DocumentsWriterPerThread.flush(DocumentsWriterPerThread.java:451) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.index.DocumentsWriter.doFlush(DocumentsWriter.java:542) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.index.DocumentsWriter.flushAllThreads(DocumentsWriter.java:658) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:3201) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:3413) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3378) ~[lucene-core-7.1.0.jar:7.1.0 84c90ad2c0218156c840e19a64d72b8a38550659 - ubuntu - 2017-10-13 16:12:42]  
at org.elasticsearch.index.engine.InternalEngine.commitIndexWriter(InternalEngine.java:2085) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.engine.InternalEngine.commitIndexWriter(InternalEngine.java:2078) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.engine.InternalEngine.flush(InternalEngine.java:1465) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.engine.InternalEngine.recoverFromTranslogInternal(InternalEngine.java:429) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.engine.InternalEngine.recoverFromTranslog(InternalEngine.java:397) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.engine.InternalEngine.recoverFromTranslog(InternalEngine.java:99) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.shard.IndexShard.internalPerformTranslogRecovery(IndexShard.java:1341) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.shard.IndexShard.performTranslogRecovery(IndexShard.java:1295) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.shard.StoreRecovery.internalRecoverFromStore(StoreRecovery.java:395) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.shard.StoreRecovery.lambda$recoverFromStore$0(StoreRecovery.java:94) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.shard.StoreRecovery$$Lambda$1628/737996248.run(Unknown Source) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.shard.StoreRecovery.executeRecovery(StoreRecovery.java:292) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.shard.StoreRecovery.recoverFromStore(StoreRecovery.java:92) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.shard.IndexShard.recoverFromStore(IndexShard.java:1577) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.shard.IndexShard.lambda$startRecovery$6(IndexShard.java:2015) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.index.shard.IndexShard$$Lambda$1627/1369766730.run(Unknown Source) [elasticsearch-6.1.1.jar:6.1.1]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:568) [elasticsearch-6.1.1.jar:6.1.1]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0\_51]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0\_51]

---

<div class="post-metadata">

**Author:** ![jakommo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakommo/32/6716_2.png) [@jakommo](https://discuss.elastic.co/u/jakommo)\
**Post date:** [January 19, 2018, 4:39pm UTC](https://discuss.elastic.co/t/access-denied-exception/114954/2 "2018-01-19T16:39:53Z")

</div>

Hi @satyan

> [@satyan](#):
>
> java.nio.file.AccessDeniedException:

It looks like the Elasticsearch process has insufficient permissions on this folder. My first recommendation is to make sure it has full access to what you provide as a data directory.  
It might also be worth checking if some kind of AV software is blocking writes.

---

<div class="post-metadata">

**Author:** ![satyan](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@satyan](https://discuss.elastic.co/u/satyan)\
**Post date:** [January 20, 2018, 11:53am UTC](https://discuss.elastic.co/t/access-denied-exception/114954/3 "2018-01-20T11:53:18Z")

</div>

Hi jakommo,

Thanks for replying.

I have already given complete permissions for everyone,SYSTEM and LOCAL SERVICE accounts to the data folder,.

Also this issue occurs only if I run elasticsearch as a service, otherwise if I run it as a normal process through the bat file, this issue does not occur.

My logon account is part of the domain admin group and the local machine's admin group and it has complete permissions.

---

<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:** [February 17, 2018, 11:53am UTC](https://discuss.elastic.co/t/access-denied-exception/114954/4 "2018-02-17T11:53:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
