{"record":{"id":"60cfa1bb6651ea53","repo":"denoland/deno","slug":"repl-thread-failed-to-start","errorCode":null,"errorMessage":"REPL thread failed to start","messagePattern":"REPL thread failed to start","errorType":"exception","errorClass":"AnyError","httpStatus":null,"severity":"critical","filePath":"cli/tools/jupyter/mod.rs","lineNumber":188,"sourceCode":"        .thread_safe_handle();\n      let _ = isolate_handle_tx.send(handle);\n\n      // Service REPL requests until channel closes.\n      let mut session = JupyterReplSession {\n        repl_session,\n        rx: repl_req_rx,\n      };\n      session.start().await;\n\n      Ok::<(), AnyError>(())\n    };\n    deno_runtime::tokio_util::create_and_run_current_thread(fut)\n  });\n\n  // Wait for the REPL to be ready.\n  let isolate_handle = isolate_handle_rx\n    .await\n    .map_err(|_| anyhow!(\"REPL thread failed to start\"))?;\n\n  // --- Create the ZMQ kernel worker on the main thread ---------------\n  let kernel_main_module = resolve_url_or_path(\n    \"./$deno$jupyter_kernel.mts\",\n    cli_options.initial_cwd(),\n  )\n  .unwrap();\n\n  let (worker2, _) = create_single_test_event_channel();\n  let TestEventWorkerSender {\n    sender: _test_sender2,\n    stdout: stdout2,\n    stderr: stderr2,\n  } = worker2;\n\n  let cwd_url =\n    Url::from_directory_path(cli_options.initial_cwd()).map_err(|_| {\n      anyhow!(","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/jupyter/mod.rs#L170-L206","documentation":"The Jupyter kernel hosts its REPL runtime on a dedicated OS thread and signals readiness by sending the V8 isolate handle over a channel that the main thread awaits. This error means the channel closed without a send — the REPL thread panicked or exited before ReplSession::initialize() completed (worker creation, setup_repl, script execution, or session init failed inside the thread). The real panic reason is printed by the failing thread, not embedded in this message.","triggerScenarios":"Starting a Jupyter kernel (`deno jupyter` / connecting a notebook to an installed kernel) when the spawned REPL thread dies early: v8/runtime initialization failure, invalid --v8-flags or DENO_V8_FLAGS, resource limits preventing thread or isolate creation (ulimit, container memory caps), or a corrupted/incompatible deno binary.","commonSituations":"Containers or CI with strict thread/memory limits; custom v8 flags that crash at startup; libc mismatch after a system upgrade; corrupted Deno installs; regressions in cutting-edge builds.","solutions":["Run `deno jupyter` directly in a terminal and read the panic the failing thread prints — it names the actual cause","Check resource limits in the failing environment (`ulimit -u`, `ulimit -v`, container memory caps) and raise them if thread/runtime creation is denied","Remove custom v8 flags (DENO_V8_FLAGS / --v8-flags) and retry with defaults","Reinstall or upgrade Deno to rule out a corrupted binary or an already-fixed regression"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// when launching the kernel from your own tooling, treat early exit as the signal\nconst proc = new Deno.Command(DENO_EXE, { args: ['jupyter'], stderr: 'inherit' }).spawn();\nconst status = await proc.status;\nif (!status.success) {\n  // the REPL-thread panic is printed to stderr; surface it instead of retrying blind\n  throw new Error(`kernel exited early (code ${status.code}); see stderr for the panic`);\n}","preventionTips":["Pin a known-good Deno version for notebook use","Avoid custom v8 flags in kernel launches","Verify thread and memory limits before starting kernels in containers","Test `deno jupyter` in a terminal before wiring it into notebooks"],"tags":["jupyter","kernel","thread","startup","v8"],"backgroundTag":"kernel-startup-failed","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}