{"record":{"id":"466d583230608f63","repo":"zed-industries/zed","slug":"remote-server-exited-with-status-status","errorCode":null,"errorMessage":"Remote server exited with status {status}","messagePattern":"Remote server exited with status (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/remote/src/transport/docker.rs","lineNumber":743,"sourceCode":"        let Ok(child) = command.spawn() else {\n            return Task::ready(Err(anyhow::anyhow!(\n                \"Failed to start remote server process\"\n            )));\n        };\n\n        let mut proxy_process = self.proxy_process.lock();\n        *proxy_process = Some(child.id());\n\n        cx.spawn(async move |cx| {\n            super::handle_rpc_messages_over_child_process_stdio(\n                child,\n                incoming_tx,\n                outgoing_rx,\n                connection_activity_tx,\n                cx,\n            )\n            .await\n            .and_then(|status| {\n                if status != 0 {\n                    anyhow::bail!(\"Remote server exited with status {status}\");\n                }\n                Ok(0)\n            })\n        })\n    }\n\n    fn upload_directory(\n        &self,\n        src_path: PathBuf,\n        dest_path: RemotePathBuf,\n        cx: &App,\n    ) -> Task<Result<()>> {\n        let dest_path_str = dest_path.to_string();\n        let src_path_display = src_path.display().to_string();\n\n        let upload_task = Self::upload_and_chown(","sourceCodeStart":725,"sourceCodeEnd":761,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/remote/src/transport/docker.rs#L725-L761","documentation":"Once the remote server is started in the container, Zed multiplexes RPC messages over its stdio; when the child terminates, the status is compared against 0 and any non-zero exit surfaces as this error. The number is zed-remote-server's raw exit status, meaning the server process itself died after launch.","triggerScenarios":"handle_rpc_messages_over_child_process_stdio observes the child exit with status != 0: dynamic linker failures (glibc/musl mismatch), wrong architecture binary, missing shared libraries, immediate crash on startup, or the container OOM-killing the process.","commonSituations":"x86_64 server binary inside an arm64 container (or vice versa, e.g. Apple Silicon host with amd64 image); very old glibc in the base image versus a newly built server; scratch images with no libc; container memory limits killing the server mid-session.","solutions":["Run the binary directly in the container to see the loader/runtime error: `docker exec -it <id> <server_path> version` (or `ldd <server_path>`)","Match architectures: pull the image for the container's real platform (`docker run --platform linux/arm64 ...`) or upload the matching server build","Use a base image with a recent glibc or musl (debian bookworm, alpine) rather than ancient or empty bases","Check whether the OOM killer terminated it: `docker inspect <id>` for OOMKilled, and raise the memory limit"],"exampleFix":"# before: amd64 image on arm64 host\nFROM debian:bullseye\n\n# after: match container platform to host/server build\nFROM --platform=linux/arm64 debian:bookworm","handlingStrategy":"try-catch","validationCode":"async fn server_binary_runs(conn: &DockerExecConnection, path: &str) -> bool {\n    conn.run_docker_exec(path, None, &Default::default(), &[\"version\"])\n        .await\n        .is_ok()\n}","typeGuard":null,"tryCatchPattern":"match rpc_task.await {\n    Err(e) => {\n        let msg = e.to_string();\n        if let Some(status) = msg.strip_prefix(\"Remote server exited with status \") {\n            // capture container logs / dmesg for OOM, run the binary manually to get the loader error\n        }\n        Err(e)\n    }\n    ok => ok,\n}","preventionTips":["Match the server binary arch to the container platform before connecting","Use base images with a recent glibc/musl","Set sane container memory limits and monitor OOMKilled so the server is not killed"],"tags":["docker","remote-server","process-exit","crash"],"backgroundTag":"remote-server-crash","analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}