# Server crashes when posting documents and searching them immediately afterwards

**URL:** https://discuss.elastic.co/t/server-crashes-when-posting-documents-and-searching-them-immediately-afterwards/4963
**Category:** Elasticsearch
**Created:** [July 26, 2011, 8:41am UTC](https://discuss.elastic.co/t/server-crashes-when-posting-documents-and-searching-them-immediately-afterwards/4963 "2011-07-26T08:41:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ajsie](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@ajsie](https://discuss.elastic.co/u/ajsie)
#### Post date: [July 26, 2011, 8:41am UTC](https://discuss.elastic.co/t/server-crashes-when-posting-documents-and-searching-them-immediately-afterwards/4963/1 "2011-07-26T08:41:01Z")

</div>

I have a test that does a bulk post of documents into 3 indices and  
immediately afterwards does a \_search.

It fails due to that the documents are not indexed yet for search and  
the server also crashes:

[2011-07-26 10:38:06,706][INFO][cluster.metadata]  
[Robertson, Robbie] [[apple.com](http://apple.com)] deleting index  
[2011-07-26 10:38:06,774][INFO][cluster.metadata]  
[Robertson, Robbie] [[google.com](http://google.com)] deleting index  
[2011-07-26 10:38:06,929][INFO][cluster.metadata]  
[Robertson, Robbie] [[google.com](http://google.com)] creating index, cause [api], shards  
[5]/[1], mappings []  
[2011-07-26 10:38:07,137][INFO][cluster.metadata]  
[Robertson, Robbie] [[apple.com](http://apple.com)] creating index, cause [api], shards  
[5]/[1], mappings []  
[2011-07-26 10:38:07,985][INFO][cluster.metadata]  
[Robertson, Robbie] [[microsoft.com](http://microsoft.com)] creating index, cause [api],  
shards [5]/[1], mappings []  
[2011-07-26 10:38:08,187][INFO][cluster.metadata]  
[Robertson, Robbie] [[google.com](http://google.com)] update\_mapping [product] (dynamic)  
[2011-07-26 10:38:08,232][INFO][cluster.metadata]  
[Robertson, Robbie] [[apple.com](http://apple.com)] update\_mapping [user] (dynamic)  
[2011-07-26 10:38:08,245][INFO][cluster.metadata]  
[Robertson, Robbie] [[apple.com](http://apple.com)] update\_mapping [product] (dynamic)  
[2011-07-26 10:38:08,252][INFO][cluster.metadata]  
[Robertson, Robbie] [[google.com](http://google.com)] update\_mapping [user] (dynamic)  
[2011-07-26 10:38:08,546][INFO][cluster.metadata]  
[Robertson, Robbie] [[microsoft.com](http://microsoft.com)] update\_mapping [user] (dynamic)  
[2011-07-26 10:38:08,560][INFO][cluster.metadata]  
[Robertson, Robbie] [[microsoft.com](http://microsoft.com)] update\_mapping [product] (dynamic)  
[2011-07-26 10:38:09,126][INFO][cluster.metadata]  
[Robertson, Robbie] [[microsoft.com](http://microsoft.com)] deleting index  
[2011-07-26 10:38:09,139][WARN][index.shard.service]  
[Robertson, Robbie] [[microsoft.com](http://microsoft.com)][3] Failed to perform scheduled  
engine refresh  
org.elasticsearch.index.engine.RefreshFailedEngineException:  
[[microsoft.com](http://microsoft.com)][3] Refresh failed  
at  
org.elasticsearch.index.engine.robin.RobinEngine.refresh(RobinEngine.java:  
762)  
at  
org.elasticsearch.index.shard.service.InternalIndexShard.refresh(InternalIndexShard.java:  
384)  
at org.elasticsearch.index.shard.service.InternalIndexShard  
$EngineRefresher$1.run(InternalIndexShard.java:613)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.runTask(ThreadPoolExecutor.java:886)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:680)  
Caused by: java.io.FileNotFoundException: /Volumes/Private/johnnyluu/  
Documents/Development/third\_party/elasticsearch-0.17.1/data/  
elasticsearch/nodes/0/indices/microsoft.com/3/index/\_0.fnm (No such  
file or directory)  
at java.io.RandomAccessFile.open(Native Method)  
at java.io.RandomAccessFile.(RandomAccessFile.java:216)  
at org.apache.lucene.store.SimpleFSDirectory$SimpleFSIndexInput  
$Descriptor.(SimpleFSDirectory.java:69)  
at org.apache.lucene.store.SimpleFSDirectory  
$SimpleFSIndexInput.(SimpleFSDirectory.java:90)  
at org.apache.lucene.store.NIOFSDirectory  
$NIOFSIndexInput.(NIOFSDirectory.java:91)  
at  
org.apache.lucene.store.NIOFSDirectory.openInput(NIOFSDirectory.java:  
78)  
at org.apache.lucene.store.FSDirectory.openInput(FSDirectory.java:  
345)  
at org.elasticsearch.index.store.support.AbstractStore  
$StoreDirectory.openInput(AbstractStore.java:328)  
at org.apache.lucene.index.FieldInfos.(FieldInfos.java:68)  
at  
org.apache.lucene.index.SegmentCoreReaders.(SegmentCoreReaders.java:  
72)  
at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:114)  
at org.apache.lucene.index.IndexWriter  
$ReaderPool.get(IndexWriter.java:702)  
at org.apache.lucene.index.IndexWriter  
$ReaderPool.getReadOnlyClone(IndexWriter.java:660)  
at  
org.apache.lucene.index.DirectoryReader.(DirectoryReader.java:  
157)  
at  
org.apache.lucene.index.ReadOnlyDirectoryReader.(ReadOnlyDirectoryReader.java:  
38)  
at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:  
459)  
at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:  
407)  
at  
org.apache.lucene.index.DirectoryReader.doReopenFromWriter(DirectoryReader.java:  
414)  
at  
org.apache.lucene.index.DirectoryReader.doReopen(DirectoryReader.java:  
427)  
at  
org.apache.lucene.index.DirectoryReader.reopen(DirectoryReader.java:  
392)  
at  
org.elasticsearch.index.engine.robin.RobinEngine.refresh(RobinEngine.java:  
745)  
... 5 more  
[2011-07-26 10:38:09,161][INFO][cluster.metadata]  
[Robertson, Robbie] [[apple.com](http://apple.com)] deleting index  
[2011-07-26 10:38:09,202][INFO][cluster.metadata]  
[Robertson, Robbie] [[google.com](http://google.com)] deleting index  
[2011-07-26 10:38:09,354][INFO][cluster.metadata]  
[Robertson, Robbie] [[google.com](http://google.com)] creating index, cause [api], shards  
[5]/[1], mappings []  
[2011-07-26 10:38:09,491][INFO][cluster.metadata]  
[Robertson, Robbie] [[apple.com](http://apple.com)] creating index, cause [api], shards  
[5]/[1], mappings []  
[2011-07-26 10:38:09,897][INFO][cluster.metadata]  
[Robertson, Robbie] [[microsoft.com](http://microsoft.com)] creating index, cause [api],  
shards [5]/[1], mappings []

Is this a bug?

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [July 26, 2011, 9:08am UTC](https://discuss.elastic.co/t/server-crashes-when-posting-documents-and-searching-them-immediately-afterwards/4963/2 "2011-07-26T09:08:01Z")

</div>

Few questions:

1. Do the server really crash? As in exits?
2. You delete the index [microsoft.com](http://microsoft.com), and then get the async refresh  
failure (its a scheduled refresh that goes and tries to refresh the index).  
You can safely ignore this failure, though it should not be logged.
3. In elasticsearch, when you index a document, its indexed, but not  
immediately visible for search. By default, there is an async refresh going  
on (happens every 1 second) that refreshes all the changes happened in that  
period and makes it visible for search. The refresh API allows you to do it  
explicitly, though, note, it does come at a cost, so you would not want to  
refresh after every document you index.

-shay.banon

On Tue, Jul 26, 2011 at 11:41 AM, ajsie [johnny.weng.luu@gmail.com](mailto:johnny.weng.luu@gmail.com) wrote:

> I have a test that does a bulk post of documents into 3 indices and  
> immediately afterwards does a \_search.
> 
> It fails due to that the documents are not indexed yet for search and  
> the server also crashes:
> 
> [2011-07-26 10:38:06,706][INFO][cluster.metadata]  
> [Robertson, Robbie] [[apple.com](http://apple.com)] deleting index  
> [2011-07-26 10:38:06,774][INFO][cluster.metadata]  
> [Robertson, Robbie] [[google.com](http://google.com)] deleting index  
> [2011-07-26 10:38:06,929][INFO][cluster.metadata]  
> [Robertson, Robbie] [[google.com](http://google.com)] creating index, cause [api], shards  
> [5]/[1], mappings   
> [2011-07-26 10:38:07,137][INFO][cluster.metadata]  
> [Robertson, Robbie] [[apple.com](http://apple.com)] creating index, cause [api], shards  
> [5]/[1], mappings   
> [2011-07-26 10:38:07,985][INFO][cluster.metadata]  
> [Robertson, Robbie] [[microsoft.com](http://microsoft.com)] creating index, cause [api],  
> shards [5]/[1], mappings   
> [2011-07-26 10:38:08,187][INFO][cluster.metadata]  
> [Robertson, Robbie] [[google.com](http://google.com)] update\_mapping [product] (dynamic)  
> [2011-07-26 10:38:08,232][INFO][cluster.metadata]  
> [Robertson, Robbie] [[apple.com](http://apple.com)] update\_mapping [user] (dynamic)  
> [2011-07-26 10:38:08,245][INFO][cluster.metadata]  
> [Robertson, Robbie] [[apple.com](http://apple.com)] update\_mapping [product] (dynamic)  
> [2011-07-26 10:38:08,252][INFO][cluster.metadata]  
> [Robertson, Robbie] [[google.com](http://google.com)] update\_mapping [user] (dynamic)  
> [2011-07-26 10:38:08,546][INFO][cluster.metadata]  
> [Robertson, Robbie] [[microsoft.com](http://microsoft.com)] update\_mapping [user] (dynamic)  
> [2011-07-26 10:38:08,560][INFO][cluster.metadata]  
> [Robertson, Robbie] [[microsoft.com](http://microsoft.com)] update\_mapping [product] (dynamic)  
> [2011-07-26 10:38:09,126][INFO][cluster.metadata]  
> [Robertson, Robbie] [[microsoft.com](http://microsoft.com)] deleting index  
> [2011-07-26 10:38:09,139][WARN][index.shard.service]  
> [Robertson, Robbie] [[microsoft.com](http://microsoft.com)][3] Failed to perform scheduled  
> engine refresh  
> org.elasticsearch.index.engine.RefreshFailedEngineException:  
> [[microsoft.com](http://microsoft.com)][3] Refresh failed  
> at  
> org.elasticsearch.index.engine.robin.RobinEngine.refresh(RobinEngine.java:  
> 762)  
> at
> 
> org.elasticsearch.index.shard.service.InternalIndexShard.refresh(InternalIndexShard.java:  
> 384)  
> at org.elasticsearch.index.shard.service.InternalIndexShard  
> $EngineRefresher$1.run(InternalIndexShard.java:613)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.runTask(ThreadPoolExecutor.java:886)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:680)  
> Caused by: java.io.FileNotFoundException: /Volumes/Private/johnnyluu/  
> Documents/Development/third\_party/elasticsearch-0.17.1/data/  
> elasticsearch/nodes/0/indices/microsoft.com/3/index/\_0.fnm (No such  
> file or directory)  
> at java.io.RandomAccessFile.open(Native Method)  
> at java.io.RandomAccessFile.(RandomAccessFile.java:216)  
> at org.apache.lucene.store.SimpleFSDirectory$SimpleFSIndexInput  
> $Descriptor.(SimpleFSDirectory.java:69)  
> at org.apache.lucene.store.SimpleFSDirectory  
> $SimpleFSIndexInput.(SimpleFSDirectory.java:90)  
> at org.apache.lucene.store.NIOFSDirectory  
> $NIOFSIndexInput.(NIOFSDirectory.java:91)  
> at  
> org.apache.lucene.store.NIOFSDirectory.openInput(NIOFSDirectory.java:  
> 78)  
> at org.apache.lucene.store.FSDirectory.openInput(FSDirectory.java:  
> 345)  
> at org.elasticsearch.index.store.support.AbstractStore  
> $StoreDirectory.openInput(AbstractStore.java:328)  
> at org.apache.lucene.index.FieldInfos.(FieldInfos.java:68)  
> at  
> org.apache.lucene.index.SegmentCoreReaders.(SegmentCoreReaders.java:  
> 72)  
> at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:114)  
> at org.apache.lucene.index.IndexWriter  
> $ReaderPool.get(IndexWriter.java:702)  
> at org.apache.lucene.index.IndexWriter  
> $ReaderPool.getReadOnlyClone(IndexWriter.java:660)  
> at  
> org.apache.lucene.index.DirectoryReader.(DirectoryReader.java:  
> 157)  
> at
> 
> org.apache.lucene.index.ReadOnlyDirectoryReader.(ReadOnlyDirectoryReader.java:  
> 38)  
> at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:  
> 459)  
> at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:  
> 407)  
> at
> 
> org.apache.lucene.index.DirectoryReader.doReopenFromWriter(DirectoryReader.java:  
> 414)  
> at  
> org.apache.lucene.index.DirectoryReader.doReopen(DirectoryReader.java:  
> 427)  
> at  
> org.apache.lucene.index.DirectoryReader.reopen(DirectoryReader.java:  
> 392)  
> at  
> org.elasticsearch.index.engine.robin.RobinEngine.refresh(RobinEngine.java:  
> 745)  
> ... 5 more  
> [2011-07-26 10:38:09,161][INFO][cluster.metadata]  
> [Robertson, Robbie] [[apple.com](http://apple.com)] deleting index  
> [2011-07-26 10:38:09,202][INFO][cluster.metadata]  
> [Robertson, Robbie] [[google.com](http://google.com)] deleting index  
> [2011-07-26 10:38:09,354][INFO][cluster.metadata]  
> [Robertson, Robbie] [[google.com](http://google.com)] creating index, cause [api], shards  
> [5]/[1], mappings   
> [2011-07-26 10:38:09,491][INFO][cluster.metadata]  
> [Robertson, Robbie] [[apple.com](http://apple.com)] creating index, cause [api], shards  
> [5]/[1], mappings   
> [2011-07-26 10:38:09,897][INFO][cluster.metadata]  
> [Robertson, Robbie] [[microsoft.com](http://microsoft.com)] creating index, cause [api],  
> shards [5]/[1], mappings
> 
> Is this a bug?

---

<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 6, 2017, 3:59am UTC](https://discuss.elastic.co/t/server-crashes-when-posting-documents-and-searching-them-immediately-afterwards/4963/3 "2017-07-06T03:59:22Z")

</div>


