{"record":{"id":"c3fd1debcb04c5ad","repo":"gastownhall/beads","slug":"probe-s-w","errorCode":null,"errorMessage":"probe %s: %w","messagePattern":"probe (.+?): %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dbproxy/proxy/shutdown.go","lineNumber":282,"sourceCode":"\t\t\t\treturn nil, fmt.Errorf(\"kill verified pid %d from %s: %w\", pf.Pid, recordPath, killErr)\n\t\t\t}\n\t\t\tif closeErr := handle.Close(); closeErr != nil {\n\t\t\t\tlock.Unlock()\n\t\t\t\treturn nil, fmt.Errorf(\"close verified process handle for pid %d: %w\", pf.Pid, closeErr)\n\t\t\t}\n\t\t\twaitBudget := max(time.Until(deadline), shutdownPostKillMinimum)\n\t\t\tif waitErr := waitForRecordedProcessExit(pf, waitBudget); waitErr != nil {\n\t\t\t\tlock.Unlock()\n\t\t\t\treturn nil, fmt.Errorf(\"confirm verified pid %d stopped: %w\", pf.Pid, waitErr)\n\t\t\t}\n\t\t\tif removeErr := pidfile.Remove(rootDir, pidName); removeErr != nil {\n\t\t\t\tlock.Unlock()\n\t\t\t\treturn nil, fmt.Errorf(\"remove stopped process record %s: %w\", recordPath, removeErr)\n\t\t\t}\n\t\t\treturn lock, nil\n\n\t\tcase !lockfile.IsLocked(err):\n\t\t\treturn nil, fmt.Errorf(\"probe %s: %w\", lockPath, err)\n\t\t}\n\n\t\tpf, readErr := pidfile.Read(rootDir, pidName)\n\t\tif readErr != nil {\n\t\t\tif isMalformedPIDFileError(readErr) {\n\t\t\t\treturn nil, unverifiableProcessError(\n\t\t\t\t\t\"shutdown\",\n\t\t\t\t\trecordPath,\n\t\t\t\t\t0,\n\t\t\t\t\treadErr,\n\t\t\t\t\tunverifiableProcessChecks{},\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"read held-lock record %s: %w\", recordPath, readErr)\n\t\t}\n\t\tif pf != nil {\n\t\t\tif validateErr := validateKillRecord(rootDir, pf, wantKind, checks); validateErr != nil {\n\t\t\t\tdead, live, probeErr := classifyInvalidKillRecord(pf, validateErr)","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dbproxy/proxy/shutdown.go#L264-L300","documentation":"stopAndAcquire failed to even probe the lock file (util.TryLock on proxy.lock or dolt backend lock) with a non-'already locked' error. Since the state of the lock is unknown, Shutdown aborts rather than guessing. The wrapped error is the underlying OS-level failure.","triggerScenarios":"util.TryLock returns an error that is neither success nor lockfile.IsLocked — e.g. the lock file's parent directory doesn't exist, permission denied on the lock file, or a filesystem-level flock error.","commonSituations":"Running shutdown outside the workspace (missing .beads dir), wrong rootDir passed to Shutdown, directory permissions broken after a copy/restore, or a corrupted/exotic filesystem that doesn't support flock (some network mounts).","solutions":["Run bd shutdown from the correct workspace root (the one containing .beads).","Check the lock file and directory exist and are writable: ls -la .beads/*.lock.","Inspect the wrapped %w error: ENOENT means wrong rootDir; EACCES means permissions; ENOLCK/EOPNOTSUPP means the filesystem doesn't support locks.","Copy the workspace to a local filesystem if it lives on NFS/network storage."],"exampleFix":"// before\nerr := proxy.Shutdown(\"/mnt/nfs/project\") // probe ...lock: operation not supported\n// after\nerr := proxy.Shutdown(\"/home/user/project\") // local fs supporting flock","handlingStrategy":"validation","validationCode":"fi","typeGuard":null,"tryCatchPattern":"if err := proxy.Shutdown(rootDir); err != nil && strings.Contains(err.Error(), \"probe \") {\n    // inspect wrapped cause: wrong rootDir vs permissions vs unsupported fs\n}","preventionTips":["Always invoke shutdown with the workspace root containing .beads/.","Use local filesystems supporting flock (ext4, apfs), not NFS.","Verify directory permissions after copying/restoring workspaces."],"tags":["filesystem","lockfile","shutdown"],"backgroundTag":"lock-acquire-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}