--- title: "没有ID为calendarId的日历 – 如何解决此Elasticsearch异常" date: 2026-01-21 lastmod: 2026-01-21 description: "当Elasticsearch尝试访问特定ID的日历时无法找到该日历而引发的异常,通常由于日历已删除、未创建或ID错误导致" tags: ["日历", "资源未找到异常", "索引管理"] summary: " 版本: 6.8-8.9 简而言之,当Elasticsearch尝试访问具有特定ID的日历时找不到该日历,就会发生此错误。这可能是由于日历已被删除、尚未创建,或者ID不正确。要解决此问题,您可以验证日历ID是否正确,检查日历是否存在,或者如果不存在则使用指定的ID创建新日历。 日志上下文 # 日志"No calendar with id [" + calendarId + “]“的类名是 TransportDeleteCalendarAction.java。我们从Elasticsearch源代码中提取了以下内容,供那些需要深入了解上下文的人参考: ActionListenercalendarListener = ActionListener.wrap(calendar -> { // 删除日历和事件 DeleteByQueryRequest dbqRequest = buildDeleteByQuery(calendarId); executeAsyncWithOrigin(client; ML_ORIGIN; DeleteByQueryAction.INSTANCE; dbqRequest; ActionListener.wrap(response -> { if (response.getDeleted() == 0) { listener.onFailure(new ResourceNotFoundException("No calendar with id [" + calendarId + "]")); return; } jobManager.updateProcessOnCalendarChanged( calendar.getJobIds(); " --- > **版本:** 6.8-8.9 简而言之,当Elasticsearch尝试访问具有特定ID的日历时找不到该日历,就会发生此错误。这可能是由于日历已被删除、尚未创建,或者ID不正确。要解决此问题,您可以验证日历ID是否正确,检查日历是否存在,或者如果不存在则使用指定的ID创建新日历。 日志上下文 ----------- 日志"No calendar with id [" + calendarId + "]"的类名是[TransportDeleteCalendarAction.java](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/)。我们从Elasticsearch源代码中提取了以下内容,供那些需要深入了解上下文的人参考: ```java ActionListenercalendarListener = ActionListener.wrap(calendar -> { // 删除日历和事件 DeleteByQueryRequest dbqRequest = buildDeleteByQuery(calendarId); executeAsyncWithOrigin(client; ML_ORIGIN; DeleteByQueryAction.INSTANCE; dbqRequest; ActionListener.wrap(response -> { if (response.getDeleted() == 0) { listener.onFailure(new ResourceNotFoundException("No calendar with id [" + calendarId + "]")); return; } jobManager.updateProcessOnCalendarChanged( calendar.getJobIds(); ```