# Malformed UTF-8 and ES problems

**URL:** <https://discuss.elastic.co/t/malformed-utf-8-and-es-problems/20524>\
**Category:** Elasticsearch\
**Created:** [October 31, 2014, 11:18pm UTC](https://discuss.elastic.co/t/malformed-utf-8-and-es-problems/20524 "2014-10-31T23:18:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vince\_2](https://avatars.discourse-cdn.com/v4/letter/v/ea666f/32.png) [@vince\_2](https://discuss.elastic.co/u/vince_2)\
**Post date:** [October 31, 2014, 11:18pm UTC](https://discuss.elastic.co/t/malformed-utf-8-and-es-problems/20524/1 "2014-10-31T23:18:51Z")

</div>

I have an unusual problem. We are using ES 1.3.4 (was using ES 1.0.1) and  
Couchbase 3.0 (was using CB 2.5.1). We accidentally got a malformed UTF-8  
Key into couchbase. Once the Key was in it created an Error in  
elasticsearch. Shown below under "create Error from Elasticsearch".

I then was able to delete the offending key from couchbase, and another  
error now is generated in elasticsearch. It appears that "XDCR" in  
couchbase is attempting to send a "delete" to elasticsearch. I have tried  
to reboot the servers, restart replication with elastaticsearch from  
couchbase and nothing works. The only way I can stop the errors is to  
delete the Database bucket in couchbase and start over. Which would not be  
an option in a production system.

As far as unparable JSON data, that has not created any problems in the  
past, we just got 2 lines of errors and the system moved on. Once we get  
this error, elasticsearch stops replicating new data.

Any Ideas?

_CREATE ERROR FROM ELASTICSEARCH_

[2014-10-30 15:11:55,217][ERROR][transport.couchbase.capi] [Hecate] Unable  
to parse decoded base64 data as JSON, indexing stub for id: [73, 78, 67,  
58, 58, 117, 115, 114, 94, 67, 67, 51, 185, 195, 184, 194, 167, 195, 185,  
194, 132, 195, 184, 194, 185, 195, 184, 194, 170, 195, 185, 194, 138, 195,  
184, 194, 168, 195, 185, 194, 58, 58, 99, 111, 100, 101]

[2014-10-30 15:11:55,217][ERROR][transport.couchbase.capi] [Hecate] Body  
was: 1 Parse error was: org.codehaus.jackson.map.JsonMappingException: Can  
not deserialize instance of java.util.LinkedHashMap out of VALUE\_NUMBER\_INT  
token

at [Source: [B@1ec4378b; line: 1, column: 1]

[2014-10-30 15:12:04,932][INFO][cluster.metadata] [Hecate]  
[hotelserve] update\_mapping [couchbaseDocument] (dynamic)

[2014-10-30 15:12:30,506][WARN][org.eclipse.jetty.servlet.ServletHandler]  
/hotelserve%2f24%3b28ee3b5f5bf24b21a9045cb649a219bd/\_bulk\_docs

java.lang.RuntimeException: indexing error, bulk failed after all retries

```
    at 

```

org.elasticsearch.transport.couchbase.capi.ElasticSearchCAPIBehavior.bulkDocs(ElasticSearchCAPIBehavior.java:381)

```
    at 

```

com.couchbase.capi.servlet.CAPIServlet.handleBulkDocs(CAPIServlet.java:529)

```
    at 

```

com.couchbase.capi.servlet.CAPIServlet.service(CAPIServlet.java:89)

```
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

    at 

```

org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:594)

```
    at 

```

org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:485)

```
    at 

```

org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)

```
    at 

```

org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:486)

```
    at 

```

org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)

```
    at 

```

org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)

```
    at 

```

org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:412)

```
    at 

```

org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)

```
    at 

```

org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)

```
    at 

```

org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)

```
    at 

```

org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)

```
    at org.eclipse.jetty.server.Server.handle(Server.java:351)

    at 

```

org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:451)

```
    at 

```

org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:931)

```
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:857)

    at 

```

org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)

```
    at 

```

org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)

```
    at 

```

org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)

```
    at 

```

org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)

```
    at 

```

org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)

```
    at 

```

org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)

```
    at java.lang.Thread.run(Thread.java:744)

```

_REMOVE ERROR FROM ELASTICSEARCH_

[2014-10-31 16:01:45,622][ERROR][transport.couchbase.capi] [Hecate] Unable  
to parse decoded base64 data as JSON, indexing stub for id: [73, 78, 67,  
58, 58, 117, 115, 114, 94, 67, 67, 51, 185, 195, 184, 194, 167, 195, 185,  
194, 132, 195, 184, 194, 185, 195, 184, 194, 170, 195, 185, 194, 138, 195,  
184, 194, 168, 195, 185, 194, 58, 58, 99, 111, 100, 101]

[2014-10-31 16:01:45,622][ERROR][transport.couchbase.capi] [Hecate] Body  
was: Parse error was: java.io.EOFException: No content to map to Object  
due to end of input

[2014-10-31 16:01:45,622][WARN][org.eclipse.jetty.servlet.ServletHandler] /  
hotelserve%2f24%3b28ee3b5f5bf24b21a9045cb649a219bd/\_bulk\_docs

java.lang.ClassCastException: java.util.ArrayList cannot be cast to  
java.lang.String

```
    at 

```

org.elasticsearch.transport.couchbase.capi.ElasticSearchCAPIBehavior.bulkDocs(ElasticSearchCAPIBehavior.java:306)

```
    at 

```

com.couchbase.capi.servlet.CAPIServlet.handleBulkDocs(CAPIServlet.java:529)

```
    at 

```

com.couchbase.capi.servlet.CAPIServlet.service(CAPIServlet.java:89)

```
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

    at 

```

org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:594)

```
    at 

```

org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:485)

```
    at 

```

org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)

```
    at 

```

org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:486)

```
    at 

```

org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)

```
    at 

```

org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)

```
    at 

```

org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:412)

```
    at 

```

org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)

```
    at 

```

org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)

```
    at 

```

org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)

```
    at 

```

org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)

```
    at org.eclipse.jetty.server.Server.handle(Server.java:351)

    at 

```

org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:451)

```
    at 

```

org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:931)

```
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:857)

    at 

```

org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)

```
    at 

```

org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)

```
    at 

```

org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)

```
    at 

```

org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)

```
    at 

```

org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)

```
    at 

```

org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)

```
    at java.lang.Thread.run(Thread.java:744)

```

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/21c21995-8ce5-4f6f-8170-fde63b923e3d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/21c21995-8ce5-4f6f-8170-fde63b923e3d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:52am UTC](https://discuss.elastic.co/t/malformed-utf-8-and-es-problems/20524/2 "2017-07-06T00:52:43Z")

</div>


