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

  1. Inspect the ACLParsingException.FileName and .Line fields (or the outer ACLException message from error 100) to locate the offending line.
  2. Correct the rule syntax on that line to match the parser's supported rule grammar.
  3. Test the file by loading it in a staging instance before deploying to production.
  4. 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

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


AI-assisted analysis of microsoft/garnet@951b0fc683 (2026-08-13). Data as JSON: /api/errors/b306328d7a0ffc5e. Report an issue: GitHub.