# Elasticsearch-mapper-attachments errors logs

**URL:** https://discuss.elastic.co/t/elasticsearch-mapper-attachments-errors-logs/31390
**Category:** Elasticsearch
**Created:** [September 30, 2015, 9:24am UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-errors-logs/31390 "2015-09-30T09:24:08Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![gregv](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@gregv](https://discuss.elastic.co/u/gregv)
#### Post date: [September 30, 2015, 9:24am UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-errors-logs/31390/1 "2015-09-30T09:24:08Z")

</div>

Hi,

I am testing attachment with elasticsearch-mapper-attachments, a simple job to import document with curl :

i encountered some errors and warn :

[2015-09-29 23:49:53,013][ERROR][org.apache.pdfbox.filter.FlateFilter] FlateFilter: stop reading corrupt stream due to a DataFormatException  
[2015-09-29 23:50:15,416][WARN][org.apache.fontbox.util.FontManager] Font not found: Tahoma  
[2015-09-29 23:53:47,390][WARN][org.apache.pdfbox.pdfparser.BaseParser] Specified stream length 127 is wrong. Fall back to reading stream until 'endstream'.

How can i add in elasticsearch.log, the filename regarding the error ?

Thanks

---

<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 30, 2015, 9:41am UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-errors-logs/31390/2 "2015-09-30T09:41:10Z")

</div>

Elasticsearch mapper attachments is only getting here a BASE64 binary content. It does not know at all that it comes from a file (so a filename) or from a blob within your database or from a URL... Whatever...

So I'm afraid there is no way for doing that.

You should consider doing that on the client. So when you send a file, you know its filename and you can probably read the response from elasticsearch and knows that something goes wrong with file X.

---

<div class="post-metadata">

### Author: ![gregv](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@gregv](https://discuss.elastic.co/u/gregv)
#### Post date: [September 30, 2015, 9:59am UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-errors-logs/31390/3 "2015-09-30T09:59:25Z")

</div>

Hi Dadoonet,

Thanks for your reply, of course i used base64 encoded with an ETL,  
88 262 (44go) documents successfully parsed,indexed on 88 933 files.

When i am checking my client logs the response of curl still : "created":true  
{"\_index":"repo","\_type":"attachment","\_id":"AVAZBfl3Iw8zpJxWbnIQ","\_version":1,"created":true}

Thanks.

---

<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 30, 2015, 10:19am UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-errors-logs/31390/4 "2015-09-30T10:19:40Z")

</div>

Indeed. It's because we ignore errors by default.  
You can change that with [this](https://github.com/elastic/elasticsearch-mapper-attachments#metadata-parsing-error-handling).

---

<div class="post-metadata">

### Author: ![gregv](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@gregv](https://discuss.elastic.co/u/gregv)
#### Post date: [September 30, 2015, 10:39am UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-errors-logs/31390/5 "2015-09-30T10:39:13Z")

</div>

My bad ! Missing this part ! Thanks. Reimporting docs...

---

<div class="post-metadata">

### Author: ![gregv](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@gregv](https://discuss.elastic.co/u/gregv)
#### Post date: [October 1, 2015, 11:21am UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-errors-logs/31390/6 "2015-10-01T11:21:23Z")

</div>

Hi,

I created index with the index.mapping.attachment.ignore\_errors set to false.

{  
"test2" : {  
"settings" : {  
"index" : {  
"index" : {  
"mapping" : {  
"attachment" : {  
"ignore\_errors" : "false",  
"indexed\_chars" : "-1"  
}  
}  
},  
"creation\_date" : "1443609269356",  
"number\_of\_shards" : "1",  
"number\_of\_replicas" : "0",  
"version" : {  
"created" : "1070199"  
},  
"uuid" : "8GM9Ud9yQg6MJJbdSZuTAQ"  
}  
}  
}  
}  
I encountered some errors but all response from elasticsearch are "created":true

[2015-09-30 23:31:00,763][ERROR][org.apache.pdfbox.filter.FlateFilter] FlateFilter: stop reading corrupt stream due to a DataFormatException  
[2015-09-30 23:45:34,565][ERROR][org.apache.pdfbox.filter.FlateFilter] FlateFilter: stop reading corrupt stream due to a DataFormatException

---

<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: [October 1, 2015, 11:40am UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-errors-logs/31390/7 "2015-10-01T11:40:53Z")

</div>

Can you open an issue, ideally with a link to a file we could reuse within a test ?

---

<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:47pm UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-errors-logs/31390/8 "2017-07-05T23:47:13Z")

</div>


