denoland/deno · error

vsock is not supported on this platform

Error message

vsock is not supported on this platform

What it means

When OTEL_DENO_VSOCK is set, the OTLP telemetry exporter tries to send over an AF_VSOCK socket (host-to-VM channel used on microVM platforms). The vsock connector only compiles for android, linux and macos; on any other platform the code bails with this message before the address is even parsed.

Source

Thrown at ext/telemetry/lib.rs:807

    inner: Client<Connector, Full<Bytes>>,
    timeout: Duration,
  }

  impl HyperClient {
    fn build_connector(
      sys: &impl FsRead,
    ) -> deno_core::anyhow::Result<Connector> {
      let connector = if let Some(tunnel) = get_tunnel() {
        Connector::Tunnel(tunnel.clone())
      } else if let Ok(addr) = std::env::var("OTEL_DENO_VSOCK") {
        #[cfg(not(any(
          target_os = "android",
          target_os = "linux",
          target_os = "macos"
        )))]
        {
          let _ = addr;
          deno_core::anyhow::bail!("vsock is not supported on this platform")
        }

        #[cfg(any(
          target_os = "android",
          target_os = "linux",
          target_os = "macos"
        ))]
        {
          let Some((cid, port)) = addr.split_once(':') else {
            deno_core::anyhow::bail!("invalid vsock addr");
          };
          let cid = if cid == "-1" { u32::MAX } else { cid.parse()? };
          let port = port.parse()?;
          let addr = VsockAddr::new(cid, port);
          Connector::Vsock(addr)
        }
      } else {
        let ca_certs = match std::env::var("OTEL_EXPORTER_OTLP_CERTIFICATE") {

View on GitHub (pinned to 89f33cbef2)

Solutions

  1. Unset OTEL_DENO_VSOCK on platforms without vsock: `Remove-Item Env:OTEL_DENO_VSOCK` (PowerShell) or `env -u OTEL_DENO_VSOCK deno ...`
  2. Gate the variable per-platform in CI (set it only on linux/android/macos jobs)
  3. Use a regular HTTP OTLP endpoint (OTEL_EXPORTER_OTLP_ENDPOINT) on unsupported platforms

Example fix

# before — Windows CI fails at telemetry init
$env:OTEL_DENO_VSOCK = "2:4317"
deno run --unstable-otel main.ts

# after — unset on unsupported platforms
Remove-Item Env:OTEL_DENO_VSOCK
deno run --unstable-otel main.ts
Defensive patterns

Strategy: validation

Validate before calling

# set the vsock endpoint only on supported platforms
case "$(uname -s)" in
  Linux|Darwin|Android) export OTEL_DENO_VSOCK="2:4317";;
  *) unset OTEL_DENO_VSOCK || true;;
esac
deno run --unstable-otel main.ts

Prevention

When it happens

Trigger: Running with OTEL telemetry enabled and OTEL_DENO_VSOCK present in the environment on a non-android/linux/macos platform — in practice Windows.

Common situations: A shared .env file or CI matrix that exports OTEL_DENO_VSOCK unconditionally across Linux VM runners and Windows/macOS runners; copying cloud config from a Linux deployment to a local Windows dev box.

Related errors


AI-assisted analysis of denoland/deno@89f33cbef2 (2026-08-16). Data as JSON: /api/errors/63ecb30bb00fcf78. Report an issue: GitHub.