版本: 6.8-7.15
简而言之,当 Elasticsearch 在搜索操作期间尝试访问不存在的或为 null 的索引时,会出现此错误。这可能是由于索引名称错误、索引已删除或权限不足导致的。要解决此问题,请确保索引存在且名称正确。此外,检查用户权限以确保他们有权访问该索引。如果索引已被删除,请从备份中恢复。如果这些方法都不起作用,则您使用的 Elasticsearch 版本可能存在错误,请考虑升级或降级。
日志上下文 #
日志 “Unexpected null indices access control for search context [” 的类名是 SecuritySearchOperationListener.java。 我们从 Elasticsearch 源代码中提取了以下内容,为那些寻求深入上下文的人提供参考:
void ensureIndicesAccessControlForScrollThreadContext(ReaderContext readerContext) {
if (licenseState.isSecurityEnabled() && readerContext.scrollContext() != null) {
IndicesAccessControl threadIndicesAccessControl =
securityContext.getThreadContext().getTransient(AuthorizationServiceField.INDICES_PERMISSIONS_KEY);
if (null == threadIndicesAccessControl) {
throw new ElasticsearchSecurityException("Unexpected null indices access control for search context ["
+ readerContext.id() + "]");
}
}
}





