# RuntimeException while parsing doc file

**URL:** <https://discuss.elastic.co/t/runtimeexception-while-parsing-doc-file/168940>\
**Category:** Elasticsearch\
**Created:** [February 19, 2019, 6:43am UTC](https://discuss.elastic.co/t/runtimeexception-while-parsing-doc-file/168940 "2019-02-19T06:43:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kalpana\_Doraisamy](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@Kalpana\_Doraisamy](https://discuss.elastic.co/u/Kalpana_Doraisamy)\
**Post date:** [February 19, 2019, 6:43am UTC](https://discuss.elastic.co/t/runtimeexception-while-parsing-doc-file/168940/1 "2019-02-19T06:43:06Z")

</div>

Hi,

I am getting the following exception when I try the

PUT on kibana with ElasticSearch 6.6.0 with ingest-attachment-6.6.0

{  
"error": {  
"root\_cause": [  
{  
"type": "exception",  
"reason": "java.lang.IllegalArgumentException: ElasticsearchParseException[Error parsing document in field [resumeB64]]; nested: TikaException[Unexpected RuntimeException from org.apache.tika.parser.microsoft.OfficeParser@2db961e1]; nested: ArrayIndexOutOfBoundsException;",  
"header":

{ "processor\_type": "attachment" }

}  
],  
"type": "exception",  
"reason": "java.lang.IllegalArgumentException: ElasticsearchParseException[Error parsing document in field [resumeB64]]; nested: TikaException[Unexpected RuntimeException from org.apache.tika.parser.microsoft.OfficeParser@2db961e1]; nested: ArrayIndexOutOfBoundsException;",  
"caused\_by": {  
"type": "illegal\_argument\_exception",  
"reason": "ElasticsearchParseException[Error parsing document in field [resumeB64]]; nested: TikaException[Unexpected RuntimeException from org.apache.tika.parser.microsoft.OfficeParser@2db961e1]; nested: ArrayIndexOutOfBoundsException;",  
"caused\_by": {  
"type": "parse\_exception",  
"reason": "Error parsing document in field [resumeB64]",  
"caused\_by": {  
"type": "tika\_exception",  
"reason": "Unexpected RuntimeException from org.apache.tika.parser.microsoft.OfficeParser@2db961e1",  
"caused\_by":

{ "type": "array\_index\_out\_of\_bounds\_exception", "reason": null }

}  
}  
},  
"header":

{ "processor\_type": "attachment" }

},  
"status": 500  
}

Following is the exception from Rest client

{ "extendedStackTrace": "org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=exception, reason=java.lang.IllegalArgumentException: ElasticsearchParseException[Error parsing document in field [resumeB64]]; nested: TikaException[Unexpected RuntimeException from org.apache.tika.parser.microsoft.OfficeParser@3731154b]; nested: ArrayIndexOutOfBoundsException;]\n\tat org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177) ~[elasticsearch-6.5.0.jar!/:6.5.0]\n\tat org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1793) ~[elasticsearch-rest-high-level-client-6.5.0.jar!/:6.5.0]\n\tat org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1769) ~[elasticsearch-rest-high-level-client-6.5.0.jar!/:6.5.0]\n\tat org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1606) ~[elasticsearch-rest-high-level-client-6.5.0.jar!/:6.5.0]\n\tat org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1563) ~[elasticsearch-rest-high-level-client-6.5.0.jar!/:6.5.0]\n\tat org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1546) ~[elasticsearch-rest-high-level-client-6.5.0.jar!/:6.5.0]\n\tat ....", "name": "org.elasticsearch.ElasticsearchStatusException" }

Can anyone please help me to resolve this issue. With the limitation in content length I am unable to share the base64 string. I can provide that in mail if it helps in debugging the issue.

---

<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:** [February 19, 2019, 7:07am UTC](https://discuss.elastic.co/t/runtimeexception-while-parsing-doc-file/168940/2 "2019-02-19T07:07:37Z")

</div>

Share the xml file on [gist.github.com](http://gist.github.com).

---

<div class="post-metadata">

**Author:** ![Kalpana\_Doraisamy](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@Kalpana\_Doraisamy](https://discuss.elastic.co/u/Kalpana_Doraisamy)\
**Post date:** [February 19, 2019, 7:22am UTC](https://discuss.elastic.co/t/runtimeexception-while-parsing-doc-file/168940/3 "2019-02-19T07:22:56Z")

</div>

Thanks for assisting. The PUT commands are available here

> **[kdoraisa/es](https://github.com/kdoraisa/es)**
>
> Contribute to kdoraisa/es development by creating an account on GitHub.

---

<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:** [February 19, 2019, 7:40am UTC](https://discuss.elastic.co/t/runtimeexception-while-parsing-doc-file/168940/4 "2019-02-19T07:40:31Z")

</div>

Can you share the original file as well? (Not the BASE64 one).

---

<div class="post-metadata">

**Author:** ![Kalpana\_Doraisamy](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@Kalpana\_Doraisamy](https://discuss.elastic.co/u/Kalpana_Doraisamy)\
**Post date:** [February 20, 2019, 5:15am UTC](https://discuss.elastic.co/t/runtimeexception-while-parsing-doc-file/168940/5 "2019-02-20T05:15:50Z")

</div>

I have shared the html which caused SAXParserException in the same git hub location however the other file I cannot share as it has confidential data.

---

<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:** [February 20, 2019, 2:20pm UTC](https://discuss.elastic.co/t/runtimeexception-while-parsing-doc-file/168940/6 "2019-02-20T14:20:23Z")

</div>

I can reproduce the problem.  
It is still failing on Tika level at it seems that the document is not "valid".

When I add manually `<html>` and `</html>` in your document, it is then possible to parse it.

I'm not sure there is a workaround. May be you can ask on [Tika](https://tika.apache.org/) mailing list?

---

<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:** [March 20, 2019, 2:20pm UTC](https://discuss.elastic.co/t/runtimeexception-while-parsing-doc-file/168940/7 "2019-03-20T14:20:27Z")

</div>

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