{"record":{"id":"893db71b194cbf92","repo":"microsoft/garnet","slug":"cannot-find-acl-configuration-file-aclconfigurat","errorCode":null,"errorMessage":"Cannot find ACL configuration file '{aclConfigurationFile}'","messagePattern":"Cannot find ACL configuration file '(.+?)'","errorType":"exception","errorClass":"ACLException","httpStatus":null,"severity":"error","filePath":"libs/server/ACL/AccessControlList.cs","lineNumber":179,"sourceCode":"                    // If AddUser failed, continue looping to retrieve the concurrently created user\n                }\n            }\n            return defaultUserHandle;\n        }\n\n        /// <summary>\n        /// Loads the given ACL configuration file and replaces all currently defined rules in this ACL.\n        /// If the given ACL file contains errors, the old rules remain unmodified.\n        /// </summary>\n        /// <param name=\"defaultPassword\">The password for the default user (if not defined in ACL configuration file)</param>\n        /// <param name=\"aclConfigurationFile\">ACL configuration file.</param>\n        /// <exception cref=\"ACLException\">Thrown if configuration file cannot be parsed.</exception>\n        public void Load(string defaultPassword, string aclConfigurationFile)\n        {\n            // Attempt to load ACL configuration file\n            if (!File.Exists(aclConfigurationFile))\n            {\n                throw new ACLException($\"Cannot find ACL configuration file '{aclConfigurationFile}'\");\n            }\n\n            // Import file into a new temporary access control list to guarantee atomicity\n            AccessControlList acl = new();\n            StreamReader streamReader;\n\n            try\n            {\n                streamReader = new StreamReader(File.OpenRead(aclConfigurationFile), Encoding.UTF8, true);\n            }\n            catch\n            {\n                throw new ACLException($\"Unable to open ACL configuration file '{aclConfigurationFile}'\");\n            }\n\n            // Remove default user and load statements\n            try\n            {","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/microsoft/garnet/blob/951b0fc6838721f89d102c2bbe1b914e8d39d700/libs/server/ACL/AccessControlList.cs#L161-L197","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nacl.Load(defaultPassword, aclFile);\n\n// after\nif (File.Exists(aclFile))\n    acl.Load(defaultPassword, aclFile);\nelse\n    logger.LogWarning(\"ACL file not found at {Path}; using default user only\", aclFile);","handlingStrategy":"validation","validationCode":"if (!File.Exists(aclConfigurationFile))\n    throw new FileNotFoundException(\"ACL configuration file not found.\", aclConfigurationFile);","typeGuard":"static bool AclFilePresent(string path) => File.Exists(path);","tryCatchPattern":"try { acl.Load(defaultPassword, aclConfigurationFile); }\ncatch (ACLException ex) when (ex.Message.Contains(\"Cannot find\")) { /* fall back to default user only */ }","preventionTips":["Use an absolute path for the ACL file.","Branch on File.Exists if the file is optional.","Check filename casing on case-sensitive filesystems."],"tags":["acl","configuration","filesystem","file-not-found"],"backgroundTag":null,"analyzedSha":"951b0fc6838721f89d102c2bbe1b914e8d39d700","analyzedAt":"2026-08-13T19:01:32.939Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}