Cannot allocate because a previous copy of the primary shard existed but can no longer be found on the nodes in the cluster

{
  "index" : "edge-access",
  "shard" : 0,
  "primary" : true,
  "current_state" : "unassigned",
  "unassigned_info" : {
    "reason" : "INDEX_REOPENED",
    "at" : "2020-08-18T03:02:26.620Z",
    "last_allocation_status" : "no_valid_shard_copy"
  },
  "can_allocate" : "no_valid_shard_copy",
  "allocate_explanation" : "cannot allocate because a previous copy of the primary shard existed but can no longer be found on the nodes in the cluster",
  "node_allocation_decisions" : [
    {
      "node_id" : "RHm_GTn3RY2aMl1t19fu6g",
      "node_name" : "data-03",
      "transport_address" : "ip:port",
      "node_attributes" : {
        "xpack.installed" : "true"
      },
      "node_decision" : "no",
      "store" : {
        "found" : false
      }
    },
    {
      "node_id" : "XtMCoFmeRdiwvl0DCys7NA",
      "node_name" : "data-02",
      "transport_address" : "ip:port",
      "node_attributes" : {
        "xpack.installed" : "true"
      },
      "node_decision" : "no",
      "store" : {
        "found" : false
      }
    },
    {
      "node_id" : "dw09FlVLRzGCil3jYYJbkw",
      "node_name" : "data-01",
      "transport_address" : "ip:port",
      "node_attributes" : {
        "xpack.installed" : "true"
      },
      "node_decision" : "no",
      "store" : {
        "found" : false
      }
    }
  ]
}



---------------------------------------------------------------------------------------------------------------------------------------------

"edge-access" : {
      "status" : "red",
      "number_of_shards" : 1,
      "number_of_replicas" : 0,
      "active_primary_shards" : 0,
      "active_shards" : 0,
      "relocating_shards" : 0,
      "initializing_shards" : 0,
      "unassigned_shards" : 1,
      "shards" : {
        "0" : {
          "status" : "red",
          "primary_active" : false,
          "active_shards" : 0,
          "relocating_shards" : 0,
          "initializing_shards" : 0,
          "unassigned_shards" : 1
        }
      }
    },


How to solve it?`Preformatted text`

Please format your code/logs/config using the </> button, or markdown style back ticks. It helps to make things easy to read which helps us help you :slight_smile:

What does the output from _cat/shards/edge-access?v, and _cat/recovery/edge-access?v show?

1 Like

index shard prirep state docs store ip node
edge-access 0 p UNASSIGNED

index shard time type stage source_host source_node target_host target_node repository snapshot files files_recovered files_percent files_total bytes bytes_recovered bytes_percent bytes_total translog_ops translog_ops_recovered translog_ops_percent

Again, please format your code/logs/config using the </> button, or markdown style back ticks. It helps to make things easy to read which helps us help you :slight_smile:

That looks like you have a single shard index with no replicas?

1 Like

yes

PUT /edge-access/_settings
{
  "number_of_replicas": 0
}
1 Like

Ok. Did you lose a node from your cluster?

1 Like

Yes, one day it turned red

If you cannot recover that node, you have probably lost the data.

You should be using snapshots and replicas to protect your data.

1 Like

I have met the same question. In our case, the nodes left due to bad disks in the cluster. And this can lead to the loss of data. The solution we take is to assign empty shards to the index.
This problem appeared before version 6. Before version 6, closed index was not managed by the cluster.After version 6, closed index was managed by the cluster. In addition, elasticsearch introduce frozen index after version 6.

1 Like

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