gastownhall/beads · error

proxy.ForceStopUnverified: quarantine %s: %w

Error message

proxy.ForceStopUnverified: quarantine %s: %w

What it means

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.

Source

Thrown at internal/storage/dbproxy/proxy/force_stop.go:325

	report *ForceStopReport,
) error {
	current, err := pidfile.Read(rootDir, pidName)
	if err != nil {
		return fmt.Errorf("proxy.ForceStopUnverified: re-read %s: %w", report.RecordPath, err)
	}
	if current == nil {
		return nil
	}
	if *current != *record {
		return fmt.Errorf(
			"proxy.ForceStopUnverified: record %s changed after pid %d was stopped; refusing to quarantine the replacement",
			report.RecordPath,
			record.Pid,
		)
	}
	target, err := quarantineRecord(rootDir, pidName, time.Now())
	if err != nil {
		return fmt.Errorf("proxy.ForceStopUnverified: quarantine %s: %w", report.RecordPath, err)
	}
	report.QuarantinedPath = target
	return nil
}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Inspect the wrapped %w cause and fix the underlying filesystem/permission problem
  2. Verify the record file and quarantine directory exist and are writable
  3. Re-run the force-stop once the record file is accessible

Example fix

// before
cp -f root/record.bak root/record   // stale record restored
// after
rm -f root/record && bd force-stop   // let proxy recreate a clean record
Defensive patterns

Strategy: try-catch

Validate before calling

if _, err := os.Stat(rootDir); err != nil { return err }
if err := os.MkdirAll(quarantineDir, 0o755); err != nil { return err }

Try / catch

if err := forceStopRecord(rootDir, rec); err != nil {
  var perr *os.PathError
  if errors.As(err, &perr) { /* fix permissions/path */ }
  return err
}

Prevention

When it happens

Trigger: forceStopRecord → quarantineForceStopRecord calls quarantineRecord(rootDir, pidName, time.Now()) and it returns an error (e.g. permission problem, missing record file, bad quarantine dir).

Common situations: Read-only or full filesystem; rootDir permissions changed; record deleted concurrently between the re-read and the rename; quarantine directory not writable.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/d140f4625ebd5772. Report an issue: GitHub.