Monitoring & Maintenance
This guide is for operators and administrators maintaining a running Patchwork server.
Health Checks & Diagnostics
Section titled “Health Checks & Diagnostics”- HTTP endpoint:
GET /api/healthreturns service liveness (200 OK). - System Diagnostics: Visit System Configuration -> Health & Diagnostics (
/dashboard/system/health) for PostgreSQL, MinIO bucket, and migration diagnostics. - CLI check: Run
node scripts/setup.mjs --checkto inspect installation state without modifying files.
Logs & Secret Redaction
Section titled “Logs & Secret Redaction”The installer and server redact known secrets (SESSION_SECRET, CSRF_SECRET, TOKEN_ENCRYPTION_KEY, S3_SECRET_KEY, database passwords) before writing logs under logs/. Never log command arguments or ticket content.
Search Reindexing
Section titled “Search Reindexing”If full-text search results appear stale after manual database edits, open System Configuration -> Search Index (/dashboard/system/search) and run Rebuild Search Index to recompute PostgreSQL tsvector columns across tickets, comments, and extracted attachment text.
Orphaned File Cleanup
Section titled “Orphaned File Cleanup”If a browser upload fails after requesting a presigned URL or after ticket deletion, clean unreferenced MinIO objects from System Configuration -> Storage & Files (/dashboard/system/storage).
Performance Tuning
Section titled “Performance Tuning”- Keep PostgreSQL
GINindexes healthy (VACUUM ANALYZEontickets,comments,attachments). - Ensure
cacheDurationSecin Integrations is tuned (default300seconds) to avoid redundant GitHub/GitLab API calls.
Related Pages
Section titled “Related Pages”Background Worker, Queues & Retention
Section titled “Background Worker, Queues & Retention”Patchwork runs an in-process background worker by default (WORKER_MODE=embedded, started from instrumentation.ts with a PostgreSQL advisory lock so only one instance processes). For larger deployments, set WORKER_MODE=separate and run npm run worker as a standalone process.
- Queue health: System Configuration → Health & Diagnostics and
npm run setup -- --checkreport worker heartbeat status, processed event counts, pending queue depth, oldest pending age, and dead-lettered items fordomain_events,email_outbox, andwebhook_deliveries. - Delivery logs & retention: Read/archived notifications are retained for 90 days by default (
retentionReadDays, unread cap500), and email/webhook delivery logs are retained for 30 days (deliveryLogRetentionDays). All retention settings can be adjusted in System Configuration → Notifications.