{"record":{"id":"8729f963c9dfbebf","repo":"zed-industries/zed","slug":"invalid-port-forward-format-spec","errorCode":null,"errorMessage":"Invalid port forward format: {spec}","messagePattern":"Invalid port forward format: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/remote/src/transport/ssh.rs","lineNumber":1648,"sourceCode":"            Ok(SshPortForwardOption {\n                local_host: Some(tokens[0].clone()),\n                local_port,\n                remote_host: Some(tokens[2].clone()),\n                remote_port,\n            })\n        }\n        3 => {\n            let local_port = parse_port_number(&tokens[0])?;\n            let remote_port = parse_port_number(&tokens[2])?;\n\n            Ok(SshPortForwardOption {\n                local_host: None,\n                local_port,\n                remote_host: Some(tokens[1].clone()),\n                remote_port,\n            })\n        }\n        _ => anyhow::bail!(\"Invalid port forward format: {spec}\"),\n    }\n}\n\nimpl SshConnectionOptions {\n    pub fn parse_command_line(input: &str) -> Result<Self> {\n        let input = input.trim_start_matches(\"ssh \");\n        let mut hostname: Option<String> = None;\n        let mut username: Option<String> = None;\n        let mut port: Option<u16> = None;\n        let mut args = Vec::new();\n        let mut port_forwards: Vec<SshPortForwardOption> = Vec::new();\n\n        // disallowed: -E, -e, -F, -f, -G, -g, -M, -N, -n, -O, -q, -S, -s, -T, -t, -V, -v, -W\n        const ALLOWED_OPTS: &[&str] = &[\n            \"-4\", \"-6\", \"-A\", \"-a\", \"-C\", \"-K\", \"-k\", \"-X\", \"-x\", \"-Y\", \"-y\",\n        ];\n        const ALLOWED_ARGS: &[&str] = &[\n            \"-B\", \"-b\", \"-c\", \"-D\", \"-F\", \"-I\", \"-i\", \"-J\", \"-l\", \"-m\", \"-o\", \"-P\", \"-p\", \"-R\",","sourceCodeStart":1630,"sourceCodeEnd":1666,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/remote/src/transport/ssh.rs#L1630-L1666","documentation":"Parsing guard for ssh -L/-R forward specs: the spec tokenized to a count outside the supported 1/2/3-token shapes (e.g. too many colons or empty segments), so SshPortForwardOption cannot be constructed.","triggerScenarios":"Thrown at crates/remote/src/transport/ssh.rs:1648 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a standard form: `port`, `host:port`, `local:port:remote:port`, or `host:port:remote:port`","Check for stray colons or empty segments in the forward specification","Remove malformed -L/-R arguments from the SSH options"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}