Elasticsearch error about locked files
-
What does this error mean?
Sep 08, 2020 12:09:24.387 AM][WARN ][o.e.i.e.Engine ] [BH-Nz4F] [fusionauth_user][2] failed engine [lucene commit failed] java.nio.file.FileSystemException: [/path/to/elasticsearch/nodes/indices/...]: The process cannot access the file because it is being used by another process. at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) ~[?:?] at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) ~[?:?] at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) ~[?:?] at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(WindowsFileSystemProvider.java:115) ~[?:?] at java.nio.channels.FileChannel.open(FileChannel.java:287) ~[?:1.8.0_171] at java.nio.channels.FileChannel.open(FileChannel.java:335) ~[?:1.8.0_171] at org.apache.lucene.util.IOUtils.fsync(IOUtils.java:471) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24] at org.apache.lucene.store.FSDirectory.fsync(FSDirectory.java:327) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24] at org.apache.lucene.store.FSDirectory.sync(FSDirectory.java:285) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24] at org.apache.lucene.store.FilterDirectory.sync(FilterDirectory.java:83) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24] at org.apache.lucene.store.LockValidatingDirectoryWrapper.sync(LockValidatingDirectoryWrapper.java:68) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24] at org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:4808) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24] at org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:3326) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24] at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:3458) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24] at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3423) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24] at org.elasticsearch.index.engine.InternalEngine.commitIndexWriter(InternalEngine.java:2160) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.index.engine.InternalEngine.flush(InternalEngine.java:1526) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.index.shard.IndexShard.flush(IndexShard.java:1013) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.indices.flush.SyncedFlushService.performPreSyncedFlush(SyncedFlushService.java:473) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.indices.flush.SyncedFlushService.access$1200(SyncedFlushService.java:74) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.indices.flush.SyncedFlushService$PreSyncedFlushTransportHandler.messageReceived(SyncedFlushService.java:783) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.indices.flush.SyncedFlushService$PreSyncedFlushTransportHandler.messageReceived(SyncedFlushService.java:779) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:30) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$1.doRun(SecurityServerTransportInterceptor.java:259) [x-pack-security-6.3.1.jar:6.3.1] at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.messageReceived(SecurityServerTransportInterceptor.java:317) [x-pack-security-6.3.1.jar:6.3.1] at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:66) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.transport.TransportService$7.doRun(TransportService.java:664) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:725) [elasticsearch-6.3.1.jar:6.3.1] at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.3.1.jar:6.3.1] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_171] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_171] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
-
It looks like the ElasticSearch index is locked by a prior process. I'd attempt to see who has a lock on that file, or you could try to restart the elasticsearch service.
net stop FusionAuthSearch
andnet start FusionAuthSearch
should do it.From some googling, this may be a virus scanner, or perhaps some other Windows process may be causing this type of error with Elasticsearch.