TypeMissingException

I'm running an embedded 0.16.2 on win7 and Sun 1.6.0_23 using default
storage mechanism. I have it set to use 5 shards with 0 replicas. The index
is created on startup of my application and all index updates are
synchronous (in that I I explicitly wait for the refresh after every index
operation..yes.. i know this is a performance sapper). I also use BulkIndex
operations and a default dynamic template/dynamic mappings so expect a new
type with a default mapping to be created each time a new type is
encountered.

I'm trying to understand a 'TypeMissingException' that I occasionally (but
not always) encounter when starting up my application (which creates the
index and then initializes some data into the index). I index a document and
then turn around and immediately try to search for it. Looking at the
response elastic search provides for my search the SearchResponse shows a
total hit size of 1 (response.getHits().getTotalHits()). However, when I try
to actually get the SearchHit (response.getHits().getHits().getAt(0)) I get
an IndexOutOfBounds error (the searchHit array is empty). So even though the
response says there is a search hit, it doesn't actually return any hits

When I look at the SearchResponse, there is a shard failure with the
exception:
TypeMissingException[[entity_index_] type[abbstrctsapdrsbfbdswvotoqtdpdwer]
missing: failed to find type loaded for doc
[dbcvfdpedbaqrfcfafftbfderetuvqns]]

My intepretation is that this means the shard finds the doc
'dbcvfdpedbaqrfcfafftbfderetuvqns' within the shard, but does not find the
'type' specified in the doc ('abbstrctsapdrsbfbdswvotoqtdpdwer'). How could
this happen since the type should automatically be created?

Also, if I wait for a little bit and rerun the exact same query (have a
breakpoint set at where this error occurrs) i get a result back without any
shard failures which seems to indicate a race condition, but then I
explicitly wait for refresh on all my index operations. I'm obviously
missing something so any help/pointers are appreciated.

Bob

PS - I thought this may be related to
https://github.com/elasticsearch/elasticsearch/issues/931 (fixed in 0.16.2),
but I explicitly create the index on startup, whereas this issue talked
about the index automatically being created when the first document is
received.

Hi,

If you create the index, then all the type information should be broadcasted and parsed on all nodes. The problem you see is that the type is not (yet?) there in the mapping data structure on that node. Is there a chance for a simple recreation (even if it fails every once in a while)? Also, if you have the bandwidth, can you see if it happens with master?

-shay.banon

On Monday, June 27, 2011 at 11:08 PM, Bob Jacoby wrote:

I'm running an embedded 0.16.2 on win7 and Sun 1.6.0_23 using default storage mechanism. I have it set to use 5 shards with 0 replicas. The index is created on startup of my application and all index updates are synchronous (in that I I explicitly wait for the refresh after every index operation..yes.. i know this is a performance sapper). I also use BulkIndex operations and a default dynamic template/dynamic mappings so expect a new type with a default mapping to be created each time a new type is encountered.

I'm trying to understand a 'TypeMissingException' that I occasionally (but not always) encounter when starting up my application (which creates the index and then initializes some data into the index). I index a document and then turn around and immediately try to search for it. Looking at the response Elasticsearch provides for my search the SearchResponse shows a total hit size of 1 (response.getHits().getTotalHits()). However, when I try to actually get the SearchHit (response.getHits().getHits().getAt(0)) I get an IndexOutOfBounds error (the searchHit array is empty). So even though the response says there is a search hit, it doesn't actually return any hits

When I look at the SearchResponse, there is a shard failure with the exception:
TypeMissingException[[entity_index_] type[abbstrctsapdrsbfbdswvotoqtdpdwer] missing: failed to find type loaded for doc [dbcvfdpedbaqrfcfafftbfderetuvqns]]

My intepretation is that this means the shard finds the doc 'dbcvfdpedbaqrfcfafftbfderetuvqns' within the shard, but does not find the 'type' specified in the doc ('abbstrctsapdrsbfbdswvotoqtdpdwer'). How could this happen since the type should automatically be created?

Also, if I wait for a little bit and rerun the exact same query (have a breakpoint set at where this error occurrs) i get a result back without any shard failures which seems to indicate a race condition, but then I explicitly wait for refresh on all my index operations. I'm obviously missing something so any help/pointers are appreciated.

Bob

PS - I thought this may be related to Deleting and recreating a new index with dynamic mapping can cause type failures · Issue #931 · elastic/elasticsearch · GitHub (fixed in 0.16.2), but I explicitly create the index on startup, whereas this issue talked about the index automatically being created when the first document is received.

Hi, Shay. I tried with master and encountered the same error running my
single embedded node.

shard [na], reason [TypeMissingException[[entity_index]
type[abbstrctsapdrsbfbdswvotoqtdpdwer] missing: failed to find type loaded
for doc [refbwcnuwqvqrqwbbaqavuwefveebncb]]]

I'll try and put together a recreation.

Bob

On Mon, Jun 27, 2011 at 4:20 PM, Shay Banon shay.banon@elasticsearch.comwrote:

Hi,

If you create the index, then all the type information should be
broadcasted and parsed on all nodes. The problem you see is that the type is
not (yet?) there in the mapping data structure on that node. Is there a
chance for a simple recreation (even if it fails every once in a while)?
Also, if you have the bandwidth, can you see if it happens with master?

-shay.banon

On Monday, June 27, 2011 at 11:08 PM, Bob Jacoby wrote:

I'm running an embedded 0.16.2 on win7 and Sun 1.6.0_23 using default
storage mechanism. I have it set to use 5 shards with 0 replicas. The index
is created on startup of my application and all index updates are
synchronous (in that I I explicitly wait for the refresh after every index
operation..yes.. i know this is a performance sapper). I also use BulkIndex
operations and a default dynamic template/dynamic mappings so expect a new
type with a default mapping to be created each time a new type is
encountered.

I'm trying to understand a 'TypeMissingException' that I occasionally (but
not always) encounter when starting up my application (which creates the
index and then initializes some data into the index). I index a document and
then turn around and immediately try to search for it. Looking at the
response Elasticsearch provides for my search the SearchResponse shows a
total hit size of 1 (response.getHits().getTotalHits()). However, when I try
to actually get the SearchHit (response.getHits().getHits().getAt(0)) I get
an IndexOutOfBounds error (the searchHit array is empty). So even though the
response says there is a search hit, it doesn't actually return any hits

When I look at the SearchResponse, there is a shard failure with the
exception:
TypeMissingException[[entity_index_] type[abbstrctsapdrsbfbdswvotoqtdpdwer]
missing: failed to find type loaded for doc
[dbcvfdpedbaqrfcfafftbfderetuvqns]]

My intepretation is that this means the shard finds the doc
'dbcvfdpedbaqrfcfafftbfderetuvqns' within the shard, but does not find the
'type' specified in the doc ('abbstrctsapdrsbfbdswvotoqtdpdwer'). How could
this happen since the type should automatically be created?

Also, if I wait for a little bit and rerun the exact same query (have a
breakpoint set at where this error occurrs) i get a result back without any
shard failures which seems to indicate a race condition, but then I
explicitly wait for refresh on all my index operations. I'm obviously
missing something so any help/pointers are appreciated.

Bob

PS - I thought this may be related to
Deleting and recreating a new index with dynamic mapping can cause type failures · Issue #931 · elastic/elasticsearch · GitHub (fixed in
0.16.2), but I explicitly create the index on startup, whereas this issue
talked about the index automatically being created when the first document
is received.