zed-industries/zed · error · anyhow::Error

Missing 'connection_file' in argv in kernelspec

Error message

Missing 'connection_file' in argv in kernelspec {}

What it means

Guard in LocalKernelSpecification::command(): the kernelspec argv contains no {connection_file} placeholder. Without it the kernel process would never receive the path to Zed's connection file and could not attach to the session, so command building is rejected.

Solutions

  1. Fix the kernelspec argv to include {connection_file}
  2. Reinstall the kernel package
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/repl/src/kernels/native_kernel.rs:49 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/11d3e5bac6d6a1d5. Report an issue: GitHub.

Appendix: source

Thrown at crates/repl/src/kernels/native_kernel.rs:49

    pub kernelspec: JupyterKernelspec,
}

impl PartialEq for LocalKernelSpecification {
    fn eq(&self, other: &Self) -> bool {
        self.name == other.name && self.path == other.path
    }
}

impl Eq for LocalKernelSpecification {}

impl LocalKernelSpecification {
    #[must_use]
    fn command(&self, connection_path: &PathBuf) -> Result<std::process::Command> {
        let argv = &self.kernelspec.argv;

        anyhow::ensure!(!argv.is_empty(), "Empty argv in kernelspec {}", self.name);
        anyhow::ensure!(argv.len() >= 2, "Invalid argv in kernelspec {}", self.name);
        anyhow::ensure!(
            argv.iter().any(|arg| arg == "{connection_file}"),
            "Missing 'connection_file' in argv in kernelspec {}",
            self.name
        );

        let mut cmd = util::command::new_std_command(&argv[0]);

        for arg in &argv[1..] {
            if arg == "{connection_file}" {
                cmd.arg(connection_path);
            } else {
                cmd.arg(arg);
            }
        }

        if let Some(env) = &self.kernelspec.env {
            log::info!(
                "LocalKernelSpecification: applying env to command: {:?}",

View on GitHub (pinned to f4178619ac)