{"record":{"id":"b306328d7a0ffc5e","repo":"microsoft/garnet","slug":"exception-message-b30632","errorCode":null,"errorMessage":"{exception.Message}","messagePattern":"\\{exception\\.Message\\}","errorType":"validation","errorClass":"ACLParsingException","httpStatus":null,"severity":"error","filePath":"libs/server/ACL/AccessControlList.cs","lineNumber":284,"sourceCode":"            while ((line = input.ReadLine()) != null)\n            {\n                curLine++;\n\n                // Skip empty lines and comments\n                line = line.Trim();\n                if (line.Length < 1 || line.StartsWith('#'))\n                {\n                    continue;\n                }\n\n                // Parse the ACL rules stored in the line\n                try\n                {\n                    ACLParser.ParseACLRule(line, this);\n                }\n                catch (ACLException exception)\n                {\n                    throw new ACLParsingException(exception.Message, configurationFile, curLine);\n                }\n            }\n        }\n    }\n}","sourceCodeStart":266,"sourceCodeEnd":289,"githubUrl":"https://github.com/microsoft/garnet/blob/951b0fc6838721f89d102c2bbe1b914e8d39d700/libs/server/ACL/AccessControlList.cs#L266-L289","documentation":"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.","triggerScenarios":"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().","commonSituations":"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).","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."],"exampleFix":"// before (line 5 of acl.conf):\n//   user alice on password123\n// after (password must be prefixed with '>'):\n//   user alice on >password123","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    acl.Import(streamReader, configurationFile);\n}\ncatch (ACLParsingException ex)\n{\n    // ex.Filename, ex.Line pinpoint the offending rule\n    logger.LogError(\"ACL parse error at {File}:{Line}: {Msg}\", ex.Filename, ex.Line, ex.Message);\n    throw;\n}","preventionTips":["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."],"tags":["acl","config","parsing"],"backgroundTag":null,"analyzedSha":"951b0fc6838721f89d102c2bbe1b914e8d39d700","analyzedAt":"2026-08-13T19:01:32.939Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}