# ERROR: failed to write index state

**URL:** <https://discuss.elastic.co/t/error-failed-to-write-index-state/90494>\
**Category:** Elasticsearch\
**Created:** [June 22, 2017, 3:50pm UTC](https://discuss.elastic.co/t/error-failed-to-write-index-state/90494 "2017-06-22T15:50:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zak](https://avatars.discourse-cdn.com/v4/letter/z/8e7dd6/32.png) [@zak](https://discuss.elastic.co/u/zak)\
**Post date:** [June 22, 2017, 3:50pm UTC](https://discuss.elastic.co/t/error-failed-to-write-index-state/90494/1 "2017-06-22T15:50:59Z")

</div>

When I want to strat Elasticsearch.  
I had this ERROR:

[2017-06-22 15:12:53,017][WARN][cluster.action.shard] [Living Planet] [dubai-dep][0] received shard failed for [dubai-dep][0], node[iXCi74XGT8-jvaT2nvrkgA], [P], v[7], s[INITIALIZING], a[id=vzdWowPOS96uG-R1kjTlrw], unassigned\_info[[reason=ALLOCATION\_FAILED], at[2017-06-22T15:12:52.894Z], details[failed recovery, failure IndexShardRecoveryException[failed to recovery from gateway]; nested: EngineCreationFailureException[failed to create engine]; nested: AccessDeniedException[/elasticsearch/data/elastic\_stack/elasticsearch-2.0.2/data/zakaria/nodes/0/indices/dubai-dep/0/index/write.lock]; ]], indexUUID [BBKOSi1zQmiTnxPk7ZvpNA], message [failed recovery], failure [IndexShardRecoveryException[failed to recovery from gateway]; nested: EngineCreationFailureException[failed to create engine]; nested: AccessDeniedException[/elasticsearch/data/elastic\_stack/elasticsearch-2.0.2/data/zakaria/nodes/0/indices/dubai-dep/0/index/write.lock]; ]  
[dubai-dep][[dubai-dep][0]] IndexShardRecoveryException[failed to recovery from gateway]; nested: EngineCreationFailureException[failed to create engine]; nested: AccessDeniedException[/elasticsearch/data/elastic\_stack/elasticsearch-2.0.2/data/zakaria/nodes/0/indices/dubai-dep/0/index/write.lock];  
at org.elasticsearch.index.shard.StoreRecoveryService.recoverFromStore(StoreRecoveryService.java:258)  
at org.elasticsearch.index.shard.StoreRecoveryService.access$100(StoreRecoveryService.java:60)  
at org.elasticsearch.index.shard.StoreRecoveryService$1.run(StoreRecoveryService.java:133)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:745)  
Caused by: [dubai-dep][[dubai-dep][0]] EngineCreationFailureException[failed to create engine]; nested: AccessDeniedException[/elasticsearch/data/elastic\_stack/elasticsearch-2.0.2/data/zakaria/nodes/0/indices/dubai-dep/0/index/write.lock];  
at org.elasticsearch.index.engine.InternalEngine.(InternalEngine.java:135)  
at org.elasticsearch.index.engine.InternalEngineFactory.newReadWriteEngine(InternalEngineFactory.java:25)  
at org.elasticsearch.index.shard.IndexShard.newEngine(IndexShard.java:1349)  
at org.elasticsearch.index.shard.IndexShard.createNewEngine(IndexShard.java:1344)  
at org.elasticsearch.index.shard.IndexShard.internalPerformTranslogRecovery(IndexShard.java:889)  
at org.elasticsearch.index.shard.IndexShard.performTranslogRecovery(IndexShard.java:866)  
at org.elasticsearch.index.shard.StoreRecoveryService.recoverFromStore(StoreRecoveryService.java:249)  
... 5 more  
Caused by: java.nio.file.AccessDeniedException: /elasticsearch/data/elastic\_stack/elasticsearch-2.0.2/data/zakaria/nodes/0/indices/dubai-dep/0/index/write.lock  
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)  
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)  
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)  
at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177)  
at java.nio.channels.FileChannel.open(FileChannel.java:287)  
at java.nio.channels.FileChannel.open(FileChannel.java:334)  
at org.apache.lucene.store.NativeFSLockFactory$NativeFSLock.obtain(NativeFSLockFactory.java:137)  
at org.apache.lucene.store.Lock.obtain(Lock.java:77)  
at org.apache.lucene.index.IndexWriter.(IndexWriter.java:780)  
at org.elasticsearch.index.engine.InternalEngine.createWriter(InternalEngine.java:1065)  
at org.elasticsearch.index.engine.InternalEngine.(InternalEngine.java:129)  
... 11 more  
[2017-06-22 15:12:53,022][WARN][gateway] [Living Planet] [twitter]: failed to write index state  
java.nio.file.AccessDeniedException: /elasticsearch/data/elastic\_stack/elasticsearch-2.0.2/data/zakaria/nodes/0/indices/twitter/\_state/state-24.st.tmp  
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)  
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)  
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)  
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)  
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:430)  
at java.nio.file.Files.newOutputStream(Files.java:172)  
at org.elasticsearch.gateway.MetaDataStateFormat.write(MetaDataStateFormat.java:112)  
at org.elasticsearch.gateway.MetaStateService.writeIndex(MetaStateService.java:135)  
at org.elasticsearch.gateway.GatewayMetaState.clusterChanged(GatewayMetaState.java:158)  
at org.elasticsearch.gateway.Gateway.clusterChanged(Gateway.java:185)  
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:494)  
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:225)  
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:188)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:745)

---

<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 20, 2017, 3:51pm UTC](https://discuss.elastic.co/t/error-failed-to-write-index-state/90494/2 "2017-07-20T15:51:14Z")

</div>

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