{"record":{"id":"14d48794b924899e","repo":"JuliusBrussee/caveman","slug":"executable-identity-unsupported-on-s","errorCode":null,"errorMessage":"executable identity unsupported on %s","messagePattern":"executable identity unsupported on (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/internal/runstate/runstate.go","lineNumber":230,"sourceCode":"\t\t// Windows validate()'s portBound probe carries the real liveness\n\t\t// weight — a dead proxy is not listening.\n\t\treturn true\n\t}\n\treturn process.Signal(syscall.Signal(0)) == nil\n}\n\nfunc processExecutable(pid int) (string, error) {\n\tif runtime.GOOS == \"linux\" {\n\t\treturn os.Readlink(filepath.Join(\"/proc\", strconv.Itoa(pid), \"exe\"))\n\t}\n\tif runtime.GOOS == \"darwin\" {\n\t\tout, err := exec.Command(\"ps\", \"-o\", \"comm=\", \"-p\", strconv.Itoa(pid)).Output()\n\t\treturn strings.TrimSpace(string(out)), err\n\t}\n\tif runtime.GOOS == \"windows\" {\n\t\treturn processExecutableWindows(pid)\n\t}\n\treturn \"\", fmt.Errorf(\"executable identity unsupported on %s\", runtime.GOOS)\n}\n\nfunc portBound(listen string) bool {\n\tconn, err := net.DialTimeout(\"tcp\", listen, 200*time.Millisecond)\n\tif err != nil {\n\t\treturn false\n\t}\n\t_ = conn.Close()\n\treturn true\n}\n","sourceCodeStart":212,"sourceCodeEnd":241,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/proxy/internal/runstate/runstate.go#L212-L241","documentation":"Returned by runstate.processExecutable when it needs to identify the executable behind a PID but the current GOOS is not linux, darwin, or windows. This is a build-target problem: the code was compiled for a platform with no executable-identity strategy (e.g. freebsd, openbsd).","triggerScenarios":"Compiling the proxy for an unsupported GOOS (GOOS=freebsd go build ...) and then exercising the run-state ownership path that calls processExecutable — typically stale-state detection that wants to know if the recorded PID still belongs to a caveman binary.","commonSituations":"Cross-compiling to run on a NAS/BSD system; building in a container with an unusual toolchain default; future Go ports (plan9, js/wasm) where the proc APIs do not exist at all.","solutions":["Build/run on a supported platform: linux, darwin, or windows","If you must run on another unix, port processExecutable for that GOOS (e.g. sysctl KERN_PROC_PATHNAME on the BSDs) and submit it upstream","As an operator fallback, delete the stale run-state JSON under home/run/ so ownership checks skip the unsupported path","Check your build script's GOOS/GOARCH matrix — often the wrong value leaks from a cross-compile variable"],"exampleFix":"// before: unsupported platform returns error\nreturn \"\", fmt.Errorf(\"executable identity unsupported on %s\", runtime.GOOS)\n\n// after (porting example, BSD):\n// sysctl kern.proc.pathname.<pid> returns the executable path\nmib := []int{CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, pid}\n// ... sysctl call, return string(path)","handlingStrategy":"validation","validationCode":"if runtime.GOOS != \"linux\" && runtime.GOOS != \"darwin\" && runtime.GOOS != \"windows\" {\n    log.Fatal(\"executable-identity checks unsupported on \" + runtime.GOOS + \"; use linux/darwin/windows\")\n}","typeGuard":"func executableIdentitySupported() bool {\n    switch runtime.GOOS {\n    case \"linux\", \"darwin\", \"windows\":\n        return true\n    }\n    return false\n}","tryCatchPattern":"_, err := runstate.New(listen, mode, owner, version)\nif err != nil && strings.Contains(err.Error(), \"executable identity unsupported\") {\n    // platform gap: either skip stale-state ownership probing or clear home/run/*.json\n    os.RemoveAll(filepath.Join(home, \"run\"))\n}","preventionTips":["Gate builds on the supported GOOS trio in CI (go build for linux/darwin/windows only)","Clear stale run-state files when moving a home to an unsupported platform","Port processExecutable before adding a new target OS"],"tags":["platform-support","build","go"],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}