{"record":{"id":"714ca7fb78a0922b","repo":"denoland/deno","slug":"failure-from-control-sock-e","errorCode":null,"errorMessage":"Failure from control sock: {e}","messagePattern":"Failure from control sock: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lib.rs","lineNumber":910,"sourceCode":"\n  let args: Vec<_> = env::args_os().collect();\n  // If we were invoked through a `node` shim (a symlink/hardlink named `node`\n  // pointing at this binary), translate the Node.js CLI args to Deno args.\n  // Done here, before any threads are spawned, because it may set env vars.\n  let args = node_compat_shim::maybe_rewrite_node_arg0(args);\n  let future = async move {\n    let roots = LibWorkerFactoryRoots::default();\n\n    #[cfg(unix)]\n    let (waited_unconfigured_runtime, waited_args, waited_cwd) =\n      match wait_for_start(&args, roots.clone()) {\n        Some(f) => match f.await {\n          Ok(v) => match v {\n            Some((u, a, c)) => (Some(u), Some(a), Some(c)),\n            None => (None, None, None),\n          },\n          Err(e) => {\n            panic!(\"Failure from control sock: {e}\");\n          }\n        },\n        None => (None, None, None),\n      };\n\n    #[cfg(not(unix))]\n    let (waited_unconfigured_runtime, waited_args, waited_cwd) =\n      (None, None, None);\n\n    let args = waited_args.unwrap_or(args);\n    #[allow(\n      clippy::disallowed_methods,\n      reason = \"ok because initialization of cwd\"\n    )]\n    let initial_cwd =\n      waited_cwd\n        .map(Some)\n        .unwrap_or_else(|| match std::env::current_dir() {","sourceCodeStart":892,"sourceCodeEnd":928,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/lib.rs#L892-L928","documentation":"Runtime panic in cli/lib.rs main(). When the experimental DENO_UNSTABLE_CONTROL_SOCK env var is set, deno connects to a control socket (unix socket or vsock) and waits for start instructions (runtime config, args, cwd) from a supervisor before booting. If the socket future returns an error — connection refused, peer closed, bad handshake — deno panics with the io error appended.","triggerScenarios":"Launching deno with DENO_UNSTABLE_CONTROL_SOCK=<addr> where no supervisor is listening, the socket path is wrong, the supervisor dies mid-handshake, or the vsock/unix socket read/write fails. Unix only.","commonSituations":"Experimenting with the unstable control-socket launcher feature without a matching supervisor process; a supervisor crash leaving orphaned deno children holding the env var; stale socket files from a previous run.","solutions":["Ensure the control-socket supervisor is started and listening before launching deno, and that the address in DENO_UNSTABLE_CONTROL_SOCK matches exactly","If you did not intend to use this experimental feature, unset the variable and relaunch: `env -u DENO_UNSTABLE_CONTROL_SOCK deno run script.ts`","Remove stale socket files and confirm the supervisor writes correct handshake frames (the panic message contains the exact io error)"],"exampleFix":"# before\nDENO_UNSTABLE_CONTROL_SOCK=/tmp/deno.sock deno run app.ts   # no listener\n# after\nmy-supervisor --sock /tmp/deno.sock &\nDENO_UNSTABLE_CONTROL_SOCK=/tmp/deno.sock deno run app.ts","handlingStrategy":"validation","validationCode":"# only pass the env var when the supervisor socket exists and accepts connections\nif [ -n \"${DENO_UNSTABLE_CONTROL_SOCK:-}\" ]; then\n  [ -S \"$DENO_UNSTABLE_CONTROL_SOCK\" ] || { echo 'control sock missing'; exit 2; }\n  (exec 3<>\"$DENO_UNSTABLE_CONTROL_SOCK\") || { echo 'control sock not connectable'; exit 2; }\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Launch the supervisor first and probe the socket before spawning deno with the env var","Never leave DENO_UNSTABLE_CONTROL_SOCK exported globally; pass it per-process","Treat the control-sock launcher as experimental: pin exact supervisor and deno versions together"],"tags":["control-socket","unix-socket","unstable","startup-crash","env-var"],"backgroundTag":"socket-connection-failed","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}