{"record":{"id":"0a15733fbb1c002d","repo":"zed-industries/zed","slug":"failed-to-create-iopub-connection-is-ipykern","errorCode":null,"errorMessage":"Failed to create iopub connection: {}. Is `ipykernel` installed in the remote environment? Try running `pip install ipykernel` on the remote host.","messagePattern":"Failed to create iopub connection: (.+?)\\. Is `ipykernel` installed in the remote environment\\? Try running `pip install ipykernel` on the remote host\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/repl/src/kernels/ssh_kernel.rs","lineNumber":227,"sourceCode":"            let connection_info_struct: runtimelib::ConnectionInfo =\n                serde_json::from_value(local_connection_info)?;\n            let session_id = uuid::Uuid::new_v4().to_string();\n\n            let output_socket = {\n                let max_retries = 5;\n                let mut retry = 0;\n                loop {\n                    match runtimelib::create_client_iopub_connection(\n                        &connection_info_struct,\n                        \"\",\n                        &session_id,\n                    )\n                    .await\n                    {\n                        Ok(socket) => break socket,\n                        Err(err) => {\n                            if retry >= max_retries {\n                                anyhow::bail!(\n                                    \"Failed to create iopub connection: {}. Is `ipykernel` installed in the remote environment? Try running `pip install ipykernel` on the remote host.\",\n                                    err\n                                );\n                            }\n                            log::debug!(\n                                \"Retrying iopub connection (attempt {}/{})\",\n                                retry + 1,\n                                max_retries\n                            );\n                            cx.background_executor()\n                                .timer(std::time::Duration::from_millis(200 << retry))\n                                .await;\n                            retry += 1;\n                        }\n                    }\n                }\n            };\n","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/repl/src/kernels/ssh_kernel.rs#L209-L245","documentation":"Creating the iopub client connection to the remote kernel failed after retries, almost always because ipykernel is missing in the remote environment; the message tells the user to pip install ipykernel on the remote host.","triggerScenarios":"Thrown at crates/repl/src/kernels/ssh_kernel.rs:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `pip install ipykernel` in the remote environment as the message suggests","Verify the remote kernel process is fully started before connecting","Retry; the connection retries up to 5 times internally before failing"],"exampleFix":null,"handlingStrategy":"retry","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"}