zed-industries/zed · error

Missing port forward format

Error message

Missing port forward format

What it means

Thrown while parsing an SSH command line when a `-L` option is given but no forwarding specification follows it (e.g. `-L` is the last token or its attached value is empty). The parser expected a `[bind_address:]port:host:hostport` spec to either follow `-L` as the next token or be glued to it; neither was present, so the port-forward list cannot be built and argument parsing aborts.

Source

Thrown at crates/remote/src/transport/ssh.rs:1704

            }
            if arg == "-l" {
                username = tokens.next();
                continue;
            } else if let Some(l) = arg.strip_prefix("-l") {
                username = Some(l.to_string());
                continue;
            }
            if arg == "-L" || arg.starts_with("-L") {
                let forward_spec = if arg == "-L" {
                    tokens.next()
                } else {
                    Some(arg.strip_prefix("-L").unwrap().to_string())
                };

                if let Some(spec) = forward_spec {
                    port_forwards.push(parse_port_forward_spec(&spec)?);
                } else {
                    anyhow::bail!("Missing port forward format");
                }
            }

            for a in ALLOWED_ARGS {
                if arg == *a {
                    args.push(arg);
                    if let Some(next) = tokens.next() {
                        args.push(next);
                    }
                    continue 'outer;
                } else if arg.starts_with(a) {
                    args.push(arg);
                    continue 'outer;
                }
            }
            if arg.starts_with("-") || hostname.is_some() {
                anyhow::bail!("unsupported argument: {:?}", arg);
            }

View on GitHub (pinned to f4178619ac)

Solutions

  1. Provide a value after -L, e.g. -L 8080:localhost:80
  2. Remove the dangling -L flag from the SSH arguments
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/remote/src/transport/ssh.rs:1704 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/c080629123148cae. Report an issue: GitHub.