{"record":{"id":"ba6e7356df7a83f1","repo":"shadowsocks/shadowsocks-rust","slug":"password-is-required","errorCode":null,"errorMessage":"`password` is required","messagePattern":"`password` is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/shadowsocks-service/src/config.rs","lineNumber":2168,"sourceCode":"                    Ok(m) => m,\n                    Err(..) => {\n                        let err = Error::new(\n                            ErrorKind::Invalid,\n                            \"unsupported method\",\n                            Some(format!(\"`{m}` is not a supported method\")),\n                        );\n                        return Err(err);\n                    }\n                };\n\n                // Only \"password\" support getting from environment variable.\n                let password = match pwd_opt {\n                    Some(ref pwd) => read_variable_field_value(pwd),\n                    None => {\n                        if method.is_none() {\n                            String::new().into()\n                        } else {\n                            let err = Error::new(\n                                ErrorKind::MissingField,\n                                \"`password` is required\",\n                                Some(format!(\"`password` is required for method {method}\")),\n                            );\n                            return Err(err);\n                        }\n                    }\n                };\n\n                let mut nsvr = match ServerConfig::new(addr, password, method) {\n                    Ok(svr) => svr,\n                    Err(serr) => {\n                        let err = Error::new(\n                            ErrorKind::Malformed,\n                            \"server config create failed\",\n                            Some(format!(\"{}\", serr)),\n                        );\n                        return Err(err);","sourceCodeStart":2150,"sourceCodeEnd":2186,"githubUrl":"https://github.com/shadowsocks/shadowsocks-rust/blob/8eb0f0a65b1d976ab6bed5787327ef86529b0435/crates/shadowsocks-service/src/config.rs#L2150-L2186","documentation":"Thrown when parsing a SIP008/JSON server entry: a `method` is present but the `password` field is missing. Per the code, an absent password is only allowed when no method is set (empty method implies empty password); otherwise ErrorKind::MissingField is returned naming the required method.","triggerScenarios":"Config parsing of a server object that sets `method` (e.g. `aes-256-gcm`) but omits `password`, or sets it to null.","commonSituations":"SIP008 JSON from a provider missing per-server passwords; hand-trimmed config files where the password line was deleted; templates with placeholder passwords removed but method kept.","solutions":["Add a `password` field to the server entry","If the server truly has no auth, remove the `method` field entirely (then empty password is allowed)","Check the upstream SIP008 provider for an updated document with passwords filled in"],"exampleFix":"// before\n{\"server\": \"1.2.3.4\", \"server_port\": 8388, \"method\": \"aes-256-gcm\"}\n// after\n{\"server\": \"1.2.3.4\", \"server_port\": 8388, \"method\": \"aes-256-gcm\", \"password\": \"secret\"}","handlingStrategy":"validation","validationCode":"// before load, for each server object:\nif obj.get(\"method\").is_some() && obj.get(\"password\").is_none() {\n    return Err(\"password is required when method is set\");\n}","typeGuard":null,"tryCatchPattern":"match Config::load_from_json(...) { Err(e) if format!(\"{e}\").contains(\"password\") => fill_passwords_and_retry(), ... }","preventionTips":["Validate SIP008 JSON against the official schema (which requires password)","Keep passwords in env/secret stores and inject before loading","Never strip password fields when trimming configs"],"tags":["config","sip008","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"8eb0f0a65b1d976ab6bed5787327ef86529b0435","analyzedAt":"2026-09-09T12:20:43.168Z","contentChangedAt":"2026-09-09T12:20:43.168Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}