I had posted this problem on IRC without any resolution in case you sense
deja vu.
Using ES 0.13.0 on Mac OSX.
I have a bootstrap process which inserts documents into a single index
(several different types) as my application initializes. When I set the
index.type to niofs, everything works as expected.
However, when I use index.type = memory, things fail with the following
exception:
13:24:37,458 DEBUG ker #2-1 org.elasticsearch.action.get: 74 -
[Tempest] Index Shard [nep][3]: Failed to get
[activityStreams#537f083e2d2a4bb4a83400dc4890a271]
org.elasticsearch.transport.RemoteTransportException:
[Harpy][inet[/fe80:0:0:0:223:12ff:fe1e:c043%5:9310]][indices/get/shard]
Caused by: java.lang.NullPointerException
at
org.elasticsearch.index.store.memory.ByteBufferFile.numberOfBuffers(ByteBufferFile.java:62)
at
org.elasticsearch.index.store.memory.ByteBufferIndexInput.switchCurrentBuffer(ByteBufferIndexInput.java:92)
at
org.elasticsearch.index.store.memory.ByteBufferIndexInput.seek(ByteBufferIndexInput.java:82)
at org.apache.lucene.index.SegmentTermEnum.seek(SegmentTermEnum.java:114)
at
org.apache.lucene.index.TermInfosReader.seekEnum(TermInfosReader.java:172)
at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:231)
at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179)
at org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:57)
at
org.apache.lucene.index.DirectoryReader$MultiTermDocs.termDocs(DirectoryReader.java:1216)
at
org.apache.lucene.index.DirectoryReader$MultiTermDocs.next(DirectoryReader.java:1148)
at org.elasticsearch.common.lucene.Lucene.docId(Lucene.java:65)
at
org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:90)
at
org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:53)
at
org.elasticsearch.action.support.single.TransportSingleOperationAction$ShardTransportHandler.messageReceived(TransportSingleOperationAction.java:268)
at
org.elasticsearch.action.support.single.TransportSingleOperationAction$ShardTransportHandler.messageReceived(TransportSingleOperationAction.java:261)
at
org.elasticsearch.transport.netty.MessageChannelHandler$3.run(MessageChannelHandler.java:195)
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)
Tracing through the code, I can see where ByteBufferFile.numberOfBuffers is
called, but this.buffers is null! This results in a NPE when the following
function is called.
public class ByteBufferFile {
....
private volatile ByteBuffer[] buffers;
....
int numberOfBuffers() {
return this.buffers.length;
}
....
}
I wish I could create a curl gist to reproduce, but this happens deep in a
large initialization routine.