microsoft/garnet · error · ACLParsingException
{exception.Message}
Error message
{exception.Message} What it means
Thrown by the private Import() method when ACLParser.ParseACLRule(line, this) throws an ACLException for a specific line. Import wraps the error in an ACLParsingException that captures the configuration file name and the current 1-based line number. This is the inner error that Load() (error 100) later re-wraps for the public API surface.
Source
Thrown at libs/server/ACL/AccessControlList.cs:284
while ((line = input.ReadLine()) != null)
{
curLine++;
// Skip empty lines and comments
line = line.Trim();
if (line.Length < 1 || line.StartsWith('#'))
{
continue;
}
// Parse the ACL rules stored in the line
try
{
ACLParser.ParseACLRule(line, this);
}
catch (ACLException exception)
{
throw new ACLParsingException(exception.Message, configurationFile, curLine);
}
}
}
}
}View on GitHub (pinned to 951b0fc683)
Solutions
- Inspect the ACLParsingException.FileName and .Line fields (or the outer ACLException message from error 100) to locate the offending line.
- Correct the rule syntax on that line to match the parser's supported rule grammar.
- Test the file by loading it in a staging instance before deploying to production.
- Replace manual edits with ACL SETUSER / SAVE round-trips to guarantee syntactically valid output.
Example fix
// before (line 5 of acl.conf): // user alice on password123 // after (password must be prefixed with '>'): // user alice on >password123
Defensive patterns
Strategy: try-catch
Try / catch
try
{
acl.Import(streamReader, configurationFile);
}
catch (ACLParsingException ex)
{
// ex.Filename, ex.Line pinpoint the offending rule
logger.LogError("ACL parse error at {File}:{Line}: {Msg}", ex.Filename, ex.Line, ex.Message);
throw;
} Prevention
- Catch ACLParsingException at the import boundary to get the exact file and line number.
- Pre-validate ACL rule lines in a lint step before loading.
- Ensure comments use '#' and there are no stray non-rule lines.
When it happens
Trigger: Any line in the ACL configuration stream that fails ParseACLRule: unknown user rule tokens, malformed '+command' / '-command' specifiers, invalid '+@category' names, or password rules with missing '>' prefix. Emitted during both Load() (from file) and any caller that feeds a StreamReader into Import().
Common situations: Manually authored ACL files with subtle syntax errors; mixing Garnet ACL grammar with raw Redis ACL grammar that differs; comments that are not prefixed with '#' (so they are parsed as rules).
Related errors
- Unable to parse ACL rule {exception.Filename}:{exception.Lin
- 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/b306328d7a0ffc5e.
Report an issue: GitHub.