Skip to content

Discord Bot Troubleshooting

Use this guide when your Discord bot misbehaves. Work through the sections in order and gather logs before contacting support.


SymptomPossible CauseSolution
Console stuck on “Connecting…”Invalid token, missing intents, Discord outageRegenerate token, ensure intents are approved, check discordstatus.com
Bot exits immediately (code 0)Missing env vars, wrong entry file pathVerify DISCORD_TOKEN exists, update start command
Slash commands not showingCommands not registered, wrong app IDRun registration script with production token, wait for propagation

  1. Use heap snapshots to identify memory leaks

  2. Disable large caches or move them to Redis

  3. Reduce shard count if memory per shard is high

  4. Upgrade plan if memory exceeds 75% after optimizations

  1. Profile your code for CPU-intensive operations

  2. Offload audio transcoding to dedicated workers

  3. Reduce sync operations in favor of async patterns

  4. Scale to Premium for CPU-heavy workloads

  1. Profile database and HTTP calls for bottlenecks

  2. Enable caching for frequently accessed data

  3. Use deferred replies for operations taking > 3 seconds

  4. Enforce timeouts on external API calls


  1. Request FFmpeg and libsodium from support if not installed

  2. Verify bot permissions — needs CONNECT and SPEAK

  3. Check voice region matches your audience

  4. Consider Lavalink for centralized audio mixing

ProblemSolution
No audio outputConfirm FFmpeg installed, check bot permissions
Audio stutteringReduce concurrent voice connections, upgrade CPU
Voice channel errorsVerify bot has permission to join/speak

ProblemSolution
node-gyp failuresPre-build binaries locally and upload
Module not foundRun npm install in panel console
Outdated Discord.jsUpdate to avoid API incompatibilities
ProblemSolution
pip install errorsUse pip wheel to pre-compile packages
Missing system librariesRequest libffi, libxml2, etc. via support
Wheel build failuresPre-build locally and upload

  1. Implement request queuing with exponential backoff

  2. Respect X-RateLimit headers from Discord

  3. Cache API results to reduce redundant calls

  4. Use bulk operations where available

  5. Log 429 responses with route info to identify hotspots


  1. Check console for exit code and stack trace

  2. Disable problematic features via environment variables

  3. Test fix in staging before promoting to production

  4. Roll back using panel backups if urgent

CodeMeaningAction
0Clean exit (possibly early)Check for missing token or config
1General errorReview stack trace in logs
137Out of memory (OOM killed)Optimize memory or upgrade plan

ProblemSolution
MySQL connection refusedVerify credentials and host/port in env vars
SQLite corruptionRestore from backup, reduce unclean shutdowns
Migration failuresRun migrations locally first, wrap in try/catch

Before contacting support, verify:

  • Token is valid and not expired
  • Required intents are enabled in Discord Dev Portal
  • Environment variables are set correctly
  • Dependencies are installed (npm install / pip install)
  • Entry file path matches start command
  • No rate limit errors in logs
  • Checked discordstatus.com for outages

Gather this information before opening a ticket:

  1. Timeline — When did the issue start?

  2. Recent changes — Deployments, config updates, library upgrades

  3. Console logs — Error messages and stack traces

  4. Guild/user IDs — Affected guilds or users

  5. Steps to reproduce — If known

  • System package installation (FFmpeg, libsodium, codecs)
  • Panel/API access for automation
  • Persistent hardware issues
  • Custom plan requirements (GPU, multi-region)

Incident: <Short description>
Detected: <Timestamp + monitoring source>
Impact: <Commands failing / downtime length / affected guilds>
Immediate Action: <Scale, rollback, disable feature>
Root Cause: <Once found>
Follow-up Tasks: <Testing, automation, docs>