tinyhumansai/openhuman · error · anyhow::Error

invalid --port

Error message

invalid --port: {e}

What it means

CLI argument parsing in run_server_command: the value after `--port` failed u16 parsing (non-numeric or out of 0–65535 range). Usage error; the underlying parse error is embedded in `{e}`. Re-run with a valid port.

Solutions

  1. Use a port in the range 0–65535, e.g. `--port 7788`
  2. Omit --port to use the default (7788 or OPENHUMAN_CORE_PORT)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/cli.rs:377 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/88812dfdec27fc8b. Report an issue: GitHub.

Appendix: source

Thrown at src/core/cli.rs:377

fn run_server_command(args: &[String]) -> Result<()> {
    let mut port: Option<u16> = None;
    let mut host: Option<String> = None;
    let mut socketio_enabled = true;
    let mut headless_api = false;
    let mut verbose = false;
    let log_scope = CliLogDefault::Global;
    let mut i = 0usize;

    // Manual argument parsing loop for specific flags.
    while i < args.len() {
        match args[i].as_str() {
            "--port" => {
                let raw = args
                    .get(i + 1)
                    .ok_or_else(|| anyhow::anyhow!("missing value for --port"))?;
                port = Some(
                    raw.parse::<u16>()
                        .map_err(|e| anyhow::anyhow!("invalid --port: {e}"))?,
                );
                i += 2;
            }
            "--host" => {
                host = Some(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow::anyhow!("missing value for --host"))?
                        .clone(),
                );
                i += 2;
            }
            "--jsonrpc-only" => {
                socketio_enabled = false;
                i += 1;
            }
            "--headless-api" => {
                socketio_enabled = false;
                headless_api = true;

View on GitHub (pinned to 7491200858)