{"record":{"id":"a2b0d5f1174ef8cc","repo":"zed-industries/zed","slug":"unknown-uname-uname","errorCode":null,"errorMessage":"unknown uname: {uname:?}","messagePattern":"unknown uname: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/remote/src/transport.rs","lineNumber":29,"sourceCode":"    channel::mpsc::{Sender, UnboundedReceiver, UnboundedSender},\n};\nuse gpui::{AppContext as _, AsyncApp, Task};\nuse rpc::proto::Envelope;\nuse util::command::Child;\n\npub mod docker;\n#[cfg(any(test, feature = \"test-support\"))]\npub mod mock;\npub mod ssh;\npub mod wsl;\n\n/// Parses the output of `uname -sm` to determine the remote platform.\n/// Takes the last line to skip possible shell initialization output.\nfn parse_platform(output: &str) -> Result<RemotePlatform> {\n    let output = output.trim();\n    let uname = output.rsplit_once('\\n').map_or(output, |(_, last)| last);\n    let Some((os, arch)) = uname.split_once(\" \") else {\n        anyhow::bail!(\"unknown uname: {uname:?}\")\n    };\n\n    let os = match os {\n        \"Darwin\" => RemoteOs::MacOs,\n        \"Linux\" => RemoteOs::Linux,\n        _ => anyhow::bail!(\n            \"Prebuilt remote servers are not yet available for {os:?}. See https://zed.dev/docs/remote-development\"\n        ),\n    };\n\n    // exclude armv5,6,7 as they are 32-bit.\n    let arch = if arch.starts_with(\"armv8\")\n        || arch.starts_with(\"armv9\")\n        || arch.starts_with(\"arm64\")\n        || arch.starts_with(\"aarch64\")\n    {\n        RemoteArch::Aarch64\n    } else if arch.starts_with(\"x86\") {","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/remote/src/transport.rs#L11-L47","documentation":"On connect, Zed runs `uname -sm` on the remote host and parse_platform takes the last line of its output (skipping shell-init noise) expecting exactly \"<os> <arch>\" (crates/remote/src/transport.rs:29). If that line contains no space - because uname printed an error, is missing, or something else emitted the last line - parsing bails with \"unknown uname\".","triggerScenarios":"A remote login where the last line of `uname -sm` output is a single token: \"uname: not found\" from a restricted PATH, an error printed by broken shell rc files, or a non-POSIX shell on the remote host.","commonSituations":"Minimal or container hosts without coreutils in the non-interactive PATH; broken .bashrc/.zshrc printing errors; native Windows sshd without WSL; appliances with busybox in an unusual location.","solutions":["SSH in manually and run `uname -sm` - the last line must look like `Linux x86_64`","Fix remote shell init files so non-interactive sessions produce no errors, and ensure `uname` resolves in the default PATH","On Windows remotes, connect to WSL instead of the native host"],"exampleFix":"# before\n$ ssh user@host 'uname -sm'\nuname: command not found\n\n# after (fix PATH in shell init files)\n$ ssh user@host 'uname -sm'\nLinux x86_64","handlingStrategy":"validation","validationCode":"# pre-flight the exact command Zed runs before adding the remote:\nssh user@host 'uname -sm'\n# the last output line must be exactly two tokens, e.g. 'Linux x86_64'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep remote shell rc files quiet and error-free for non-interactive sessions","Verify uname exists in the default non-interactive PATH on managed hosts","Test with `ssh host 'uname -sm'` first; it must print '<os> <arch>' as the last line"],"tags":["ssh","remote","platform-detection","uname","shell"],"backgroundTag":"platform-detection-failed","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}