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

版本: 6.8-8.9

简要来说,当 Elasticsearch 由于文件路径不正确、权限不足或文件不存在而无法读取用户文件时,就会发生此错误。要解决此问题,请确保文件路径正确且文件存在。如果路径和文件都正确,请检查文件权限。Elasticsearch 应该具有对该文件的读取权限。如果问题仍然存在,可能是由于文件损坏导致的,在这种情况下,您可能需要重新创建该文件。

日志上下文 #

日志 “could not read users file [” + path.toAbsolutePath() + “]” 的类名是 FileUserRolesStore.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的用户参考:

List<String> lines;
try {
    lines = Files.readAllLines(path, StandardCharsets.UTF_8);
} catch (IOException ioe) {
    throw new ElasticsearchException("could not read users file [" + path.toAbsolutePath() + "]", ioe);
}
Map<String, Set<String>> userToRoles = new HashMap<>();
int lineNr = 0;