zed-industries/zed · error · anyhow::Error
Failed to create iopub connection: {}. Is `ipykernel` instal
Error message
Failed to create iopub connection: {}. Is `ipykernel` installed in the remote environment? Try running `pip install ipykernel` on the remote host. What it means
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.
Source
Thrown at crates/repl/src/kernels/ssh_kernel.rs:227
let connection_info_struct: runtimelib::ConnectionInfo =
serde_json::from_value(local_connection_info)?;
let session_id = uuid::Uuid::new_v4().to_string();
let output_socket = {
let max_retries = 5;
let mut retry = 0;
loop {
match runtimelib::create_client_iopub_connection(
&connection_info_struct,
"",
&session_id,
)
.await
{
Ok(socket) => break socket,
Err(err) => {
if retry >= max_retries {
anyhow::bail!(
"Failed to create iopub connection: {}. Is `ipykernel` installed in the remote environment? Try running `pip install ipykernel` on the remote host.",
err
);
}
log::debug!(
"Retrying iopub connection (attempt {}/{})",
retry + 1,
max_retries
);
cx.background_executor()
.timer(std::time::Duration::from_millis(200 << retry))
.await;
retry += 1;
}
}
}
};
View on GitHub (pinned to f4178619ac)
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
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at crates/repl/src/kernels/ssh_kernel.rs:227 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/0a15733fbb1c002d.
Report an issue: GitHub.