Common Issues
Common Issues
Section titled “Common Issues”This page covers frequently encountered issues when operating Mantis, along with diagnosis steps and solutions.
Service Will Not Start
Section titled “Service Will Not Start”Mandible Fails to Start
Section titled “Mandible Fails to Start”Symptom: Mandible exits immediately after launch.
Check configuration:
# Verify config file syntaxcat /etc/mantis/mandible.toml
# Check for required environment variablesecho $MANDIBLE__DATABASE__URLecho $MANDIBLE__JWT__SECRETCommon causes:
| Error Message | Cause | Fix |
|---|---|---|
address already in use | Port 3000 already bound | Stop conflicting process or change port |
database connection failed | PostgreSQL unreachable | Verify database URL and connectivity |
invalid JWT secret | Secret too short or missing | Set MANDIBLE__JWT__SECRET (min 32 chars) |
TLS configuration error | Certificate files missing | Check cert_path and key_path exist |
Database Connection Failures
Section titled “Database Connection Failures”Symptom: /api/v1/health returns 503, logs show connection refused.
# Test database connectivity directlypsql "$DATABASE_URL" -c "SELECT 1"
# Check if PostgreSQL is runningsystemctl status postgresql# ordocker compose ps postgres
# Verify connection pool isn't exhausted# Look for "pool exhausted" or "timeout" in Mandible logsjournalctl -u mantis-mandible --since "5 minutes ago" | grep -i poolAuthentication Problems
Section titled “Authentication Problems”Cannot Log In
Section titled “Cannot Log In”Symptom: Login returns 401 or the UI shows “Invalid credentials”.
- Verify the user exists and is not disabled
- Check for auth rate limiting (progressive backoff after failed attempts)
- Confirm
RUST_LOGincludesmandible::routes::auth=debugand review logs
# Check if rate limited (look for 429 responses)journalctl -u mantis-mandible | grep "rate_limit" | tail -5
# Rate limits reset after the lockout period expiresToken Refresh Failures
Section titled “Token Refresh Failures”Symptom: Users are logged out unexpectedly, or API calls return 401.
- Check that the
mantis_refresh_tokencookie domain matches the deployment domain - Verify JWT secret has not changed (rotating the secret invalidates all tokens)
- Ensure system clocks are synchronized (JWT expiry is time-sensitive)
Deployment Issues
Section titled “Deployment Issues”Deployments Stuck in “Pending”
Section titled “Deployments Stuck in “Pending””Symptom: Deployments remain in Pending status and never start.
- Check if any Thorax instance is online (the overall
statusis shown to any caller; authenticate to also seecircuit_state,failure_count, andsuccess_count, which are withheld from anonymous requests):
curl -s -H "Authorization: Bearer $TOKEN" \ https://mantis.example.com/api/v1/health/grpc | jq- Verify the dispatch queue processor is running (check Mandible logs for
dispatch_queueentries) - Check if the target has an assigned Thorax instance
- Review RabbitMQ connectivity if using queue-based dispatch
Deployments Fail Immediately
Section titled “Deployments Fail Immediately”Symptom: Deployments move to Failed within seconds.
- Check the deployment logs in the Lens UI for error details
- Verify the target (Tarsus agent) is online and reachable
- Confirm the action’s command or script payload is valid
- Check that required variables are defined for the target’s environment
Connectivity Issues
Section titled “Connectivity Issues”Thorax Shows “Offline”
Section titled “Thorax Shows “Offline””Symptom: Instance cleanup service marks Thorax as offline.
The InstanceCleanupService checks heartbeats every 30 seconds and marks instances offline after 60 seconds of silence.
- Verify Thorax is running:
systemctl status mantis-thorax - Check network connectivity between Mandible and Thorax
- Review Thorax logs for gRPC connection errors
- Verify mTLS certificates are valid and not expired
Tarsus Cannot Register
Section titled “Tarsus Cannot Register”Symptom: Tarsus agent fails to connect to Mandible.
See Connection Problems for detailed network troubleshooting, and Certificate Issues for TLS-specific problems.
Performance Problems
Section titled “Performance Problems”Slow API Responses
Section titled “Slow API Responses”Symptom: API calls take several seconds to respond.
# Check database query performance# Enable debug logging for database operationsexport RUST_LOG="mandible=info,diesel=debug"systemctl restart mantis-mandibleCommon causes:
- Missing database indexes (check after schema migrations)
- Connection pool exhaustion under high load
- Large result sets without pagination
High Memory Usage
Section titled “High Memory Usage”Symptom: Mandible or Thorax memory usage grows over time.
- Check notification queue depth (
mantis_notification_queue_depthmetric) - Review rate limit cache size (
mantis_rate_limit_cache_entriesmetric) - Verify the
RateLimiterCleanupServiceis running (cleans stale cache entries)
Data Issues
Section titled “Data Issues”Missing Audit Logs
Section titled “Missing Audit Logs”Symptom: Expected audit log entries are not appearing.
The mantis_audit_log_events_total metric records channel_full or channel_closed
results when the audit channel is under pressure or has stopped. This family is recorded
in Mandible’s in-process registry but is not currently exposed on an HTTP /metrics
endpoint, so monitor it via Mandible’s structured logs (audit-channel warnings) rather
than a metrics scrape.
Stale Data in UI
Section titled “Stale Data in UI”Symptom: Lens shows outdated information.
- Hard refresh the browser (Ctrl+Shift+R)
- Check if the API returns current data directly:
curl https://mantis.example.com/api/v1/targets - Verify SSE (Server-Sent Events) connection is active for real-time updates
Getting Help
Section titled “Getting Help”If these steps do not resolve your issue:
- Collect relevant logs with debug-level logging enabled
- Note the exact error messages and HTTP status codes
- Check the Mantis version (
/api/v1/server/info) - Review related pages for specific subsystem issues
Next Steps
Section titled “Next Steps”- Connection Problems — Network and connectivity issues
- Deployment Failures — Deployment-specific troubleshooting
- Queue Issues — RabbitMQ and dispatch queue problems
- Certificate Issues — TLS and mTLS problems
