{"record":{"id":"9901bc5a8c7fd462","repo":"tinyhumansai/openhuman","slug":"missing-value-for-port","errorCode":null,"errorMessage":"missing value for --port","messagePattern":"missing value for --port","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/core/cli.rs","lineNumber":374,"sourceCode":"/// # Arguments\n///\n/// * `args` - Command-line arguments for the `run` command (e.g., `--port`).\nfn run_server_command(args: &[String]) -> Result<()> {\n    let mut port: Option<u16> = None;\n    let mut host: Option<String> = None;\n    let mut socketio_enabled = true;\n    let mut headless_api = false;\n    let mut verbose = false;\n    let log_scope = CliLogDefault::Global;\n    let mut i = 0usize;\n\n    // Manual argument parsing loop for specific flags.\n    while i < args.len() {\n        match args[i].as_str() {\n            \"--port\" => {\n                let raw = args\n                    .get(i + 1)\n                    .ok_or_else(|| anyhow::anyhow!(\"missing value for --port\"))?;\n                port = Some(\n                    raw.parse::<u16>()\n                        .map_err(|e| anyhow::anyhow!(\"invalid --port: {e}\"))?,\n                );\n                i += 2;\n            }\n            \"--host\" => {\n                host = Some(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow::anyhow!(\"missing value for --host\"))?\n                        .clone(),\n                );\n                i += 2;\n            }\n            \"--jsonrpc-only\" => {\n                socketio_enabled = false;\n                i += 1;\n            }","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/core/cli.rs#L356-L392","documentation":"CLI argument parsing in run_server_command: `--port` was given with no following value. Usage error only — pass a u16, e.g. `--port 7788` (the default from OPENHUMAN_CORE_PORT when the flag is omitted); the server never starts on this error.","triggerScenarios":"Thrown at src/core/cli.rs:374 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Append a port value, e.g. `openhuman run --port 7788`","Omit --port to use the default (7788 or OPENHUMAN_CORE_PORT)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}