# Unavailable\_shards\_exception, reason=index\_xyz 0 primary shard is not active Timeout: 1m

**URL:** <https://discuss.elastic.co/t/unavailable-shards-exception-reason-index-xyz-0-primary-shard-is-not-active-timeout-1m/209730>\
**Category:** Elasticsearch\
**Created:** [November 27, 2019, 4:36pm UTC](https://discuss.elastic.co/t/unavailable-shards-exception-reason-index-xyz-0-primary-shard-is-not-active-timeout-1m/209730 "2019-11-27T16:36:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shivesh\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shivesh_kumar/32/45343_2.png) [@Shivesh\_Kumar](https://discuss.elastic.co/u/Shivesh_Kumar)\
**Post date:** [November 27, 2019, 4:36pm UTC](https://discuss.elastic.co/t/unavailable-shards-exception-reason-index-xyz-0-primary-shard-is-not-active-timeout-1m/209730/1 "2019-11-27T16:36:54Z")

</div>

I am using Elasticsearch 7 and it keeps throwing the below Error.  
My application is just trying to push a document with index document\_published\_data.  
For the same, I have created the BulkProcessor and using the bulk API to push the data on below condition -

```
BulkProcessor.Builder builder = BulkProcessor.builder(
				(request, bulkListener) ->
						client.bulkAsync(request, RequestOptions.DEFAULT, bulkListener),
				elasticsearchProcessor.getBulkProcessorListener(this));
builder.setBulkActions(50);
builder.setBulkSize(new ByteSizeValue(5, ByteSizeUnit.MB));

```

> Reason: ElasticsearchException[Elasticsearch exception [type=unavailable\_shards\_exception, reason=[index\_xyz][0] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[index\_xyz][0]] containing [index {[index\_xyz][\_doc][document\_xyz], source[n/a, actual length: [5.7kb], max length: 2kb]}]]]]

Does it have anything to do with configuration?  
I think the below message is the issue and the max value has to be adjusted.

> actual length: [5.7kb], max length: 2kb

---

<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:** [December 25, 2019, 4:37pm UTC](https://discuss.elastic.co/t/unavailable-shards-exception-reason-index-xyz-0-primary-shard-is-not-active-timeout-1m/209730/2 "2019-12-25T16:37:03Z")

</div>

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