Audit Issues
Fix audit events that are missing or only in the application log.
Fix audit events that are missing or only in the application log.
Audit Events Not Logging
Audit events are written by the process that records them (tma-server serve or
tma-server worker), in batches about every half second. There is no separate audit
worker to start.
Check:
- The database is reachable from the app:
docker compose logs appshows no connection errors - The app log for
Audit batch failed; retrying row by roworFailed to write audit event, which include the database error audit_events_failed_totalon/metrics
Solutions:
- Fix the database error shown in the log (connection, permissions, disk space)
- Make sure migrations ran: the app applies them at startup, and
tma-server migrateapplies them by hand
Events Only in the Application Log
Symptom: The log shows Audit queue unavailable, event logged to application log only.
Cause: More than 10,000 events were waiting to be written, usually because the database is very slow or unreachable.
Solutions:
- Check database health and load
- The events in question are in the application log with their action name; they are
not added to
audit_loglater
Events Missing After a Crash
Events are held in memory for up to half a second before they are written. A normal stop
(docker compose stop, Ctrl+C) writes them first. A process that is killed outright can
lose the last half second of events.
Related Topics
- Audit Logs - Audit system
- Background Workers - Worker management
Last updated on