Failed shard on node [bnK31ibrRG6bSpw_pYK2BA]: shard failure, reason [corrupt file (source: [index id[CTR0CY4BdvDW7Z2cSc8C] origin[PRIMARY] seq#[27209007]])], failure org.apache.lucene.store.AlreadyClosedException: this IndexWriter is closed

Hi @DavidTurner ,
After going through those docs the issue i am getting is slightly different, so can you help me to solve this issue, This is very priority issue , please give me a solution for this .

GET _cluster/allocation/explain
{
"index": "filebeat-2024.03.18",
"shard": 0,
"primary": false
}

{
  "index": "filebeat-2024.03.18",
  "shard": 0,
  "primary": false,
  "current_state": "unassigned",
  "unassigned_info": {
    "reason": "ALLOCATION_FAILED",
    "at": "2024-03-18T05:41:33.116Z",
    "failed_allocation_attempts": 5,
    "details": """failed shard on node [HYQB8KNQQqC80Z532l-W1A]: failed recovery, failure org.elasticsearch.indices.recovery.RecoveryFailedException: [filebeat-2024.03.18][0]: Recovery failed from {elastic-search-cluster-es-data-1}{-nrKshnxS9mAmaoMnCVTSQ}{GNapxsaJQ-qXcHA4s-vxrA}{elastic-search-cluster-es-data-1}{10.244.3.69}{10.244.3.69:9300}{dir}{8.10.4}{7000099-8100499}{k8s_node_name=aks-elasticnode-20666680-vmss000001, transform.config_version=10.0.0, xpack.installed=true, ml.config_version=10.0.0} into {elastic-search-cluster-es-data-0}{HYQB8KNQQqC80Z532l-W1A}{7cJkNSdsRfSyeQZH8UZRPQ}{elastic-search-cluster-es-data-0}{10.244.5.24}{10.244.5.24:9300}{dir}{8.10.4}{7000099-8100499}{k8s_node_name=aks-elasticnode-20666680-vmss000000, transform.config_version=10.0.0, xpack.installed=true, ml.config_version=10.0.0} (failed to clean after recovery)
	at org.elasticsearch.indices.recovery.RecoveryTarget.lambda$cleanFiles$6(RecoveryTarget.java:545)
	at org.elasticsearch.action.ActionListener.completeWith(ActionListener.java:299)
	at org.elasticsearch.indices.recovery.RecoveryTarget.cleanFiles(RecoveryTarget.java:495)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$3.handleRequest(PeerRecoveryTargetService.java:165)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$3.handleRequest(PeerRecoveryTargetService.java:162)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$RecoveryRequestHandler.messageReceived(PeerRecoveryTargetService.java:614)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$RecoveryRequestHandler.messageReceived(PeerRecoveryTargetService.java:601)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$1.doRun(SecurityServerTransportInterceptor.java:563)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$3.onResponse(SecurityServerTransportInterceptor.java:625)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$3.onResponse(SecurityServerTransportInterceptor.java:614)
	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorizeSystemUser(AuthorizationService.java:668)
	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorize(AuthorizationService.java:310)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.lambda$inbound$1(ServerTransportFilter.java:113)
	at org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:236)
	at org.elasticsearch.action.ActionListenerImplementations$MappedActionListener.onResponse(ActionListenerImplementations.java:95)
	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.authenticateAsync(AuthenticatorChain.java:94)
	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:261)
	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:199)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.authenticate(ServerTransportFilter.java:126)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.inbound(ServerTransportFilter.java:104)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.messageReceived(SecurityServerTransportInterceptor.java:636)
	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:74)
	at org.elasticsearch.transport.InboundHandler$1.doRun(InboundHandler.java:294)
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.lang.Thread.run(Thread.java:1583)
Caused by: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/data/indices/COenmTwcROWOOKOsdtih5Q/0/index/_42f.nvd
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:291)
	at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:104)
	at java.nio.file.Files.delete(Files.java:1152)
	at org.apache.lucene.store.FSDirectory.privateDeleteFile(FSDirectory.java:346)
	at org.apache.lucene.store.FSDirectory.deleteFile(FSDirectory.java:311)
	at org.apache.lucene.store.FilterDirectory.deleteFile(FilterDirectory.java:65)
	at org.elasticsearch.index.store.ByteSizeCachingDirectory.deleteFile(ByteSizeCachingDirectory.java:174)
	at org.apache.lucene.store.FilterDirectory.deleteFile(FilterDirectory.java:65)
	at org.elasticsearch.index.store.Store$StoreDirectory.deleteFile(Store.java:759)
	at org.elasticsearch.index.store.Store$StoreDirectory.deleteFile(Store.java:764)
	at org.apache.lucene.store.LockValidatingDirectoryWrapper.deleteFile(LockValidatingDirectoryWrapper.java:37)
	at org.apache.lucene.util.FileDeleter.delete(FileDeleter.java:234)
	at org.apache.lucene.util.FileDeleter.delete(FileDeleter.java:227)
	at org.apache.lucene.util.FileDeleter.deleteFilesIfNoRef(FileDeleter.java:190)
	at org.apache.lucene.index.IndexFileDeleter.<init>(IndexFileDeleter.java:236)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1157)
	at org.elasticsearch.index.store.Store.newTemporaryAppendingIndexWriter(Store.java:1545)
	at org.elasticsearch.index.store.Store.associateIndexWithNewTranslog(Store.java:1451)
	at org.elasticsearch.indices.recovery.RecoveryTarget.lambda$cleanFiles$6(RecoveryTarget.java:512)
	... 28 more
""",
    "last_allocation_status": "no_attempt"
  },
  "can_allocate": "no",
  "allocate_explanation": "Elasticsearch isn't allowed to allocate this shard to any of the nodes in the cluster. Choose a node to which you expect this shard to be allocated, find this node in the node-by-node explanation, and address the reasons which prevent Elasticsearch from allocating this shard there.",
  "node_allocation_decisions": [
    {
      "node_id": "-nrKshnxS9mAmaoMnCVTSQ",
      "node_name": "elastic-search-cluster-es-data-1",
      "transport_address": "10.244.3.69:9300",
      "node_attributes": {
        "xpack.installed": "true",
        "transform.config_version": "10.0.0",
        "k8s_node_name": "aks-elasticnode-20666680-vmss000001",
        "ml.config_version": "10.0.0"
      },
      "node_decision": "no",
      "deciders": [
        {
          "decider": "max_retry",
          "decision": "NO",
          "explanation": """shard has exceeded the maximum number of retries [5] on failed allocation attempts - manually call [POST /_cluster/reroute?retry_failed&metric=none] to retry, [unassigned_info[[reason=ALLOCATION_FAILED], at[2024-03-18T05:41:33.116Z], failed_attempts[5], failed_nodes[[HYQB8KNQQqC80Z532l-W1A]], delayed=false, last_node[HYQB8KNQQqC80Z532l-W1A], details[failed shard on node [HYQB8KNQQqC80Z532l-W1A]: failed recovery, failure org.elasticsearch.indices.recovery.RecoveryFailedException: [filebeat-2024.03.18][0]: Recovery failed from {elastic-search-cluster-es-data-1}{-nrKshnxS9mAmaoMnCVTSQ}{GNapxsaJQ-qXcHA4s-vxrA}{elastic-search-cluster-es-data-1}{10.244.3.69}{10.244.3.69:9300}{dir}{8.10.4}{7000099-8100499}{k8s_node_name=aks-elasticnode-20666680-vmss000001, transform.config_version=10.0.0, xpack.installed=true, ml.config_version=10.0.0} into {elastic-search-cluster-es-data-0}{HYQB8KNQQqC80Z532l-W1A}{7cJkNSdsRfSyeQZH8UZRPQ}{elastic-search-cluster-es-data-0}{10.244.5.24}{10.244.5.24:9300}{dir}{8.10.4}{7000099-8100499}{k8s_node_name=aks-elasticnode-20666680-vmss000000, transform.config_version=10.0.0, xpack.installed=true, ml.config_version=10.0.0} (failed to clean after recovery)
	at org.elasticsearch.indices.recovery.RecoveryTarget.lambda$cleanFiles$6(RecoveryTarget.java:545)
	at org.elasticsearch.action.ActionListener.completeWith(ActionListener.java:299)
	at org.elasticsearch.indices.recovery.RecoveryTarget.cleanFiles(RecoveryTarget.java:495)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$3.handleRequest(PeerRecoveryTargetService.java:165)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$3.handleRequest(PeerRecoveryTargetService.java:162)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$RecoveryRequestHandler.messageReceived(PeerRecoveryTargetService.java:614)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$RecoveryRequestHandler.messageReceived(PeerRecoveryTargetService.java:601)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$1.doRun(SecurityServerTransportInterceptor.java:563)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$3.onResponse(SecurityServerTransportInterceptor.java:625)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$3.onResponse(SecurityServerTransportInterceptor.java:614)
	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorizeSystemUser(AuthorizationService.java:668)
	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorize(AuthorizationService.java:310)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.lambda$inbound$1(ServerTransportFilter.java:113)
	at org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:236)
	at org.elasticsearch.action.ActionListenerImplementations$MappedActionListener.onResponse(ActionListenerImplementations.java:95)
	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.authenticateAsync(AuthenticatorChain.java:94)
	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:261)
	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:199)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.authenticate(ServerTransportFilter.java:126)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.inbound(ServerTransportFilter.java:104)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.messageReceived(SecurityServerTransportInterceptor.java:636)
	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:74)
	at org.elasticsearch.transport.InboundHandler$1.doRun(InboundHandler.java:294)
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.lang.Thread.run(Thread.java:1583)
Caused by: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/data/indices/COenmTwcROWOOKOsdtih5Q/0/index/_42f.nvd
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:291)
	at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:104)
	at java.nio.file.Files.delete(Files.java:1152)
	at org.apache.lucene.store.FSDirectory.privateDeleteFile(FSDirectory.java:346)
	at org.apache.lucene.store.FSDirectory.deleteFile(FSDirectory.java:311)
	at org.apache.lucene.store.FilterDirectory.deleteFile(FilterDirectory.java:65)
	at org.elasticsearch.index.store.ByteSizeCachingDirectory.deleteFile(ByteSizeCachingDirectory.java:174)
	at org.apache.lucene.store.FilterDirectory.deleteFile(FilterDirectory.java:65)
	at org.elasticsearch.index.store.Store$StoreDirectory.deleteFile(Store.java:759)
	at org.elasticsearch.index.store.Store$StoreDirectory.deleteFile(Store.java:764)
	at org.apache.lucene.store.LockValidatingDirectoryWrapper.deleteFile(LockValidatingDirectoryWrapper.java:37)
	at org.apache.lucene.util.FileDeleter.delete(FileDeleter.java:234)
	at org.apache.lucene.util.FileDeleter.delete(FileDeleter.java:227)
	at org.apache.lucene.util.FileDeleter.deleteFilesIfNoRef(FileDeleter.java:190)
	at org.apache.lucene.index.IndexFileDeleter.<init>(IndexFileDeleter.java:236)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1157)
	at org.elasticsearch.index.store.Store.newTemporaryAppendingIndexWriter(Store.java:1545)
	at org.elasticsearch.index.store.Store.associateIndexWithNewTranslog(Store.java:1451)
	at org.elasticsearch.indices.recovery.RecoveryTarget.lambda$cleanFiles$6(RecoveryTarget.java:512)
	... 28 more
], allocation_status[no_attempt]]]"""
        },
        {
          "decider": "replica_after_primary_active",
          "decision": "NO",
          "explanation": "primary shard for this replica is not yet active"
        },
        {
          "decider": "throttling",
          "decision": "NO",
          "explanation": "primary shard for this replica is not yet active"
        }
      ]
    },
    {
      "node_id": "HYQB8KNQQqC80Z532l-W1A",
      "node_name": "elastic-search-cluster-es-data-0",
      "transport_address": "10.244.5.24:9300",
      "node_attributes": {
        "transform.config_version": "10.0.0",
        "xpack.installed": "true",
        "k8s_node_name": "aks-elasticnode-20666680-vmss000000",
        "ml.config_version": "10.0.0"
      },
      "node_decision": "no",
      "deciders": [
        {
          "decider": "max_retry",
          "decision": "NO",
          "explanation": """shard has exceeded the maximum number of retries [5] on failed allocation attempts - manually call [POST /_cluster/reroute?retry_failed&metric=none] to retry, [unassigned_info[[reason=ALLOCATION_FAILED], at[2024-03-18T05:41:33.116Z], failed_attempts[5], failed_nodes[[HYQB8KNQQqC80Z532l-W1A]], delayed=false, last_node[HYQB8KNQQqC80Z532l-W1A], details[failed shard on node [HYQB8KNQQqC80Z532l-W1A]: failed recovery, failure org.elasticsearch.indices.recovery.RecoveryFailedException: [filebeat-2024.03.18][0]: Recovery failed from {elastic-search-cluster-es-data-1}{-nrKshnxS9mAmaoMnCVTSQ}{GNapxsaJQ-qXcHA4s-vxrA}{elastic-search-cluster-es-data-1}{10.244.3.69}{10.244.3.69:9300}{dir}{8.10.4}{7000099-8100499}{k8s_node_name=aks-elasticnode-20666680-vmss000001, transform.config_version=10.0.0, xpack.installed=true, ml.config_version=10.0.0} into {elastic-search-cluster-es-data-0}{HYQB8KNQQqC80Z532l-W1A}{7cJkNSdsRfSyeQZH8UZRPQ}{elastic-search-cluster-es-data-0}{10.244.5.24}{10.244.5.24:9300}{dir}{8.10.4}{7000099-8100499}{k8s_node_name=aks-elasticnode-20666680-vmss000000, transform.config_version=10.0.0, xpack.installed=true, ml.config_version=10.0.0} (failed to clean after recovery)
	at org.elasticsearch.indices.recovery.RecoveryTarget.lambda$cleanFiles$6(RecoveryTarget.java:545)
	at org.elasticsearch.action.ActionListener.completeWith(ActionListener.java:299)
	at org.elasticsearch.indices.recovery.RecoveryTarget.cleanFiles(RecoveryTarget.java:495)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$3.handleRequest(PeerRecoveryTargetService.java:165)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$3.handleRequest(PeerRecoveryTargetService.java:162)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$RecoveryRequestHandler.messageReceived(PeerRecoveryTargetService.java:614)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$RecoveryRequestHandler.messageReceived(PeerRecoveryTargetService.java:601)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$1.doRun(SecurityServerTransportInterceptor.java:563)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$3.onResponse(SecurityServerTransportInterceptor.java:625)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$3.onResponse(SecurityServerTransportInterceptor.java:614)
	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorizeSystemUser(AuthorizationService.java:668)
	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorize(AuthorizationService.java:310)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.lambda$inbound$1(ServerTransportFilter.java:113)
	at org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:236)
	at org.elasticsearch.action.ActionListenerImplementations$MappedActionListener.onResponse(ActionListenerImplementations.java:95)
	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.authenticateAsync(AuthenticatorChain.java:94)
	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:261)
	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:199)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.authenticate(ServerTransportFilter.java:126)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.inbound(ServerTransportFilter.java:104)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.messageReceived(SecurityServerTransportInterceptor.java:636)
	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:74)
	at org.elasticsearch.transport.InboundHandler$1.doRun(InboundHandler.java:294)
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.lang.Thread.run(Thread.java:1583)
Caused by: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/data/indices/COenmTwcROWOOKOsdtih5Q/0/index/_42f.nvd
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:291)
	at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:104)
	at java.nio.file.Files.delete(Files.java:1152)
	at org.apache.lucene.store.FSDirectory.privateDeleteFile(FSDirectory.java:346)
	at org.apache.lucene.store.FSDirectory.deleteFile(FSDirectory.java:311)
	at org.apache.lucene.store.FilterDirectory.deleteFile(FilterDirectory.java:65)
	at org.elasticsearch.index.store.ByteSizeCachingDirectory.deleteFile(ByteSizeCachingDirectory.java:174)
	at org.apache.lucene.store.FilterDirectory.deleteFile(FilterDirectory.java:65)
	at org.elasticsearch.index.store.Store$StoreDirectory.deleteFile(Store.java:759)
	at org.elasticsearch.index.store.Store$StoreDirectory.deleteFile(Store.java:764)
	at org.apache.lucene.store.LockValidatingDirectoryWrapper.deleteFile(LockValidatingDirectoryWrapper.java:37)
	at org.apache.lucene.util.FileDeleter.delete(FileDeleter.java:234)
	at org.apache.lucene.util.FileDeleter.delete(FileDeleter.java:227)
	at org.apache.lucene.util.FileDeleter.deleteFilesIfNoRef(FileDeleter.java:190)
	at org.apache.lucene.index.IndexFileDeleter.<init>(IndexFileDeleter.java:236)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1157)
	at org.elasticsearch.index.store.Store.newTemporaryAppendingIndexWriter(Store.java:1545)
	at org.elasticsearch.index.store.Store.associateIndexWithNewTranslog(Store.java:1451)
	at org.elasticsearch.indices.recovery.RecoveryTarget.lambda$cleanFiles$6(RecoveryTarget.java:512)
	... 28 more
], allocation_status[no_attempt]]]"""
        },
        {
          "decider": "replica_after_primary_active",
          "decision": "NO",
          "explanation": "primary shard for this replica is not yet active"
        },
        {
          "decider": "throttling",
          "decision": "NO",
          "explanation": "primary shard for this replica is not yet active"
        }
      ]
    }
  ]
}

But if you see their is an explantion for a issue like that in a docs you have provided me.

{
  "index" : "my-index-000001",
  "shard" : 0,
  "primary" : true,
  "current_state" : "unassigned",
  "unassigned_info" : {
    "reason" : "NODE_LEFT",
    "at" : "2017-01-04T18:03:28.464Z",
    "details" : "node_left[OIWe8UhhThCK0V5XfmdrmQ]",
    "last_allocation_status" : "no_valid_shard_copy"
  },
  "can_allocate" : "no_valid_shard_copy",
  "allocate_explanation" : "Elasticsearch can't allocate this shard because there are no copies of its data in the cluster. Elasticsearch will allocate this shard when a node holding a good copy of its data joins the cluster. If no such node is available, restore this index from a recent snapshot."
}

but here in the docs if a check here reason is showing

 "unassigned_info" : {
    "reason" : "NODE_LEFT",
    "at" : "2017-01-04T18:03:28.464Z",
    "details" : "node_left[OIWe8UhhThCK0V5XfmdrmQ]",
 "last_allocation_status" : "no_valid_shard_copy"
  },
  "can_allocate" : "no_valid_shard_copy",
  "allocate_explanation" : "Elasticsearch can't allocate this shard because there are no copies of its data in the cluster. Elasticsearch will allocate this shard when a node holding a good copy of its data joins the cluster. If no such node is available, restore this index from a recent snapshot."
}

but the reason i am getting

"unassigned_info": {
    "reason": "ALLOCATION_FAILED",
    "at": "2024-03-18T05:41:33.116Z",
    "failed_allocation_attempts": 5,
    "details": """failed shard on node [HYQB8KNQQqC80Z532l-W1A]: failed recovery, failure org.elasticsearch.indices.recovery.RecoveryFailedException: [filebeat-2024.03.18][0]: Recovery failed from {elastic-search-cluster-es-data-1}{-nrKshnxS9mAmaoMnCVTSQ}{GNapxsaJQ-qXcHA4s-vxrA}{elastic-search-cluster-es-data-1}{10.244.3.69}{10.244.3.69:9300}{dir}{8.10.4}{7000099-8100499}{k8s_node_name=aks-elasticnode-20666680-vmss000001, transform.config_version=10.0.0, xpack.installed=true, ml.config_version=10.0.0} into {elastic-search-cluster-es-data-0}{HYQB8KNQQqC80Z532l-W1A}{7cJkNSdsRfSyeQZH8UZRPQ}{elastic-search-cluster-es-data-0}{10.244.5.24}{10.244.5.24:9300}{dir}{8.10.4}{7000099-8100499}{k8s_node_name=aks-elasticnode-20666680-vmss000000, transform.config_version=10.0.0, xpack.installed=true, ml.config_version=10.0.0} (failed to clean after recovery)
	at org.elasticsearch.indices.recovery.RecoveryTarget.lambda$cleanFiles$6(RecoveryTarget.java:545)
	at org.elasticsearch.action.ActionListener.completeWith(ActionListener.java:299)
	at org.elasticsearch.indices.recovery.RecoveryTarget.cleanFiles(RecoveryTarget.java:495)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$3.handleRequest(PeerRecoveryTargetService.java:165)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$3.handleRequest(PeerRecoveryTargetService.java:162)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$RecoveryRequestHandler.messageReceived(PeerRecoveryTargetService.java:614)
	at org.elasticsearch.indices.recovery.PeerRecoveryTargetService$RecoveryRequestHandler.messageReceived(PeerRecoveryTargetService.java:601)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$1.doRun(SecurityServerTransportInterceptor.java:563)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$3.onResponse(SecurityServerTransportInterceptor.java:625)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$3.onResponse(SecurityServerTransportInterceptor.java:614)
	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorizeSystemUser(AuthorizationService.java:668)
	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorize(AuthorizationService.java:310)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.lambda$inbound$1(ServerTransportFilter.java:113)
	at org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:236)
	at org.elasticsearch.action.ActionListenerImplementations$MappedActionListener.onResponse(ActionListenerImplementations.java:95)
	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.authenticateAsync(AuthenticatorChain.java:94)
	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:261)
	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:199)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.authenticate(ServerTransportFilter.java:126)
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.inbound(ServerTransportFilter.java:104)
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.messageReceived(SecurityServerTransportInterceptor.java:636)
	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:74)
	at org.elasticsearch.transport.InboundHandler$1.doRun(InboundHandler.java:294)
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.lang.Thread.run(Thread.java:1583)
Caused by: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/data/indices/COenmTwcROWOOKOsdtih5Q/0/index/_42f.nvd
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:291)
	at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:104)
	at java.nio.file.Files.delete(Files.java:1152)
	at org.apache.lucene.store.FSDirectory.privateDeleteFile(FSDirectory.java:346)
	at org.apache.lucene.store.FSDirectory.deleteFile(FSDirectory.java:311)
	at org.apache.lucene.store.FilterDirectory.deleteFile(FilterDirectory.java:65)
	at org.elasticsearch.index.store.ByteSizeCachingDirectory.deleteFile(ByteSizeCachingDirectory.java:174)
	at org.apache.lucene.store.FilterDirectory.deleteFile(FilterDirectory.java:65)
	at org.elasticsearch.index.store.Store$StoreDirectory.deleteFile(Store.java:759)
	at org.elasticsearch.index.store.Store$StoreDirectory.deleteFile(Store.java:764)
	at org.apache.lucene.store.LockValidatingDirectoryWrapper.deleteFile(LockValidatingDirectoryWrapper.java:37)
	at org.apache.lucene.util.FileDeleter.delete(FileDeleter.java:234)
	at org.apache.lucene.util.FileDeleter.delete(FileDeleter.java:227)
	at org.apache.lucene.util.FileDeleter.deleteFilesIfNoRef(FileDeleter.java:190)
	at org.apache.lucene.index.IndexFileDeleter.<init>(IndexFileDeleter.java:236)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1157)
	at org.elasticsearch.index.store.Store.newTemporaryAppendingIndexWriter(Store.java:1545)
	at org.elasticsearch.index.store.Store.associateIndexWithNewTranslog(Store.java:1451)
	at org.elasticsearch.indices.recovery.RecoveryTarget.lambda$cleanFiles$6(RecoveryTarget.java:512)
	... 28 more
""",
    "last_allocation_status": "no_attempt"
  },
  "can_allocate": "no",
  "allocate_explanation": "Elasticsearch isn't allowed to allocate this shard to any of the nodes in the cluster. Choose a node to which you expect this shard to be allocated, find this node in the node-by-node explanation, and address the reasons which prevent Elasticsearch from allocating this shard there.",

please give me a solution to resolve this,