# Bulk indexing with x-pack Exception

**URL:** <https://discuss.elastic.co/t/bulk-indexing-with-x-pack-exception/92086>\
**Category:** Elasticsearch\
**Created:** [July 6, 2017, 11:20am UTC](https://discuss.elastic.co/t/bulk-indexing-with-x-pack-exception/92086 "2017-07-06T11:20:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![franck.lefebure](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franck.lefebure/32/24332_2.png) [@franck.lefebure](https://discuss.elastic.co/u/franck.lefebure)\
**Post date:** [July 6, 2017, 11:20am UTC](https://discuss.elastic.co/t/bulk-indexing-with-x-pack-exception/92086/1 "2017-07-06T11:20:35Z")

</div>

Hi,  
With a 5.4.3 single node cluster and a 5.4.3 java client, last JDK, all centos Linux : I meet the following error when the x-pack is installed on the cluster (with config xpack.security.enabled: false)

```
org.elasticsearch.transport.TransportSerializationException: Failed to deserialize response of type [org.elasticsearch.action.admin.cluster.state.ClusterStateResponse]
        at org.elasticsearch.transport.TcpTransport.handleResponse(TcpTransport.java:1442) ~[elasticsearch-5.4.3.jar:5.4.3]
        at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1414) ~[elasticsearch-5.4.3.jar:5.4.3]
        at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:74) ~[transport-netty4-client-5.4.3.jar:5.4.3]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) ~[netty-codec-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:297) ~[netty-codec-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:413) ~[netty-codec-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) ~[netty-codec-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:544) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458) ~[netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) ~[netty-common-4.1.11.Final.jar:4.1.11.Final]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_131]
Caused by: java.lang.IllegalArgumentException: Unknown NamedWriteable [org.elasticsearch.cluster.metadata.MetaData$Custom][ml]
        at org.elasticsearch.common.io.stream.NamedWriteableRegistry.getReader(NamedWriteableRegistry.java:112) ~[elasticsearch-5.4.3.jar:5.4.3]
        at org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:45) ~[elasticsearch-5.4.3.jar:5.4.3]
        at org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:39) ~[elasticsearch-5.4.3.jar:5.4.3]
        at org.elasticsearch.cluster.metadata.MetaData.readFrom(MetaData.java:675) ~[elasticsearch-5.4.3.jar:5.4.3]
        at org.elasticsearch.cluster.ClusterState.readFrom(ClusterState.java:659) ~[elasticsearch-5.4.3.jar:5.4.3]
        at org.elasticsearch.action.admin.cluster.state.ClusterStateResponse.readFrom(ClusterStateResponse.java:58) ~[elasticsearch-5.4.3.jar:5.4.3]
        at org.elasticsearch.transport.TcpTransport.handleResponse(TcpTransport.java:1439) ~[elasticsearch-5.4.3.jar:5.4.3]
        ... 23 common frames omitted

```

This problem should be related to [Remote Transport Exception in 5.1.1 w/JDK 1.8.0\_111](https://discuss.elastic.co/t/remote-transport-exception-in-5-1-1-w-jdk-1-8-0-111/69607/16)

Franck

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 6, 2017, 3:01pm UTC](https://discuss.elastic.co/t/bulk-indexing-with-x-pack-exception/92086/2 "2017-07-06T15:01:16Z")

</div>

Hey,

can you (for testing purposes) follow the steps to use a `PreBuiltXPackTransportClient` at [https://www.elastic.co/guide/en/x-pack/5.4/java-clients.html#transport-client](https://www.elastic.co/guide/en/x-pack/5.4/java-clients.html#transport-client) and check if that works? I could imagine, that with ML there are some specialties, that need to be taken into account when parsing the cluster state.

--Alex

---

<div class="post-metadata">

**Author:** ![franck.lefebure](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franck.lefebure/32/24332_2.png) [@franck.lefebure](https://discuss.elastic.co/u/franck.lefebure)\
**Post date:** [July 6, 2017, 11:53pm UTC](https://discuss.elastic.co/t/bulk-indexing-with-x-pack-exception/92086/3 "2017-07-06T23:53:20Z")

</div>

Hi Alexander,

With the PreBuiltXPackTransportClient, I don't meet no more the Exception..

So can I have for conclusion that, with the x-pack plugin installed on the server, java client MUST be a PreBuiltXPackTransportClient, in every cases.  
(In my case I just wanted x-pack for the monitoring "a la Marvel" features) ?

Thanks, whatever.

Franck

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 7, 2017, 5:02am UTC](https://discuss.elastic.co/t/bulk-indexing-with-x-pack-exception/92086/4 "2017-07-07T05:02:19Z")

</div>

Very interesting to know. Thanks for opening this thread!

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 7, 2017, 7:01am UTC](https://discuss.elastic.co/t/bulk-indexing-with-x-pack-exception/92086/5 "2017-07-07T07:01:15Z")

</div>

Hey,

you could also try to set `xpack.ml.enabled: false` in the settings that you pass to the TransportClient and see if that solves the issue.

--Alex

---

<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:** [August 4, 2017, 7:01am UTC](https://discuss.elastic.co/t/bulk-indexing-with-x-pack-exception/92086/6 "2017-08-04T07:01:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
