{"record":{"id":"89992c635ce7a5c0","repo":"denoland/deno","slug":"invalid-vsock-addr","errorCode":null,"errorMessage":"invalid vsock addr","messagePattern":"invalid vsock addr","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lib.rs","lineNumber":1257,"sourceCode":"      Box<dyn AsyncRead + Unpin>,\n      Box<dyn AsyncWrite + Send + Unpin>,\n    ) = match addr.split_once(':') {\n      Some((\"unix\", path)) => {\n        let socket = UnixSocket::new_stream()?;\n        socket.bind(path)?;\n        let listener = socket.listen(1)?;\n        let (stream, _) = listener.accept().await?;\n        let (rx, tx) = stream.into_split();\n        (Box::new(rx), Box::new(tx))\n      }\n      #[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 {","sourceCodeStart":1239,"sourceCodeEnd":1275,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/lib.rs#L1239-L1275","documentation":"cli/lib.rs:1257 validates the unstable DENO_UNSTABLE_CONTROL_SOCK environment variable when Deno boots under an external supervisor. For the \"vsock\" transport it requires the address to be <cid>:<port>; addr.split_once(':') returning None means the value after \"vsock:\" contains no colon at all (e.g. \"vsock:2\"), so Deno bails with \"invalid vsock addr\".","triggerScenarios":"Launching deno with DENO_UNSTABLE_CONTROL_SOCK=vsock:<cid>:<port> but omitting the port segment, e.g. DENO_UNSTABLE_CONTROL_SOCK=\"vsock:3\"; also any vsock value where everything after the scheme is a bare token with no ':' separator.","commonSituations":"Firecracker/QEMU VM setups or cloud sandboxes that hand Deno a vsock control channel via env templating; supervisor config generation that drops the empty port; copying a unix-socket style value (\"vsock:/run/sock\") into a vsock stanza.","solutions":["Set the full address: DENO_UNSTABLE_CONTROL_SOCK=\"vsock:<cid>:<port>\" (e.g. vsock:2:5000); use cid -1 (VMADDR_CID_ANY) for the any address","If you meant a local socket, use the unix transport instead: DENO_UNSTABLE_CONTROL_SOCK=\"unix:/path/to/sock\"","Fix the templating in your supervisor/cloud-init that produces the env value so the port is always present"],"exampleFix":"# before\nDENO_UNSTABLE_CONTROL_SOCK=vsock:2 deno run -RNE --unstable-... main.ts\n\n# after\nDENO_UNSTABLE_CONTROL_SOCK=vsock:2:5000 deno run -RNE --unstable-... main.ts","handlingStrategy":"validation","validationCode":"#!/bin/sh\n# validate before exec'ing deno\nVAL=\"$DENO_UNSTABLE_CONTROL_SOCK\"\ncase \"$VAL\" in\n  vsock:*) echo \"$VAL\" | grep -Eq '^vsock:-?[0-9]+:[0-9]+$' || { echo \"bad vsock addr: $VAL\"; exit 2; } ;;\nesac\nexec deno run main.ts","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Template the env as vsock:${CID}:${PORT} with both variables mandatory in your supervisor config","Document cid -1 = VMADDR_CID_ANY for host-side listeners","Prefer unix: transport during local development to avoid vsock parsing pitfalls"],"tags":["vsock","control-socket","environment","unstable"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}