# Mapper-attachments-2.3.3 MapperParsingException\[No content is provided.\]

**URL:** <https://discuss.elastic.co/t/mapper-attachments-2-3-3-mapperparsingexception-no-content-is-provided/59962>\
**Category:** Elasticsearch\
**Created:** [September 7, 2016, 10:03am UTC](https://discuss.elastic.co/t/mapper-attachments-2-3-3-mapperparsingexception-no-content-is-provided/59962 "2016-09-07T10:03:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnSoTo](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@AnSoTo](https://discuss.elastic.co/u/AnSoTo)\
**Post date:** [September 7, 2016, 10:03am UTC](https://discuss.elastic.co/t/mapper-attachments-2-3-3-mapperparsingexception-no-content-is-provided/59962/1 "2016-09-07T10:03:08Z")

</div>

Hello everyone,

I have an error I don't succeed to solve...

I put a mapping file that looks like this :  
{  
"article" : {  
"properties" : {  
"title" : {"type" : "string"},  
"articleId" : {"type" : "string"},  
"articleStatus" : {"type" : "string", "index" : "not\_analyzed"},  
"url" : {"type" : "string", "index" : "not\_analyzed"},  
"serviceLine" : {"type" : "string"},  
"servicePackage" : {"type" : "string"},  
"applicationName" : {"type" : "string"},  
"articleType" : {"type" : "string", "index" : "not\_analyzed"},  
"level" : {"type" : "integer"},  
"updateDate" : {"type" : "string", "index" : "not\_analyzed"},  
"version" : {"type" : "string", "index" : "not\_analyzed"},  
"file": {  
"type": "attachment",  
"fields": {  
"content" : { "store" : "yes" },  
"author" : { "store" : "yes" },  
"title" : { "store" : "yes", "analyzer" : "english"},  
"date" : { "store" : "yes" },  
"keywords" : { "store" : "yes", "analyzer" : "keyword" },  
"name" : { "store" : "yes" },  
"content\_type" : { "store" : "yes"},  
"content\_length" : { "store" : "yes"}  
}  
}  
}  
}  
}

And when I try to index an article that looks like this :  
{  
"title" : "Can I fill in free text in the resolution tags?- Semaphore",  
"articleId" : "121067",  
"articleStatus" : "Published",  
"url" : "C:\Users\NG5F7F2\tests\[selfservice]-TESTTOINSERT.html",  
"serviceLine" : "IN\_Workplace",  
"servicePackage" : "Service Desk",  
"applicationName" : "SEMAPHORE -REMEDY SUPPORT",  
"articleType" : "How Do I",  
"level" : 1,  
"updateDate" : "2016-09-07T11:57:21",  
"version" : "1.0",  
"file" : {  
"title":"Can I fill in free text in the resolution tags?- Semaphore",  
"author":"System Account",  
"name":"can-i-fill-in-free-text-in-the-resolution-tags--semaphore.html",  
"content\_type":"text/html",  
"date":"2016-09-07T11:57:21",  
"content":"Z2dnZ2dnZ2dnZ2dnZ2dnZ2c=",  
"keywords":"SeMaPHORE, MARS, Incident, Problem, Change, Asset, Remedy, BMC",  
"content\_length":"1213"  
}  
}

I get this error :  
MapperParsingException[No content is provided.]  
at org.elasticsearch.mapper.attachments.AttachmentMapper.parse(AttachmentMapper.java:468)  
at org.elasticsearch.index.mapper.DocumentParser.parseObjectOrField(DocumentParser.java:309)  
at org.elasticsearch.index.mapper.DocumentParser.parseObject(DocumentParser.java:326)  
at org.elasticsearch.index.mapper.DocumentParser.parseObject(DocumentParser.java:252)  
at org.elasticsearch.index.mapper.DocumentParser.parseDocument(DocumentParser.java:122)  
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:309)  
at org.elasticsearch.index.shard.IndexShard.prepareIndex(IndexShard.java:580)  
at org.elasticsearch.index.shard.IndexShard.prepareIndexOnPrimary(IndexShard.java:559)  
at org.elasticsearch.action.index.TransportIndexAction.prepareIndexOperationOnPrimary(TransportIndexAction.java:212)  
at org.elasticsearch.action.index.TransportIndexAction.executeIndexRequestOnPrimary(TransportIndexAction.java:224)  
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:158)  
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:66)  
at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryPhase.doRun(TransportReplicationAction.java:639)  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)  
at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryOperationTransportHandler.messageReceived(TransportReplicationAction.java:279)  
at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryOperationTransportHandler.messageReceived(TransportReplicationAction.java:271)  
at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:75)  
at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:376)  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)

Please help ! I really don't get where I'm wrong

I use elasticsearch 2.3.3 and the mapper-attachments with the same version

Thank you

Anne-Sophie

---

<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 7, 2016, 2:52pm UTC](https://discuss.elastic.co/t/mapper-attachments-2-3-3-mapperparsingexception-no-content-is-provided/59962/2 "2016-09-07T14:52:55Z")

</div>

Hello Anne-Sophie

Please format your code using `</>` icon. It will make your post more readable.

As you can read [in the guide](https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-attachments-usage.html), you have to put your documents like this:

```auto
PUT /test/article/1
{
    "file" : "... base64 encoded attachment ..."
}

```

Or like this:

```auto
PUT /test/article/1
{
    "file" : {
        "_content_type" : "text/html",
        "_name" : "can-i-fill-in-free-text-in-the-resolution-tags--semaphore.html",
        "_content" : "... base64 encoded attachment ..."
    }
}

```

Hope this helps

---

<div class="post-metadata">

**Author:** ![AnSoTo](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@AnSoTo](https://discuss.elastic.co/u/AnSoTo)\
**Post date:** [September 7, 2016, 3:55pm UTC](https://discuss.elastic.co/t/mapper-attachments-2-3-3-mapperparsingexception-no-content-is-provided/59962/3 "2016-09-07T15:55:19Z")

</div>

> [@dadoonet](#):
>
> documents

Ho I didn't end up on this usage page of the mapper-attachments plugin...  
Just forgot the \_ before some fields names...

Thank you SO MUCH

Best

---

<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, 10:22pm UTC](https://discuss.elastic.co/t/mapper-attachments-2-3-3-mapperparsingexception-no-content-is-provided/59962/4 "2017-07-05T22:22:02Z")

</div>


