{"record":{"id":"4c23154f65bd1d1e","repo":"denoland/deno","slug":"invalid-control-sock","errorCode":null,"errorMessage":"invalid control sock","messagePattern":"invalid control sock","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lib.rs","lineNumber":1268,"sourceCode":"      #[cfg(any(\n        target_os = \"android\",\n        target_os = \"linux\",\n        target_os = \"macos\"\n      ))]\n      Some((\"vsock\", addr)) => {\n        let Some((cid, port)) = addr.split_once(':') else {\n          deno_core::anyhow::bail!(\"invalid vsock addr\");\n        };\n        let cid = if cid == \"-1\" { u32::MAX } else { cid.parse()? };\n        let port = port.parse()?;\n        let addr = VsockAddr::new(cid, port);\n        let listener = VsockListener::bind(addr)?;\n        let (stream, _) = listener.accept().await?;\n        let (rx, tx) = stream.into_split();\n        (Box::new(rx), Box::new(tx))\n      }\n      _ => {\n        deno_core::anyhow::bail!(\"invalid control sock\");\n      }\n    };\n\n    let mut buf = Vec::with_capacity(1024);\n    BufReader::new(rx).read_until(b'\\n', &mut buf).await?;\n\n    tokio::spawn(async move {\n      deno_runtime::deno_http::SERVE_NOTIFIER.notified().await;\n\n      #[derive(deno_core::serde::Serialize)]\n      enum Event {\n        Serving {\n          #[serde(skip_serializing_if = \"Option::is_none\")]\n          kind: Option<&'static str>,\n        },\n      }\n\n      let mut buf = deno_core::serde_json::to_vec(&Event::Serving {","sourceCodeStart":1250,"sourceCodeEnd":1286,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/lib.rs#L1250-L1286","documentation":"The control-socket address from DENO_UNSTABLE_CONTROL_SOCK is dispatched on its scheme prefix (unix:<path>, and vsock:<cid>:<port> on Unix-like platforms). Anything else - an unknown scheme, or a value with no colon at all - falls into the catch-all bail \"invalid control sock\".","triggerScenarios":"DENO_UNSTABLE_CONTROL_SOCK set to a scheme this Deno build does not support (e.g. vsock: on Windows), a bare path without a scheme prefix, or a typo'd scheme.","commonSituations":"Supervisor or IDE integrations passing an unexpected address format; cross-platform scripts using vsock while running on Windows; stale env vars inherited from another tool.","solutions":["Prefix the value with a supported scheme: unix:/path/to.sock or vsock:<cid>:<port> (Unix-like only)","Unset DENO_UNSTABLE_CONTROL_SOCK if the control channel is not intended","Check the platform: the vsock branch is compiled only for android/linux/macos"],"exampleFix":"# before\nDENO_UNSTABLE_CONTROL_SOCK=/run/deno.sock\n\n# after\nDENO_UNSTABLE_CONTROL_SOCK=unix:/run/deno.sock","handlingStrategy":"validation","validationCode":"// Validate the env var before launching\nfunction validControlSock(v: string): boolean {\n  const schemes = Deno.build.os === \"windows\" ? [\"unix\"] : [\"unix\", \"vsock\"];\n  const scheme = v.split(\":\")[0];\n  return v.includes(\":\") && schemes.includes(scheme);\n}\nif (!validControlSock(addr)) {\n  throw new Error(`invalid control sock \"${addr}\" - expected unix:<path> or vsock:<cid>:<port>`);\n}","typeGuard":"const isControlSock = (v: string): boolean =>\n  /^(unix:|vsock:-1|vsock:\\d+:\\d+)/.test(v);","tryCatchPattern":null,"preventionTips":["Always set a scheme prefix on DENO_UNSTABLE_CONTROL_SOCK","Check platform support (vsock is Unix-like only) before choosing the scheme","Unset the variable in environments that do not supervise Deno over a control channel"],"tags":["control-socket","env-var","address-format","scheme"],"backgroundTag":"invalid-socket-address","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"}