Troubleshooting¶
Common issues and their solutions when running SnerdMQ in production.
Daemon Won't Start¶
Symptom: Application throws an error about the daemon binary not being found.
Causes & Solutions:
-
Binary not downloaded — Run the installer:
-
Wrong binary path — Ensure the binary is in your
$PATHor in the SDK's expected location: -
Permission denied — Make the binary executable:
Queue File Locked¶
Symptom: Error: EBUSY: resource busy or locked or flock errors.
Cause: Another process is holding an exclusive lock on the queue file.
Solutions:
-
Check for zombie processes:
-
Stale lock file — On some systems, a crash can leave a stale lock:
-
NFS/EFS lock issues — If you point a single instance at a network drive for durable storage, ensure
Note: Network volumes are heavily reliant onflockis supported:flock. Make sure your filesystem supports it (e.g. AWS EFS), otherwise you risk split-brain queue corruption.
Daemon is in Standby Mode¶
Symptom: The daemon logs [Snerd] No shards owned by this instance on every enqueue attempt.
Cause: The daemon booted, checked membership.json, and found that all shards in the queue are currently claimed and actively renewed by other healthy daemons. Because it owns zero shards, it cannot route any tasks, so it rejects enqueues.
Solutions:
- Increase the shard count: Use the CLI to provision more shards so the standby daemon has something to claim:
- Accept standby behavior: If this is an autoscaling worker, it is perfectly safe for it to idle. It will automatically take over a shard if another worker crashes and its lease expires.
Stale Leases & Split-Brain¶
Symptom: Tasks are being executed twice by two different servers simultaneously, or daemons are constantly pausing.
Cause: Server A's clock is running significantly faster than Server B's. Server A looks at Server B's lease in membership.json and incorrectly determines that the lease has expired, initiating a takeover.
Solutions:
- Run NTP: Ensure
chronyorsystemd-timesyncdis running on all servers. - Increase Skew Margin: If clock drift is unavoidable, widen the grace period via environment variable:
High Memory Usage¶
Symptom: Application memory grows over time.
Cause: SnerdMQ loads pending tasks into memory for fast access. Very large queues can consume significant RAM.
Solutions:
- Process tasks faster — Add more workers or optimize handler performance
- Reduce queue depth — Enqueue less, or increase processing throughput
- Check for stuck tasks — Tasks that keep failing and retrying accumulate:
Tasks Not Executing¶
Symptom: Tasks are enqueued but handlers never fire.
Checklist:
- Is the listener running? — Ensure
startListening()/start_listening()was called - Handler type matches? — The
task_typeinenqueue()must exactly match the registered handler name - Is the daemon alive? — Check for the child process:
- Check stderr output — The daemon logs errors to stderr
Rate Limiting Issues¶
Symptom: Tasks are stuck in "paused" state and never execute.
Cause: Rate limit threshold is too low for your workload.
Solutions:
-
Increase
max_per_minute: -
Remove rate limiting if not needed — Set
rateLimitGroupto empty/null
Cron Jobs Not Firing¶
Symptom: Cron tasks execute once but never repeat.
Checklist:
- Did the first execution succeed? — Cron jobs only re-execute after success. If the handler fails, it enters retry mode instead.
- Is the cron expression valid? — Test it:
- Is the daemon still running? — Cron scheduling requires the daemon to be alive
Deduplication Not Working¶
Symptom: Duplicate tasks are still getting through.
Cause: Dedup only checks against pending tasks. If the first task already executed, the second one won't be detected as a duplicate.
Solution: Ensure auto_dedupe: true is set, and understand that dedup is a "same-tick" check, not a historical one.
Dashboard Not Loading¶
Symptom: http://localhost:9090 shows a blank page or connection refused.
Solutions:
- Did you call
startDashboard()? — The dashboard doesn't start automatically - Port conflict — Try a different port:
- Static assets path — The dashboard serves
static/files relative to your working directory. Ensure you're running from the correct directory.
Graceful Shutdown Issues¶
Symptom: Pending tasks are lost when the application exits.
Solution: Always shut down gracefully:
Getting Help¶
If you're stuck:
- Check the GitHub Issues for known problems
- Enable debug logging — Set environment variable
SNERD_DEBUG=1for verbose output - Open an issue — Include your OS, SDK version, daemon version, and a minimal reproduction