XTLS/Xray-core · info

process lookup is not supported on this platform

Error message

process lookup is not supported on this platform

What it means

FindProcess has no implementation for this platform (build tag: not windows/linux/android/darwin — e.g. FreeBSD, OpenBSD, Solaris, plan9) and the stub returns this error unconditionally. The API exists for compilation compatibility but process lookup is not implemented there.

Source

Thrown at common/net/find_process_others.go:10

//go:build !windows && !linux && !android && !darwin

package net

import (
	"github.com/xtls/xray-core/common/errors"
)

func FindProcess(network, srcIP string, srcPort uint16, destIP string, destPort uint16) (int, string, string, error) {
	return 0, "", "", errors.New("process lookup is not supported on this platform")
}

View on GitHub (pinned to 7d214f8b09)

Solutions

  1. Exclude process-based routing rules from configs used on BSD/other platforms
  2. Gate the call site with runtime.GOOS or build tags
  3. Contribute a platform implementation using the OS's socket-to-process API (e.g. sysctl kvm_getfiles on FreeBSD) if you need it

Example fix

// before
pid, name, path, err := net.FindProcess(network, srcIP, srcPort, dstIP, dstPort)
if err != nil {
    log.Fatal(err)
}

// after
pid, name, path, err := net.FindProcess(network, srcIP, srcPort, dstIP, dstPort)
if err != nil {
    newError("process lookup unsupported here, skipping").Base(err).WriteToLog()
}
Defensive patterns

Strategy: validation

Validate before calling

switch runtime.GOOS {
case "windows", "linux", "darwin", "android":
    // supported
    pid, name, path, err = net.FindProcess(netw, srcIP, srcPort, dstIP, dstPort)
default:
    // BSD/solaris/etc: stub always errors; skip
}

Prevention

When it happens

Trigger: Compiling xray-core for any BSD, Solaris, Illumos, AIX, plan9 or js/wasm target and calling FindProcess. Every call fails identically.

Common situations: Porting Xray-based tooling to FreeBSD jails or OpenBSD routers; CI builds for exotic GOOS values that still execute process-routing tests.

Related errors


AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15). Data as JSON: /api/errors/9e5c7b0921ee1b61. Report an issue: GitHub.