Skip to content
Website

Monitoring & Maintenance

This guide is for operators and administrators maintaining a running Patchwork server.

  • HTTP endpoint: GET /api/health returns 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 --check to inspect installation state without modifying files.

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.

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.

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).

  • Keep PostgreSQL GIN indexes healthy (VACUUM ANALYZE on tickets, comments, attachments).
  • Ensure cacheDurationSec in Integrations is tuned (default 300 seconds) to avoid redundant GitHub/GitLab API calls.

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 -- --check report worker heartbeat status, processed event counts, pending queue depth, oldest pending age, and dead-lettered items for domain_events, email_outbox, and webhook_deliveries.
  • Delivery logs & retention: Read/archived notifications are retained for 90 days by default (retentionReadDays, unread cap 500), and email/webhook delivery logs are retained for 30 days (deliveryLogRetentionDays). All retention settings can be adjusted in System Configuration → Notifications.