SafeDisk AI

Embedded Postgres Dies On macOS Disk Pressure

When a local app or AI-agent workspace writes scheduled backups until the disk is full, embedded Postgres can die on ENOSPC and leave health checks stuck at database unreachable. The safe fix is not just more cleanup. Gate writes before backup, prune old backups first, and supervise restart with a clear failure state.

No mail app or GitHub login? Send this directly from any inbox.

liuminsheng3@gmail.com - SafeDisk Embedded Postgres Incident Review Payment Link
Local database incident review

Get a safe backup, Postgres, and agent-heartbeat recovery order.

The $29 review covers one local embedded Postgres ENOSPC incident: backup free-space gates, prune-before-write order, database restart boundaries, and what not to delete from app support or agent state.

df -h "$HOME" /tmp; du -sh "$HOME/Library/Application Support"/* 2>/dev/null | sort -h | tail -30
Email $29 payment link Request $29 private payment link Request $99 team policy Open runbook Open backup request
Incident payment link

Request the $29 embedded Postgres recovery review.

Email is enough to request the payment link. Add only a public-safe symptom; do not paste database contents, credentials, transcripts, or private app logs.

Use private checkout

Recovery Runbook

For local apps with embedded Postgres, the recovery order should protect database state first, then reduce backup pressure, then restart the database process with bounded attempts.

  1. Check free bytes before backup writes. Skip backup if the target volume is below the configured reserve.
  2. Prune or rotate old backups before starting the next backup, not after a successful backup.
  3. Put backup temp files on the same target volume so free-space checks match where bytes are written.
  4. Supervise embedded Postgres with a bounded restart loop and a clear gave-up state.
  5. Keep app support folders, databases, credentials, transcripts, and agent state review-first.
Copy-ready issue reply

Use this when backups kill embedded Postgres on low disk.

This keeps the fix focused on pre-write gates and supervised recovery instead of broad cleanup after data loss.

This looks like a write-before-prune failure: the scheduled backup should prove target free space and prune old backups before opening the next backup file. Once ENOSPC kills embedded Postgres, a health probe alone is not enough; the supervisor needs a bounded restart path and an explicit gave-up state.

Read-only evidence I would capture first:

df -h "$HOME" /tmp
df -i "$HOME" /tmp
du -sh "$HOME/Library/Application Support"/* 2>/dev/null | sort -h | tail -30
find "$HOME" -maxdepth 5 -type f \( -name "*.dump" -o -name "*.backup" -o -name "*.sqlite" -o -name "*.log" \) -size +500M -print0 2>/dev/null | xargs -0 du -h 2>/dev/null | sort -hr | head -40

For the fix, I would add: min-free-gb gate before backup, aggressive prune threshold before writing, temp file on the target volume, bounded Postgres restart attempts, and a health response that distinguishes disk_pressure, restarting, and gave_up.
Request $29 incident review

Do Not Delete First