{"record":{"id":"762308e6ac71806e","repo":"zed-industries/zed","slug":"wsl-kernel-process-exited-prematurely-with-status","errorCode":null,"errorMessage":"WSL kernel process exited prematurely with status: {:?}\\nstderr: {}\\nstdout: {}","messagePattern":"WSL kernel process exited prematurely with status: (.+?)\\\\nstderr: (.+?)\\\\nstdout: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/repl/src/kernels/wsl_kernel.rs","lineNumber":314,"sourceCode":"                    let mut stderr_content = String::new();\n                    if let Some(mut stderr) = process.stderr.take() {\n                        use futures::AsyncReadExt;\n                        let mut buf = Vec::new();\n                        if stderr.read_to_end(&mut buf).await.is_ok() {\n                            stderr_content = String::from_utf8_lossy(&buf).to_string();\n                        }\n                    }\n\n                    let mut stdout_content = String::new();\n                    if let Some(mut stdout) = process.stdout.take() {\n                        use futures::AsyncReadExt;\n                        let mut buf = Vec::new();\n                        if stdout.read_to_end(&mut buf).await.is_ok() {\n                            stdout_content = String::from_utf8_lossy(&buf).to_string();\n                        }\n                    }\n\n                    anyhow::bail!(\n                        \"WSL kernel process exited prematurely with status: {:?}\\nstderr: {}\\nstdout: {}\",\n                        status,\n                        stderr_content,\n                        stdout_content\n                    );\n                }\n                Ok(None) => {}\n                Err(_) => {}\n            }\n\n            let output_socket = runtimelib::create_client_iopub_connection(\n                &client_connection_info,\n                \"\",\n                &session_id,\n            )\n            .await\n            .context(\"Failed to create iopub connection. Is `ipykernel` installed in the WSL environment? Try running `pip install ipykernel` inside your WSL distribution.\")?;\n","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/repl/src/kernels/wsl_kernel.rs#L296-L332","documentation":"Raised in the WSL kernel constructor when the spawned `wsl` kernel process terminates before the connection is established. The exit status plus captured stderr/stdout are included so the user can see why the kernel (e.g. missing Python or bad argv inside the distro) died immediately.","triggerScenarios":"Thrown at crates/repl/src/kernels/wsl_kernel.rs:314 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the captured stderr/stdout in the error to find the kernel's startup failure","Verify python/ipykernel are installed in the WSL distribution","Check that jupyter runtime connection files are writable","Reinstall the kernel and retry"],"exampleFix":null,"handlingStrategy":"try-catch","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-14T00:17:10.932Z"}