# Elasticsearch.Net.ElasticsearchClientException: The remote server returned an error: (413) Request Entity Too Large

**URL:** <https://discuss.elastic.co/t/elasticsearch-net-elasticsearchclientexception-the-remote-server-returned-an-error-413-request-entity-too-large/163786>\
**Category:** Elasticsearch\
**Created:** [January 10, 2019, 4:44pm UTC](https://discuss.elastic.co/t/elasticsearch-net-elasticsearchclientexception-the-remote-server-returned-an-error-413-request-entity-too-large/163786 "2019-01-10T16:44:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![franckepeixoto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franckepeixoto/32/39590_2.png) [@franckepeixoto](https://discuss.elastic.co/u/franckepeixoto)\
**Post date:** [January 10, 2019, 4:44pm UTC](https://discuss.elastic.co/t/elasticsearch-net-elasticsearchclientexception-the-remote-server-returned-an-error-413-request-entity-too-large/163786/1 "2019-01-10T16:44:25Z")

</div>

dear,  
i do trying sent a bulk size 1GB, but ... (i need help)

> Elasticsearch.Net.ElasticsearchClientException: The remote server returned an error: (413) Request Entity Too Large.. Call: Status code 413 from: POST /\_bulk?\_s  
> ource=false&refresh=false&pipeline=attachments ---\> System.Net.WebException: The  
> remote server returned an error: (413) Request Entity Too Large.  
> at System.Net.HttpWebRequest.GetResponse()  
> at Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData  
> requestData)  
> --- End of inner exception stack trace ---  
> #2 The remote server returned an error: (413) Request Entity Too Large

**my elasticsearch.yml configuration: (Elastic 6.5)**

bootstrap.memory\_lock: true  
indices.recovery.max\_bytes\_per\_sec: 2g  
indices.memory.index\_buffer\_size: 60%  
thread\_pool.bulk.queue\_size: 3000  
thread\_pool.index.queue\_size: 3000  
http.max\_content\_length: 15000mb  
http.max\_header\_size: 1500mb  
http.max\_initial\_line\_length: 2500mb  
http.port: 9200  
node.data: true  
node.ingest: true  
node.master: true  
node.max\_local\_storage\_nodes: 1  
xpack.license.self\_generated.type: basic  
xpack.security.enabled: false

**can help me?**

---

<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:** [January 10, 2019, 5:00pm UTC](https://discuss.elastic.co/t/elasticsearch-net-elasticsearchclientexception-the-remote-server-returned-an-error-413-request-entity-too-large/163786/2 "2019-01-10T17:00:48Z")

</div>

Send smaller bulks. It does not make sense to send so big requests IMO.

---

<div class="post-metadata">

**Author:** ![franckepeixoto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franckepeixoto/32/39590_2.png) [@franckepeixoto](https://discuss.elastic.co/u/franckepeixoto)\
**Post date:** [January 10, 2019, 5:22pm UTC](https://discuss.elastic.co/t/elasticsearch-net-elasticsearchclientexception-the-remote-server-returned-an-error-413-request-entity-too-large/163786/3 "2019-01-10T17:22:28Z")

</div>

my bulks are mails with attachments.

i use the attachment pipeline with ingest attachment processor plugin.

I have a volume of 3 million e-mail send to index.

thanks for reply 🙂

---

<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:** [January 10, 2019, 6:03pm UTC](https://discuss.elastic.co/t/elasticsearch-net-elasticsearchclientexception-the-remote-server-returned-an-error-413-request-entity-too-large/163786/4 "2019-01-10T18:03:22Z")

</div>

Send one attachment one by one or one email per one email...

At most, I'd not send to elasticsearch bulk requests with more than 50mb of data.

The other solution is to do the text extraction outside elasticsearch and send just the extracted text to elasticsearch.  
FSCrawler might help although I'm aware of limitations as well.

---

<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:** [February 7, 2019, 6:05pm UTC](https://discuss.elastic.co/t/elasticsearch-net-elasticsearchclientexception-the-remote-server-returned-an-error-413-request-entity-too-large/163786/5 "2019-02-07T18:05:36Z")

</div>

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