abiosoft/colima · error
process not found: %v
Error message
process not found: %v
What it means
Returned when os.FindProcess(pid) fails after the pid file parsed to a nonzero pid. On Unix (macOS/Linux, colima's supported hosts) os.FindProcess ALWAYS succeeds and returns a non-nil *Process even for nonexistent pids — liveness validation is deferred to Signal(0). This error is therefore effectively unreachable on Unix and only fires on Windows, where FindProcess actually checks process existence.
Source
Thrown at cmd/daemon/daemon.go:130
func status() error {
info := Info()
if _, err := os.Stat(info.PidFile); err != nil {
return fmt.Errorf("pid file not found: %w", err)
}
// check if process is actually running
p, err := os.ReadFile(info.PidFile)
if err != nil {
return fmt.Errorf("error reading pid file: %w", err)
}
pid, _ := strconv.Atoi(string(p))
if pid == 0 {
return fmt.Errorf("invalid pid: %v", string(p))
}
process, err := os.FindProcess(pid)
if err != nil {
return fmt.Errorf("process not found: %v", err)
}
if err := process.Signal(syscall.Signal(0)); err != nil {
return fmt.Errorf("process signal(0) returned error: %w", err)
}
return nil
}
const (
pidFileName = "daemon.pid"
logFileName = "daemon.log"
)
func Info() struct {
PidFile string
LogFile string
} {View on GitHub (pinned to c3a5f9184d)
Solutions
- On macOS/Linux treat this as impossible — if you see it, the platform is not Unix: switch to a supported host
- Delete the stale pid file and restart the daemon: rm dir()/daemon.pid, then `colima daemon start`
- If Windows support is intended, gate this branch with runtime.GOOS and rely on the Signal(0) check instead
Example fix
// before
process, err := os.FindProcess(pid)
if err != nil {
return fmt.Errorf("process not found: %v", err)
}
// after
// on unix FindProcess never errors; keep the check but include the pid and wrap the cause
process, err := os.FindProcess(pid)
if err != nil {
return fmt.Errorf("process %d not found: %w", pid, err)
} Defensive patterns
Strategy: validation
Validate before calling
// on unix this branch is unreachable; if you must be defensive:
if runtime.GOOS == "windows" {
if p, err := os.FindProcess(pid); err != nil || p == nil {
// pid invalid on this platform; treat the pid file as stale
_ = os.Remove(info.PidFile)
}
} Prevention
- Run colima daemon tooling on supported Unix hosts (macOS/Linux) where os.FindProcess cannot fail
- Treat any occurrence of this error as a platform smell, not a daemon problem — check runtime.GOOS before debugging process state
When it happens
Trigger: Porting or running the colima daemon tooling on a Windows host; a pid file referencing a pid that does not exist on a platform where FindProcess validates. On darwin/linux this branch is dead code.
Common situations: Experimental Windows builds of colima tooling; CI runners attempting daemon status on windows; almost never seen in normal macOS/Linux usage.
Related errors
- cannot make dir: %w
- error starting daemon: %w
- error sending sigterm to daemon: %w
- pid file not found: %w
- invalid pid: %v
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/2e42fbfea5d7dc40.
Report an issue: GitHub.