{"record":{"id":"7431b1ecfac8311e","repo":"gastownhall/beads","slug":"quarantine-dead-unverifiable-backend-record-w","errorCode":null,"errorMessage":"quarantine dead unverifiable backend record: %w","messagePattern":"quarantine dead unverifiable backend record: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dbproxy/proxy/endpoint.go","lineNumber":788,"sourceCode":"\t\tif isMalformedPIDFileError(readErr) {\n\t\t\treturn unverifiableProcessError(\n\t\t\t\t\"backend cleanup\",\n\t\t\t\trecordPath,\n\t\t\t\t0,\n\t\t\t\treadErr,\n\t\t\t\tunverifiableProcessChecks{},\n\t\t\t)\n\t\t}\n\t\treturn fmt.Errorf(\"read backend record %s: %w\", recordPath, readErr)\n\t}\n\tif pf == nil {\n\t\treturn nil\n\t}\n\tif err := pf.ValidateV2(pidfile.KindDoltBackend); err != nil {\n\t\tdead, live, probeErr := probeUnverifiablePID(pf.Pid)\n\t\tif dead {\n\t\t\tif _, quarantineErr := quarantineRecord(rootDir, server.PIDFileName, time.Now()); quarantineErr != nil {\n\t\t\t\treturn fmt.Errorf(\"quarantine dead unverifiable backend record: %w\", quarantineErr)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\tif probeErr != nil {\n\t\t\terr = errors.Join(err, fmt.Errorf(\"probe recorded pid: %w\", probeErr))\n\t\t}\n\t\treturn unverifiableProcessError(\n\t\t\t\"backend cleanup\",\n\t\t\trecordPath,\n\t\t\tpf.Pid,\n\t\t\terr,\n\t\t\tunverifiableProcessChecks{\n\t\t\t\tLiveEstablished: live,\n\t\t\t},\n\t\t)\n\t}\n\texpectedRootID, err := identity.RootID(rootDir)\n\tif err != nil {","sourceCodeStart":770,"sourceCodeEnd":806,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dbproxy/proxy/endpoint.go#L770-L806","documentation":"When the backend PID record fails V2 validation (ValidateV2 with KindDoltBackend) but the recorded PID is probed as dead, cleanup tries to quarantine the record by renaming it into the quarantine area. This error wraps a failure of that quarantine rename, meaning a dead/stale record could not be moved out of the way and cleanup aborts.","triggerScenarios":"pf.ValidateV2 fails, probeUnverifiablePID reports dead=true, and quarantineRecord(rootDir, server.PIDFileName, time.Now()) returns an error (rename failed) at internal/storage/dbproxy/proxy/endpoint.go:787-788.","commonSituations":"Quarantine directory not writable; target quarantine name already exists and rename fails; filesystem is read-only or full; the record was concurrently removed/locked by another bd process.","solutions":["Check write permissions on the workspace root and quarantine directory and fix them.","Manually rename the record: mv <recordPath> <recordPath>.stale-$(date +%s), then retry.","Ensure no concurrent bd process is holding or recreating the record; stop other bd instances first.","Free disk space or remount the filesystem read-write if the wrapped cause indicates ENOSPC/EROFS."],"exampleFix":"// before\nError: quarantine dead unverifiable backend record: rename ...: permission denied\n// after\n$ mv /ws/.beads/dbproxy/dolt-backend.pid /ws/.beads/dbproxy/dolt-backend.pid.stale-$(date +%s)\n$ bd doctor","handlingStrategy":"fallback","validationCode":"qDir := filepath.Join(rootDir, \"quarantine\")\nif err := os.MkdirAll(qDir, 0o755); err != nil {\n    return fmt.Errorf(\"quarantine dir unavailable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := cleanupOrphanBackend(rootDir); err != nil && strings.Contains(err.Error(), \"quarantine dead unverifiable backend record\") {\n    // fallback: rename the record manually and retry once\n    os.Rename(recordPath, recordPath+\".stale-\"+strconv.FormatInt(time.Now().Unix(), 10))\n    err = cleanupOrphanBackend(rootDir)\n}","preventionTips":["Keep the workspace filesystem writable by the bd user.","Clean old .stale-* files periodically so quarantine names don't conflict.","Avoid running concurrent bd instances against one workspace.","Watch for read-only mounts (containers, live media)."],"tags":["go","pidfile","quarantine","filesystem"],"backgroundTag":"quarantine-rename-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}