Reindexing data problem in river porcess

Hi all,

In our test enviroment we have a cluster with three nodes, one master *no *data
node in machine A, and two data nodes (configured as no-master) in machines
B and C.

We have an incremental river process in order to synchronize data from a
data base in ES. The reindexing process does it in two steps:

1- Delete if exists. Find the _id of the record that has been changed and
delete it

2- Add the new record recovered from the data base which has been changed

When this process deletes and tries to reindex, we get the next exception:

[2013-07-30 17:11:07,199][DEBUG][action.search.type ] [ES-NODE1]
[319] Failed to execute query phase

org.elasticsearch.transport.SendRequestTransportException:
[ES-NODE2][inet[/10.136.56.56:9300]][search/phase/query/id]

    at 

org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:199)

    at 

org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:171)

    at 

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:181)

    at 

org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction$AsyncAction.executeQuery(TransportSearchDfsQueryThenFetchAction.java:148)

    at 

org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction$AsyncAction.moveToSecondPhase(TransportSearchDfsQueryThenFetchAction.java:107)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:229)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onResult(TransportSearchTypeAction.java:208)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onResult(TransportSearchTypeAction.java:205)

    at 

org.elasticsearch.search.action.SearchServiceTransportAction$1.handleResponse(SearchServiceTransportAction.java:122)

    at 

org.elasticsearch.search.action.SearchServiceTransportAction$1.handleResponse(SearchServiceTransportAction.java:113)

    at 

org.elasticsearch.transport.netty.MessageChannelHandler.handleResponse(MessageChannelHandler.java:156)

    at 

org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:127)

    at 

org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)

    at 

org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)

    at 

org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)

    at 

org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)

    at 

org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)

    at 

org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)

    at 

org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)

    at 

org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)

    at 

org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)

    at 

org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)

    at 

org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)

    at 

org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)

    at 

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)

    at 

org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)

    at 

org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)

    at 

org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)

    at 

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)

    at 

org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)

    at 

org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)

    at 

java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

    at 

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

    at java.lang.Thread.run(Thread.java:662)

Caused by: java.lang.NullPointerException

    at 

org.elasticsearch.common.io.stream.HandlesStreamOutput.writeString(HandlesStreamOutput.java:55)

    at 

org.elasticsearch.search.dfs.AggregatedDfs.writeTo(AggregatedDfs.java:106)

    at 

org.elasticsearch.search.query.QuerySearchRequest.writeTo(QuerySearchRequest.java:69)

    at 

org.elasticsearch.transport.netty.NettyTransport.sendRequest(NettyTransport.java:546)

    at 

org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:184)

    ... 33 more

Here is the code of the process:

            // idDoc is the field used like _id, especified with: 

            //      "_id": {

            //             "path": "Identifier"

            //      }


            //doc is the map with the record data

String identifier = doc.get(IDENTIFIER);

//Delete if exists

SearchResponse sResponse = client.prepareSearch(this.index)

.setTypes(docType)

.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)

.setQuery(QueryBuilders.termQuery(idDoc, identifier))

.execute().actionGet();

if (sResponse != null) {

Iterator iterator = sResponse.getHits().iterator();

if (iterator.hasNext()) {

SearchHit sh = iterator.next();

DeleteResponse dr = client.prepareDelete(this.index, this.docType,
sh.getId()).execute().actionGet();

}

}

//Add the new doc

client.prepareIndex(this.index, this.docType,
null).setSource(doc).execute().actionGet();

I don´t know what the problem might be. It seems the comunication between
nodes and nothing to do with our implementation.

Any help? Thanks in advance,

Carlos.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

The problem is that you passed a null value to the
client.prepareIndex method for the index. There is a missing guard in
the code, so the error message is somewhat cryptic.

Jörg

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I believe that the null value for the null value of the _id is OK if the
IndexRequest.OpType.CREATE value is also passed to the *
IndexRequestBuilder.setOpType* method? Not sure which is the default OpType
though.

A non-null id is required for an INDEX op type; it's optional for a CREATE
op type.

Brian

On Monday, August 5, 2013 8:26:55 AM UTC-4, Jörg Prante wrote:

The problem is that you passed a null value to the
client.prepareIndex method for the index. There is a missing guard in
the code, so the error message is somewhat cryptic.

Jörg

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.