Inconsistent ElasticSearchIllegalStateException

Every once in a while I get an error from one of my test cases that I
was hoping someone could shed some light on. I'm sending numerous
index requests to an embedded es 0.15.2 implementation during my test
(while also pulling info out).

Every now and then the source of the index request received by the es
node to index is prefixed by something like:
:slight_smile:
ú‹query_binaryý»{"term":
{"_entityGuid":"wqedaccdneqrrdurwnsvarafteawrfqb"}}û

The full index request is therefore:
:slight_smile:
ú‹query_binaryý»{"term":
{"_entityGuid":"wqedaccdneqrrdurwnsvarafteawrfqb"}}
û{"_entityGuid":"cucbvbswsddrraveabcpsvawtwwsbtru","...}

where everything after the prefix appears to be one of my valid index
requests.

(i extracted the "request" source in
org.elasticsearch.index.mapper.xcontent.ObjectMapper serializeValue
method)

When ES tries to index this request it blows up with:
org.elasticsearch.ElasticSearchIllegalStateException: Can't handle
serializing a dynamic type with content token [VALUE_EMBEDDED_OBJECT]
and field name [query_binary]
at
org.elasticsearch.index.mapper.xcontent.ObjectMapper.serializeValue(ObjectMapper.java:
519)
...
The full error stack trace available at https://gist.github.com/937086.

I do send term queries on that field though so it's not random data,
though it gets added to my index request source in apparent random
fashion. I don't know if this is a potential threading issue or what.
I use the same client for all my requests (queries and index
requests).

Any thoughts on where to begin looking?

Thanks,
Bob

I don't understand what you are doing based on your example. Create a simple test case and we can have a look.
On Friday, April 22, 2011 at 8:18 PM, Bob wrote:

Every once in a while I get an error from one of my test cases that I
was hoping someone could shed some light on. I'm sending numerous
index requests to an embedded es 0.15.2 implementation during my test
(while also pulling info out).

Every now and then the source of the index request received by the es
node to index is prefixed by something like:
:slight_smile:
ú‹query_binaryý»{"term":
{"_entityGuid":"wqedaccdneqrrdurwnsvarafteawrfqb"}}û

The full index request is therefore:
:slight_smile:
ú‹query_binaryý»{"term":
{"_entityGuid":"wqedaccdneqrrdurwnsvarafteawrfqb"}}
û{"_entityGuid":"cucbvbswsddrraveabcpsvawtwwsbtru","...}

where everything after the prefix appears to be one of my valid index
requests.

(i extracted the "request" source in
org.elasticsearch.index.mapper.xcontent.ObjectMapper serializeValue
method)

When ES tries to index this request it blows up with:
org.elasticsearch.ElasticSearchIllegalStateException: Can't handle
serializing a dynamic type with content token [VALUE_EMBEDDED_OBJECT]
and field name [query_binary]
at
org.elasticsearch.index.mapper.xcontent.ObjectMapper.serializeValue(ObjectMapper.java:
519)
...
The full error stack trace available at ElasticSearchIllegalStateException · GitHub.

I do send term queries on that field though so it's not random data,
though it gets added to my index request source in apparent random
fashion. I don't know if this is a potential threading issue or what.
I use the same client for all my requests (queries and index
requests).

Any thoughts on where to begin looking?

Thanks,
Bob

Thanks, Shay. Thinking through it some more I thought maybe it was
similar to an issue I had earlier with the same byte buffer being used
underneath the covers of my IndexRequests. I switched from using a
jsonBuilder to safeJsonBuilder when creating my bulk index requests
and it seems to have solved the problem (at least I haven't seen it
since). I don't exactly see where I'm using it incorrectly, but I must
be somewhere...

Thanks,
Bob

On Apr 22, 12:36 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

I don't understand what you are doing based on your example. Create a simple test case and we can have a look.

On Friday, April 22, 2011 at 8:18 PM, Bob wrote:

Every once in a while I get an error from one of my test cases that I
was hoping someone could shed some light on. I'm sending numerous
index requests to an embedded es 0.15.2 implementation during my test
(while also pulling info out).

Every now and then the source of the index request received by the es
node to index is prefixed by something like:
:slight_smile:
ú‹query_binaryý»{"term":
{"_entityGuid":"wqedaccdneqrrdurwnsvarafteawrfqb"}}û

The full index request is therefore:
:slight_smile:
ú‹query_binaryý»{"term":
{"_entityGuid":"wqedaccdneqrrdurwnsvarafteawrfqb"}}
û{"_entityGuid":"cucbvbswsddrraveabcpsvawtwwsbtru","...}

where everything after the prefix appears to be one of my valid index
requests.

(i extracted the "request" source in
org.elasticsearch.index.mapper.xcontent.ObjectMapper serializeValue
method)

When ES tries to index this request it blows up with:
org.elasticsearch.ElasticSearchIllegalStateException: Can't handle
serializing a dynamic type with content token [VALUE_EMBEDDED_OBJECT]
and field name [query_binary]
at
org.elasticsearch.index.mapper.xcontent.ObjectMapper.serializeValue(ObjectM apper.java:
519)
...
The full error stack trace available athttps://gist.github.com/937086.

I do send term queries on that field though so it's not random data,
though it gets added to my index request source in apparent random
fashion. I don't know if this is a potential threading issue or what.
I use the same client for all my requests (queries and index
requests).

Any thoughts on where to begin looking?

Thanks,
Bob