# Unable to index a file (Word document) greater than 45 MB

**URL:** <https://discuss.elastic.co/t/unable-to-index-a-file-word-document-greater-than-45-mb/272220>\
**Category:** Elasticsearch\
**Created:** [May 5, 2021, 6:32pm UTC](https://discuss.elastic.co/t/unable-to-index-a-file-word-document-greater-than-45-mb/272220 "2021-05-05T18:32:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![saqib619](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@saqib619](https://discuss.elastic.co/u/saqib619)\
**Post date:** [May 5, 2021, 6:32pm UTC](https://discuss.elastic.co/t/unable-to-index-a-file-word-document-greater-than-45-mb/272220/1 "2021-05-05T18:32:03Z")

</div>

We are trying to index a file (word document) which is \> 45 MB . It is failing throwing an exception as below:  
Maximum timeout reached while retrying request. Call: Status code unknown from: PUT /test\_index6/\_doc/16601?pipeline=Attachment

What is the maximum file size recommendation and how do we increase the size limit to handle large file indexing?

---

<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:** [May 5, 2021, 6:50pm UTC](https://discuss.elastic.co/t/unable-to-index-a-file-word-document-greater-than-45-mb/272220/2 "2021-05-05T18:50:33Z")

</div>

There are some limits like no more than 100mb for a single HTTP request.  
45mb of binary data can become much bigger when you BASE64 encode it.

So be careful with that.

That's one of the reason I prefer to extract the text and metadata before sending it to elasticsearch. That's what FSCrawler project does basically.

Disclaimer: I'm the author of FSCrawler.

---

<div class="post-metadata">

**Author:** ![saqib619](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@saqib619](https://discuss.elastic.co/u/saqib619)\
**Post date:** [May 5, 2021, 7:48pm UTC](https://discuss.elastic.co/t/unable-to-index-a-file-word-document-greater-than-45-mb/272220/3 "2021-05-05T19:48:06Z")

</div>

Thanks David.

As per this link from elastic :[General recommendations | Elasticsearch Guide [7.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/general-recommendations.html#:~:text=Avoid%20large%20documentsedit&text=max_content_length%20is%20set%20to%20100MB,documents%20are%20usually%20not%20practical)

we added http.max\_content\_length set to 350 mb in the yml file but no luck.

It says custom limit is 2 GB. Am I getting it wrong?

---

<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:** [May 6, 2021, 10:55am UTC](https://discuss.elastic.co/t/unable-to-index-a-file-word-document-greater-than-45-mb/272220/4 "2021-05-06T10:55:57Z")

</div>

What are Elasticsearch logs and the full trace of the error?

---

<div class="post-metadata">

**Author:** ![saqib619](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@saqib619](https://discuss.elastic.co/u/saqib619)\
**Post date:** [May 6, 2021, 2:00pm UTC](https://discuss.elastic.co/t/unable-to-index-a-file-word-document-greater-than-45-mb/272220/5 "2021-05-06T14:00:20Z")

</div>

Error Message : Exception of type 'System.OutOfMemoryException' was thrown.  
Stack Trace:" at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Transport\Transport.cs:line 95 at Elasticsearch.Net.ElasticLowLevelClient.DoRequest[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\ElasticLowLevelClient.cs:line 70 at Nest.ElasticClient.DoRequest[TRequest,TResponse](TRequest p, IRequestParameters parameters, Action`1 forceConfiguration) in E:\Projects\Elastic\elasticsearch-net-copy\src\Nest\ElasticClient.cs:line 133 at Nest.ElasticClient.Index[TDocument](IIndexRequest`1 request) in E:\Projects\Elastic\elasticsearch-net-copy\src\Nest\ElasticClient.NoNamespace.cs:line 672 at Nest.ElasticClient.Index[TDocument](TDocument document, Func`2 selector) in E:\Projects\Elastic\elasticsearch-net-copy\src\Nest\ElasticClient.NoNamespace.cs:line 658 "

Error Message : Maximum timeout reached while retrying request. Call: Status code unknown from: PUT /consult\_index6/\_doc/16601?pipeline=Attachment  
No stack trace on elastic side for this.

We increased the http\_max\_content\_length to 350 mb, but we still the issue with that. Also, when we check elasticsearch.log within the server, don't see much details.

Hope this would help.

---

<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:** [May 6, 2021, 6:59pm UTC](https://discuss.elastic.co/t/unable-to-index-a-file-word-document-greater-than-45-mb/272220/6 "2021-05-06T18:59:21Z")

</div>

Could it be a client side error?

---

<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:** [June 3, 2021, 7:00pm UTC](https://discuss.elastic.co/t/unable-to-index-a-file-word-document-greater-than-45-mb/272220/7 "2021-06-03T19:00:12Z")

</div>

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