microsoft/garnet · error · ACLException
Cannot find ACL configuration file '{aclConfigurationFile}'
Error message
Cannot find ACL configuration file '{aclConfigurationFile}' What it means
Thrown by AccessControlList.Load when File.Exists(aclConfigurationFile) returns false. The configured ACL file path does not point to an existing file, so loading cannot proceed. It is an ACLException (not a parse exception) because the file was never opened.
Source
Thrown at libs/server/ACL/AccessControlList.cs:179
// If AddUser failed, continue looping to retrieve the concurrently created user
}
}
return defaultUserHandle;
}
/// <summary>
/// Loads the given ACL configuration file and replaces all currently defined rules in this ACL.
/// If the given ACL file contains errors, the old rules remain unmodified.
/// </summary>
/// <param name="defaultPassword">The password for the default user (if not defined in ACL configuration file)</param>
/// <param name="aclConfigurationFile">ACL configuration file.</param>
/// <exception cref="ACLException">Thrown if configuration file cannot be parsed.</exception>
public void Load(string defaultPassword, string aclConfigurationFile)
{
// Attempt to load ACL configuration file
if (!File.Exists(aclConfigurationFile))
{
throw new ACLException($"Cannot find ACL configuration file '{aclConfigurationFile}'");
}
// Import file into a new temporary access control list to guarantee atomicity
AccessControlList acl = new();
StreamReader streamReader;
try
{
streamReader = new StreamReader(File.OpenRead(aclConfigurationFile), Encoding.UTF8, true);
}
catch
{
throw new ACLException($"Unable to open ACL configuration file '{aclConfigurationFile}'");
}
// Remove default user and load statements
try
{View on GitHub (pinned to 951b0fc683)
Solutions
- Verify the path exists and is readable before calling Load.
- Use an absolute path for the ACL file.
- If the file is optional, branch on File.Exists and skip Load (falling back to default-user-only ACL) instead of calling it.
- Check filename casing on case-sensitive filesystems.
Example fix
// before
acl.Load(defaultPassword, aclFile);
// after
if (File.Exists(aclFile))
acl.Load(defaultPassword, aclFile);
else
logger.LogWarning("ACL file not found at {Path}; using default user only", aclFile); Defensive patterns
Strategy: validation
Validate before calling
if (!File.Exists(aclConfigurationFile))
throw new FileNotFoundException("ACL configuration file not found.", aclConfigurationFile); Type guard
static bool AclFilePresent(string path) => File.Exists(path);
Try / catch
try { acl.Load(defaultPassword, aclConfigurationFile); }
catch (ACLException ex) when (ex.Message.Contains("Cannot find")) { /* fall back to default user only */ } Prevention
- Use an absolute path for the ACL file.
- Branch on File.Exists if the file is optional.
- Check filename casing on case-sensitive filesystems.
When it happens
Trigger: Passing a path that does not exist on disk; a relative path resolved against an unexpected working directory; a typo in the config key that supplies the ACL file; the file not yet created at first run.
Common situations: First run before any ACL file is generated; a deployment that mounts the config volume at a different path than configured; case-sensitivity on Linux where the filename casing differs.
Related errors
- Unable to open ACL configuration file '{aclConfigurationFile
- Malformed ACL rule
- ACL rules need to start with the USER keyword
- {exception.Message}
- {categoryName}
AI-assisted analysis of microsoft/garnet@951b0fc683 (2026-08-13).
Data as JSON: /api/errors/893db71b194cbf92.
Report an issue: GitHub.