{"record":{"id":"3974d6e64ae2aa80","repo":"multica-ai/multica","slug":"find-process-d-w","errorCode":null,"errorMessage":"find process %d: %w","messagePattern":"find process (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_daemon.go","lineNumber":1291,"sourceCode":"\t\t\tlabel = fmt.Sprintf(\"Daemon [%s]\", profile)\n\t\t}\n\t\tfmt.Fprintf(os.Stderr, \"%s is not running.\\n\", label)\n\t\treturn nil\n\t}\n\t// The PID to kill comes from whatever answered on this port, so verify it\n\t// is ours before signalling it.\n\tif err := daemonIdentityMismatch(health, profile, healthPort); err != nil {\n\t\treturn err\n\t}\n\n\tpid, ok := health[\"pid\"].(float64)\n\tif !ok || pid == 0 {\n\t\treturn fmt.Errorf(\"could not determine daemon PID from health endpoint\")\n\t}\n\n\tprocess, err := os.FindProcess(int(pid))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"find process %d: %w\", int(pid), err)\n\t}\n\n\t// Request graceful shutdown via the daemon's HTTP /shutdown endpoint\n\t// rather than an OS signal. On Windows the daemon is spawned with\n\t// DETACHED_PROCESS so it shares no console with us, which means\n\t// GenerateConsoleCtrlEvent can't reach it; HTTP works on both\n\t// platforms and triggers the same context-cancel path the daemon\n\t// already uses for self-restart.\n\tif err := requestDaemonShutdown(healthPort); err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Graceful shutdown request failed: %v — falling back to forced kill.\\n\", err)\n\t\tif kerr := process.Kill(); kerr != nil {\n\t\t\treturn fmt.Errorf(\"kill daemon (pid %d): %w\", int(pid), kerr)\n\t\t}\n\t}\n\n\tfmt.Fprintf(os.Stderr, \"Stopping daemon (pid %d)...\\n\", int(pid))\n\n\t// Poll health endpoint until daemon is gone.","sourceCodeStart":1273,"sourceCodeEnd":1309,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_daemon.go#L1273-L1309","documentation":"Error \"find process %d: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_daemon.go:1291 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the daemon process still exists."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}