shadowsocks/shadowsocks-rust · critical

missing `manager_addr` and `manager_port` in configuration

Error message

missing `manager_addr` and `manager_port` in configuration

What it means

A manager-type configuration (ssserver --manager-address mode) requires manager_addr and manager_port to be set, exposed as the manager field. If config_type is Manager but no manager address was provided, Config::check returns this ErrorKind::MissingField error.

Source

Thrown at crates/shadowsocks-service/src/config.rs:2901

                ErrorKind::MissingField,
                "missing any valid servers in configuration",
                None,
            );
            return Err(err);
        }

        #[cfg(feature = "local-online-config")]
        if self.config_type.is_online_config() && self.server.is_empty() {
            let err = Error::new(
                ErrorKind::MissingField,
                "missing any valid servers in configuration",
                None,
            );
            return Err(err);
        }

        if self.config_type.is_manager() && self.manager.is_none() {
            let err = Error::new(
                ErrorKind::MissingField,
                "missing `manager_addr` and `manager_port` in configuration",
                None,
            );
            return Err(err);
        }

        for inst in &self.server {
            let server = &inst.config;

            // Plugin shouldn't be an empty string
            if let Some(plugin) = server.plugin()
                && plugin.plugin.trim().is_empty()
            {
                let err = Error::new(ErrorKind::Malformed, "`plugin` shouldn't be an empty string", None);
                return Err(err);
            }

View on GitHub (pinned to 8eb0f0a65b)

Solutions

  1. Add manager_addr and manager_port to the config, or pass --manager-address on the CLI.
  2. Confirm the config_type is actually Manager — if you meant to run a normal server, remove the manager config type.
  3. Check key spelling in your config file (manager_addr / manager_port) and that it sits in the correct section.

Example fix

// before (manager.json)
{ "manager": null, "servers_enabled": true }

// after
{ "manager": { "addr": "127.0.0.1", "port": 8389 }, "servers_enabled": true }
Defensive patterns

Strategy: validation

Validate before calling

// Rust
let cfg: serde_json::Value = serde_json::from_str(&raw)?;
assert!(cfg.get("manager").map_or(false, |m| !m.is_null()), "manager mode requires manager_addr/manager_port");

Try / catch

// Rust
if let Err(e) = ssserver::run(config) {
    if e.to_string().contains("manager_addr") {
        eprintln!("manager mode needs --manager-address or a manager block in the config");
    }
    std::process::exit(1);
}

Prevention

When it happens

Trigger: Starting ssserver in manager mode where the config has manager mode enabled (or is invoked as a manager) but manager_addr/manager_port (or the manager section) is absent from the config file or CLI.

Common situations: Running the manager with only a plain server config; config file migrated from a non-manager setup missing the manager block; typo'd keys like manager_address instead of manager_addr.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of shadowsocks/shadowsocks-rust@8eb0f0a65b (2026-09-09). Data as JSON: /api/errors/e67cc135318cd5e6. Report an issue: GitHub.