{"record":{"id":"d140f4625ebd5772","repo":"gastownhall/beads","slug":"proxy-forcestopunverified-quarantine-s-w","errorCode":null,"errorMessage":"proxy.ForceStopUnverified: quarantine %s: %w","messagePattern":"proxy\\.ForceStopUnverified: quarantine (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dbproxy/proxy/force_stop.go","lineNumber":325,"sourceCode":"\treport *ForceStopReport,\n) error {\n\tcurrent, err := pidfile.Read(rootDir, pidName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"proxy.ForceStopUnverified: re-read %s: %w\", report.RecordPath, err)\n\t}\n\tif current == nil {\n\t\treturn nil\n\t}\n\tif *current != *record {\n\t\treturn fmt.Errorf(\n\t\t\t\"proxy.ForceStopUnverified: record %s changed after pid %d was stopped; refusing to quarantine the replacement\",\n\t\t\treport.RecordPath,\n\t\t\trecord.Pid,\n\t\t)\n\t}\n\ttarget, err := quarantineRecord(rootDir, pidName, time.Now())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"proxy.ForceStopUnverified: quarantine %s: %w\", report.RecordPath, err)\n\t}\n\treport.QuarantinedPath = target\n\treturn nil\n}\n","sourceCodeStart":307,"sourceCodeEnd":330,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dbproxy/proxy/force_stop.go#L307-L330","documentation":"Wraps a failure from quarantineRecord: the pid record could not be moved into quarantine on disk. The pid was stopped, but the record remains in place, leaving stale state behind.","triggerScenarios":"forceStopRecord → quarantineForceStopRecord calls quarantineRecord(rootDir, pidName, time.Now()) and it returns an error (e.g. permission problem, missing record file, bad quarantine dir).","commonSituations":"Read-only or full filesystem; rootDir permissions changed; record deleted concurrently between the re-read and the rename; quarantine directory not writable.","solutions":["Inspect the wrapped %w cause and fix the underlying filesystem/permission problem","Verify the record file and quarantine directory exist and are writable","Re-run the force-stop once the record file is accessible"],"exampleFix":"// before\ncp -f root/record.bak root/record   // stale record restored\n// after\nrm -f root/record && bd force-stop   // let proxy recreate a clean record","handlingStrategy":"try-catch","validationCode":"if _, err := os.Stat(rootDir); err != nil { return err }\nif err := os.MkdirAll(quarantineDir, 0o755); err != nil { return err }","typeGuard":null,"tryCatchPattern":"if err := forceStopRecord(rootDir, rec); err != nil {\n  var perr *os.PathError\n  if errors.As(err, &perr) { /* fix permissions/path */ }\n  return err\n}","preventionTips":["Keep rootDir writable by the daemon user","Monitor disk space","Don't delete pid records manually while force-stop runs"],"tags":["filesystem","quarantine","io"],"backgroundTag":"quarantine-write-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}