{"record":{"id":"6d550ce6e1fdfa26","repo":"shadowsocks/shadowsocks-rust","slug":"missing-manager-config","errorCode":null,"errorMessage":"missing manager config","messagePattern":"missing manager config","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/shadowsocks-service/src/manager/mod.rs","lineNumber":34,"sourceCode":"pub use self::server::{Manager, ManagerBuilder};\n\npub mod server;\n\n/// Starts a manager server\npub async fn run(config: Config) -> io::Result<()> {\n    assert_eq!(config.config_type, ConfigType::Manager);\n\n    trace!(\"{:?}\", config);\n\n    #[cfg(all(unix, not(target_os = \"android\")))]\n    if let Some(nofile) = config.nofile {\n        use crate::sys::set_nofile;\n        if let Err(err) = set_nofile(nofile) {\n            log::warn!(\"set_nofile {} failed, error: {}\", nofile, err);\n        }\n    }\n\n    let mut manager_builder = ManagerBuilder::new(config.manager.expect(\"missing manager config\"));\n\n    let mut connect_opts = ConnectOpts {\n        #[cfg(any(target_os = \"linux\", target_os = \"android\"))]\n        fwmark: config.outbound_fwmark,\n        #[cfg(target_os = \"freebsd\")]\n        user_cookie: config.outbound_user_cookie,\n\n        #[cfg(target_os = \"android\")]\n        vpn_protect_path: config.outbound_vpn_protect_path,\n\n        bind_local_addr: config.outbound_bind_addr.map(|ip| SocketAddr::new(ip, 0)),\n        bind_interface: config.outbound_bind_interface,\n\n        ..Default::default()\n    };\n\n    connect_opts.tcp.send_buffer_size = config.outbound_send_buffer_size;\n    connect_opts.tcp.recv_buffer_size = config.outbound_recv_buffer_size;","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/shadowsocks/shadowsocks-rust/blob/8eb0f0a65b1d976ab6bed5787327ef86529b0435/crates/shadowsocks-service/src/manager/mod.rs#L16-L52","documentation":"This panic occurs in the shadowsocks service launcher when config.manager is None but the 'manager' mode was requested. The code unconditionally unwraps config.manager with expect(), so a configuration that lacks the [manager] section cannot start the manager service. It is a fail-fast assertion that the manager config section is mandatory for manager-mode runs.","triggerScenarios":"Running the shadowsocks manager service (e.g. `sslocal`/`ssserver` with --manager-address or manager mode) with a config file that has no `manager` object, or launching manager mode programmatically via ServerConfig/Config built without setting the manager field.","commonSituations":"Users copy a plain server config and add only the manager CLI flag; config migration dropping the manager section; hand-written JSON/TOML missing `manager.address`; running the binary with manager flags pointing at a config generated for client mode.","solutions":["Add the required `manager` section to the config file, e.g. {\"manager\": {\"address\": \"127.0.0.1:5300\"}}","If using CLI flags, ensure --manager-address is passed together with a config that contains manager settings","Validate the config before starting (serde should have a required field or a custom validator) so the process fails with a clear message instead of a panic","If manager mode was not intended, remove the manager flags/mode and run in normal server mode"],"exampleFix":"// before (config.json without manager)\n{ \"server\": \"127.0.0.1:8388\", \"password\": \"pw\", \"method\": \"aes-256-gcm\" }\n// after\n{ \"server\": \"127.0.0.1:8388\", \"password\": \"pw\", \"method\": \"aes-256-gcm\", \"manager\": { \"address\": \"127.0.0.1:5300\" } }","handlingStrategy":"validation","validationCode":"if config.manager.is_none() {\n    return Err(anyhow!(\"missing manager config: add a \\\"manager\\\": {\\\"address\\\": ...} section\"));\n}","typeGuard":"fn has_manager_config(config: &Config) -> bool { config.manager.is_some() }","tryCatchPattern":null,"preventionTips":["Always include the manager section when running in manager mode","Validate the config file (serde required fields) before launching","Keep a known-good manager config template"],"tags":["rust","config","panic","shadowsocks"],"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"}