{"record":{"id":"429f1a84e57fb0c1","repo":"shadowsocks/shadowsocks-rust","slug":"acl-loading-failed","errorCode":null,"errorMessage":"acl loading failed","messagePattern":"acl loading failed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/shadowsocks-service/src/config.rs","lineNumber":2087,"sourceCode":"                                        return Err(err);\n                                    }\n                                }\n                            }\n                            if let Some(p) = local.fake_dns_database_path {\n                                local_config.fake_dns_database_path = Some(p.into());\n                            }\n                        }\n\n                        let mut local_instance = LocalInstanceConfig {\n                            config: local_config,\n                            acl: None,\n                        };\n\n                        if let Some(acl_path) = local.acl {\n                            let acl = match AccessControl::load_from_file(&acl_path) {\n                                Ok(acl) => acl,\n                                Err(err) => {\n                                    let err = Error::new(\n                                        ErrorKind::Invalid,\n                                        \"acl loading failed\",\n                                        Some(format!(\"file {acl_path}, error: {err}\")),\n                                    );\n                                    return Err(err);\n                                }\n                            };\n                            local_instance.acl = Some(acl);\n                        }\n\n                        nconfig.local.push(local_instance);\n                    }\n                }\n            }\n            ConfigType::Server | ConfigType::Manager => {\n                // NOTE: IGNORED.\n                // servers only uses `local_address` for binding outbound interfaces\n                //","sourceCodeStart":2069,"sourceCodeEnd":2105,"githubUrl":"https://github.com/shadowsocks/shadowsocks-rust/blob/8eb0f0a65b1d976ab6bed5787327ef86529b0435/crates/shadowsocks-service/src/config.rs#L2069-L2105","documentation":"Thrown when a local config references an ACL file via `acl`, and AccessControl::load_from_file fails. The original error (IO, syntax, etc.) is wrapped in ErrorKind::Invalid with the file path and underlying error message.","triggerScenarios":"Config parsing with `acl` set to a path that does not exist, is unreadable (permissions), or contains lines the ACL parser rejects (bad rule syntax, invalid IP/CIDR entries, malformed regex lines).","commonSituations":"Typo in the ACL file path; file deleted or moved; running the service as a user without read permission; hand-edited ACL file with an invalid rule line; relative path resolved from an unexpected working directory.","solutions":["Verify the path in `acl` exists and is readable (check with `ls -l` / try reading it)","Fix the reported syntax error inside the ACL file shown in the wrapped error message","Use an absolute path to avoid working-directory issues","Remove the `acl` field if ACL filtering is not needed"],"exampleFix":"// before\n{\"acl\": \"./acl.txt\"}  // file missing\n// after\n{\"acl\": \"/etc/shadowsocks/acl.txt\"}  // absolute, existing path","handlingStrategy":"try-catch","validationCode":"let path = Path::new(acl_path);\nassert!(path.exists(), \"ACL file missing: {}\", acl_path);\nassert!(File::open(path).is_ok(), \"ACL file unreadable: {}\", acl_path);","typeGuard":null,"tryCatchPattern":"match AccessControl::load_from_file(&acl_path) {\n    Ok(acl) => acl,\n    Err(e) => { log::error!(\"ACL {} failed: {e}\", acl_path); return; }\n}","preventionTips":["Use absolute ACL paths","Ship ACL files with the service and verify with a startup health check","Validate ACL rule syntax after every manual edit"],"tags":["acl","config","file"],"backgroundTag":"file-read-failed","analyzedSha":"8eb0f0a65b1d976ab6bed5787327ef86529b0435","analyzedAt":"2026-09-09T12:20:43.168Z","contentChangedAt":"2026-09-09T12:20:43.168Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}