{"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":null,"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/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/jupyter/mod.rs#L170-L206","documentation":"During `deno jupyter` startup the CLI spawns a dedicated thread that runs the REPL session (an isolated server) and waits on a channel for the isolate handle. This error means the channel sender was dropped before any handle arrived: the REPL thread ended early, almost certainly because session.start() panicked or the thread/runtime failed to spawn. The ZMQ kernel cannot come up in this state, so startup aborts.","triggerScenarios":"`deno jupyter` kernel startup where the spawned REPL thread exits before signaling readiness: a panic inside the session start path, tokio current-thread runtime creation failure, or resource exhaustion (thread/memory caps via ulimit or cgroups).","commonSituations":"Containers with low thread or memory limits; sandboxing (SELinux/seccomp) blocking thread creation; corrupted Deno installs after interrupted upgrades; rarely, Deno bugs in the jupyter subsystem on specific versions.","solutions":["Re-run the command — transient resource exhaustion is the most common cause","Inspect earlier stderr output for a Rust panic message naming the real failure","Raise thread/memory limits (ulimit -u, container cgroup settings) if running under caps","Update to the latest Deno patch release; the jupyter kernel is actively maintained","If it reproduces on current Deno, file an issue with the panic backtrace"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# sanity-check that deno can start a runtime in this environment\ndeno eval 'console.log(\"ok\")' >/dev/null 2>&1 || { echo \"deno runtime broken/exhausted\" >&2; exit 2; }\ndeno jupyter kernel","typeGuard":null,"tryCatchPattern":"// wrapper around the kernel launch: one bounded retry on this transient failure\nimport { spawnSync } from \"node:child_process\";\nconst run = () => spawnSync(\"deno\", [\"jupyter\", \"kernel\"], { stdio: \"inherit\" });\nlet r = run();\nif (r.status !== 0 && /REPL thread failed to start/.test(String(r.stderr))) {\n  r = run(); // transient thread-spawn failures often clear immediately\n}\nprocess.exit(r.status ?? 1);","preventionTips":["Keep kernel launcher scripts tolerant of a single retry at startup","Avoid launching the kernel under severely capped cgroups or low ulimit -u","Pin a known-good Deno version for notebook workloads"],"tags":["jupyter","threading","runtime","startup"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}