Could not read users file path toAbsolutePath – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch cannot read the users file due to incorrect file path, insufficient permissions, or the file being non-existent. To resolve this, ensure the file path is correct and the file exists. If the path and file are correct, check the file permissions. Elasticsearch should have read access to the file. If the issue persists, it could be due to a corrupted file, in which case, you may need to recreate the file.

This guide will help you check for common problems that cause the log ” could not read users file [” + path.toAbsolutePath() + “] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “could not read users file [” + path.toAbsolutePath() + “]” class name is We extracted the following from Elasticsearch source code for those seeking an in-depth context :

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