# Allocate\_stale\_primary appears to succeed on wrong node

**URL:** https://discuss.elastic.co/t/allocate-stale-primary-appears-to-succeed-on-wrong-node/172452
**Category:** Elasticsearch
**Created:** [March 15, 2019, 3:33am UTC](https://discuss.elastic.co/t/allocate-stale-primary-appears-to-succeed-on-wrong-node/172452 "2019-03-15T03:33:37Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)
#### Post date: [March 15, 2019, 3:33am UTC](https://discuss.elastic.co/t/allocate-stale-primary-appears-to-succeed-on-wrong-node/172452/1 "2019-03-15T03:33:37Z")

</div>

Hi,  
I'm facing the same issue in v6.4.2 version and this is fixed in v6.5.1 as per below mentioned link.

I just want to know that is there any workaround to fix this problem in v6.4.2.

> <https://github.com/elastic/elasticsearch/issues/37098>

Regards,  
Harsh Bajaj

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [March 15, 2019, 8:03am UTC](https://discuss.elastic.co/t/allocate-stale-primary-appears-to-succeed-on-wrong-node/172452/2 "2019-03-15T08:03:34Z")

</div>

Hi @harshbajaj16, the issue you mention is just to improve how an error is reported. I'm not really sure what a "workaround" is in this case. Perhaps it is to avoid the error by allocating a stale primary on the correct node by checking `GET _shard_stores` first.

---

<div class="post-metadata">

### Author: ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)
#### Post date: [March 15, 2019, 8:28am UTC](https://discuss.elastic.co/t/allocate-stale-primary-appears-to-succeed-on-wrong-node/172452/3 "2019-03-15T08:28:49Z")

</div>

HI @DavidTurner,  
sorry for miscommunication. actually i'm facing below problem and want to resolve the same. could you please help?

```auto
Caused by: java.io.FileNotFoundException: no segments* file found in store(ByteSizeCachingDirectory(MMapDirectory@/Users/davidturner/discuss/162719/elasticsearch-6.5.1/data-1/nodes/0/indices/YPnPuK8hRnyDHjzM2EhLtQ/1/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@46a205e7)): files: []

```

While allocating the shard on correct node its showing "acknowledged": true, but still shard is in unassigned state.

Please let me know the approach how can we allocate the shard where "no segments\* file found in store" error occur.

Regards,  
Harsh Bajaj

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [March 15, 2019, 8:32am UTC](https://discuss.elastic.co/t/allocate-stale-primary-appears-to-succeed-on-wrong-node/172452/4 "2019-03-15T08:32:21Z")

</div>

This error message indicates that the store you've chosen is empty - there's no stale shard copy to allocate there. Either pick a node that _does_ have a copy of this shard (found using `GET _shard_stores` perhaps) or use `allocate_empty_primary` instead of `allocate_stale_primary`. Either way you risk losing data btw.

---

<div class="post-metadata">

### Author: ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)
#### Post date: [March 15, 2019, 8:35am UTC](https://discuss.elastic.co/t/allocate-stale-primary-appears-to-succeed-on-wrong-node/172452/5 "2019-03-15T08:35:16Z")

</div>

Yes @DavidTurner its working now. i was not sure allocate\_empty\_primary will solve this problem or not.

Thanks.

---

<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: [April 12, 2019, 8:45am UTC](https://discuss.elastic.co/t/allocate-stale-primary-appears-to-succeed-on-wrong-node/172452/6 "2019-04-12T08:45:12Z")

</div>

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