# PDFBox parser exception

**URL:** <https://discuss.elastic.co/t/pdfbox-parser-exception/29813>\
**Category:** Elasticsearch\
**Created:** [September 22, 2015, 9:40pm UTC](https://discuss.elastic.co/t/pdfbox-parser-exception/29813 "2015-09-22T21:40:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepikaa\_Subramaniam](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@Deepikaa\_Subramaniam](https://discuss.elastic.co/u/Deepikaa_Subramaniam)\
**Post date:** [September 22, 2015, 9:40pm UTC](https://discuss.elastic.co/t/pdfbox-parser-exception/29813/1 "2015-09-22T21:40:23Z")

</div>

Hi,

Parsing an excrypted PDF Document is causing ES to crash after a few attempts. Below is some followup exceptions because of the main cause.  
org.apache.pdfbox.pdfparser.XrefTrailerResolver] Did not found XRef object at specified startxref position 0

Is there a workaround for this. Can we make to avoid such files?

---

<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:** [September 23, 2015, 3:38am UTC](https://discuss.elastic.co/t/pdfbox-parser-exception/29813/2 "2015-09-23T03:38:18Z")

</div>

I think you are using mapper attachments plugin, do you?  
If so, can you open an issue in the project repo and provide details such as:

- version (es and plugin)
- a link to a failing file

We have [a unit test](https://github.com/elastic/elasticsearch-mapper-attachments/blob/master/src/test/java/org/elasticsearch/index/mapper/attachment/test/unit/EncryptedDocMapperTest.java) for that so I'd like to understand what is happening here.

Thanks

---

<div class="post-metadata">

**Author:** ![Deepikaa\_Subramaniam](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@Deepikaa\_Subramaniam](https://discuss.elastic.co/u/Deepikaa_Subramaniam)\
**Post date:** [September 23, 2015, 6:16pm UTC](https://discuss.elastic.co/t/pdfbox-parser-exception/29813/3 "2015-09-23T18:16:34Z")

</div>

yes we are using mapper plugin.

Plugin version is 2.5 and ES version is 1.5.2. For policy reasons I cannot share the customer file with you. Trying to see if I can repro with some corrupt file.

Opened issue - Mapper Plugin crashes ES when corrupt file. Msg Document is encrypted #160

---

<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:** [September 23, 2015, 6:37pm UTC](https://discuss.elastic.co/t/pdfbox-parser-exception/29813/4 "2015-09-23T18:37:51Z")

</div>

I need a file which helps to reproduce.  
Also consider upgrading and test again the same file.

---

<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 5, 2017, 11:48pm UTC](https://discuss.elastic.co/t/pdfbox-parser-exception/29813/5 "2017-07-05T23:48:27Z")

</div>


