📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-8.9

简而言之,当您尝试使用与任何现有任务都不对应的ID来访问或操作Elasticsearch中的任务时,会发生此错误。这可能是由于ID拼写错误,或者任务可能已被删除或从未存在过。要解决此问题,首先应验证您正在使用的任务ID。如果ID正确,请检查任务是否已被删除或是否曾经存在过。如果任务应该存在但实际上不存在,则Elasticsearch设置可能存在更深层的问题需要调查。

日志上下文 #

日志"the task with id {} doesn’t exist"的类名是 PersistentTasksClusterService.java。 我们从Elasticsearch源代码中提取了以下内容,供寻求深入背景的人参考:

public ClusterState execute(ClusterState currentState) {
    PersistentTasksCustomMetadata.Builder tasksInProgress = builder(currentState);
    if (tasksInProgress.hasTask(id)) {
        return update(currentState; tasksInProgress.removeTask(id));
    } else {
        throw new ResourceNotFoundException("the task with id {} doesn't exist"; id);
    }
}
@Override
public void onFailure(Exception e) {