# Must specify numberOfShards for index

**URL:** <https://discuss.elastic.co/t/must-specify-numberofshards-for-index/367120>\
**Category:** Elasticsearch\
**Created:** [September 25, 2024, 5:07pm UTC](https://discuss.elastic.co/t/must-specify-numberofshards-for-index/367120 "2024-09-25T17:07:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Weinhaupl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_weinhaupl/32/121357_2.png) [@Chris\_Weinhaupl](https://discuss.elastic.co/u/Chris_Weinhaupl)\
**Post date:** [September 25, 2024, 5:07pm UTC](https://discuss.elastic.co/t/must-specify-numberofshards-for-index/367120/1 "2024-09-25T17:07:01Z")

</div>

I would like to set the number of shards for the index in the elasticsearch.yml file to prevent these events in the logs.  
What would be appropriate to put in the yml file?

Thank you

Ref event:

```auto
[2024-08-28 07:56:48,991][WARN][gateway.local.state.meta] [tir12pd] failed to find dangling indices
org.elasticsearch.ElasticsearchException: must specify numberOfShards for index [version]

```

Current index and shard  
`GET _cat/shards?v=true&h=index,prirep,shard,store&s=prirep,store&bytes=gb`

index prirep shard store  
calv2-us-d728411a-5ddd-4dc4-8be6 p 4 34.9mb  
calv2-us-d728411a-5ddd-4dc4-8be6 r 4 34.9mb  
calv2-us-d728411a-5ddd-4dc4-8be6 p 0 41.5mb  
calv2-us-d728411a-5ddd-4dc4-8be6 r 0 36mb  
calv2-us-d728411a-5ddd-4dc4-8be6 p 3 34.2mb  
calv2-us-d728411a-5ddd-4dc4-8be6 r 3 34.1mb  
calv2-us-d728411a-5ddd-4dc4-8be6 r 1 30.4mb  
calv2-us-d728411a-5ddd-4dc4-8be6 p 1 30.4mb  
calv2-us-d728411a-5ddd-4dc4-8be6 r 2 30.3mb  
calv2-us-d728411a-5ddd-4dc4-8be6 p 2 35mb  
scv2-us-d728411a-5ddd-4dc4-8be6 p 2 672.7kb  
scv2-us-d728411a-5ddd-4dc4-8be6 r 2 672.4kb  
scv2-us-d728411a-5ddd-4dc4-8be6 r 0 329.2kb  
scv2-us-d728411a-5ddd-4dc4-8be6 p 0 329.3kb  
scv2-us-d728411a-5ddd-4dc4-8be6 r 3 318.2kb  
scv2-us-d728411a-5ddd-4dc4-8be6 p 3 318.4kb  
scv2-us-d728411a-5ddd-4dc4-8be6 p 1 663kb  
scv2-us-d728411a-5ddd-4dc4-8be6 r 1 640kb  
scv2-us-d728411a-5ddd-4dc4-8be6 p 4 331.5kb  
scv2-us-d728411a-5ddd-4dc4-8be6 r 4 331.3kb
