Maintenance and monitoring
How to watch a running installation, keep it tidy, and find problems quickly.
Health checks
| Endpoint | Meaning | Use for |
|---|---|---|
GET /api/v1/health | The API process responds | Liveness probes |
GET /api/v1/health/ready | The database is reachable (otherwise 503) | Readiness checks, load balancers, uptime monitors |
Both Docker images define health checks, so docker compose ps shows their status.
Logs
The API writes one JSON object per line to standard output:
{"level":30,"time":1794589661477,"req":{"id":"7f0c2d…","method":"GET","path":"/api/v1/entities/article/records"},"tenantId":"…","actor":"user","res":{"statusCode":200},"responseTime":16,"msg":"request completed"}- Every response has an
x-request-idheader. Clients can send their own id (8 to 128 characters of letters, digits,. _ -) to correlate requests. - Server errors return
error.requestId. Ask users for it, then search the logs. - Never logged: request bodies, query strings, passwords, cookies, API keys, CSRF and setup tokens.
- Health checks are not logged.
Collect logs with your Docker logging driver or any log stack (Loki, ELK, CloudWatch, Datadog). For local development set LOG_FORMAT=pretty.
Usage and quotas
GET /api/v1/admin/usage (admins) returns the workspace's records, entities, media files and bytes, members, API keys and limits:
{ "data": { "records": 1520, "entities": 6, "media": { "files": 84, "bytes": 51234567 },
"members": 4, "apiKeys": 2, "limits": { "maxRecords": null, "maxMediaBytes": 1073741824 } } }Set TENANT_MAX_RECORDS and TENANT_MAX_MEDIA_BYTES to cap workspaces. When a limit is reached, new records or uploads fail with 403 QUOTA_EXCEEDED. Trashed items don't count.
Scheduled maintenance
Run the maintenance job once a day:
# Docker
docker compose --env-file .env.production -f docker-compose.prod.yml run --rm maintenance
# Native
pnpm maintenanceIt:
- deletes expired sessions;
- removes audit events older than
AUDIT_RETENTION_DAYS(365); - permanently deletes records and media that have been in the trash longer than
TRASH_RETENTION_DAYS(30). References to purged records are removed from other records.
It prints a JSON summary, for example {"maintenance":{"expiredSessions":12,"auditEvents":0,"purgedRecords":3,"purgedMedia":1}}.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| API exits with Invalid environment configuration | A variable is missing or malformed. The message names it |
| Signing in works but you are signed out again | COOKIE_SECURE=true over plain HTTP. Use HTTPS, or set it to false for local testing only |
| All users hit the same rate limit | Behind a proxy without TRUST_PROXY=true |
/health/ready returns 503 | Database down or wrong DATABASE_URL |
| Data seems missing when querying PostgreSQL by hand | Row-level security hides rows without a workspace context. Use a BYPASSRLS role for manual queries |
429 RATE_LIMITED on login | More than 10 attempts per minute from one IP. Wait for Retry-After |
PLUGIN_TIMEOUT | A plugin hook is too slow. Check its logs or raise PLUGIN_HOOK_TIMEOUT_MS |
Upload rejected with MEDIA_CONTENT_MISMATCH | The file's content doesn't match its type, for example a renamed file |
| Forgot the only owner's password | Update the password hash in the database as a superuser, or ask another owner to add you again |