Read your Discord bot's logs and find the error
When a bot crashes, stops responding or never comes online, the answer is almost always in its log. This guide shows you how to read the console, make sense of a stack trace or traceback, add logging of your own, and recognise the intent, permission and rate limit errors Discord sends back.
7 min read · Updated Oct 21, 2026 · By GuavaHost Team
The console is the log
Open your bot's server at customer.guavahost.com and look at the Console. Everything your bot prints, and everything that crashes it, appears there as it happens. There is no separate log file to hunt for unless you create one yourself.
Two habits make it far more useful:
- Read from the top of the failure, not the bottom. The last line is often the process exiting. The first error line above it is the cause.
- Restart and watch. Press Restart and keep your eyes on the console as it boots. A startup problem shows itself in the first few seconds, in order, which is much easier than reading a scrolled back wall of text.
A healthy start looks like the dependency install finishing, then your own ready line, something like Logged in as MyBot#1234. If you never see your ready line, the bot never logged in, and the error is above.
Reading a Node.js stack trace
discord.js bots fail with a stack trace: the error, then the path it took to get there, newest call first.
TypeError: Cannot read properties of undefined (reading 'send')
at Client.<anonymous> (/home/container/commands/welcome.js:14:22)
at Client.emit (node:events:518:28)
Ignore the lines inside node:events or node_modules. The line that matters is the one in your own code: commands/welcome.js, line 14, character 22. That tells you something on line 14 was undefined when you called .send() on it, which on a welcome handler usually means the channel was not found.
The pattern holds for nearly every Node error. Find the topmost frame with your own filename in it and start there.
Reading a Python traceback
discord.py prints a traceback, which is the same information in the opposite order: oldest call first, the real error last.
Traceback (most recent call last):
File "/home/container/bot.py", line 42, in on_message
await message.channel.send(replies[key])
KeyError: 'greeting'
Read the bottom line for what went wrong (KeyError: 'greeting', so a dictionary had no greeting key) and the last File line above it for where. Anything mentioning site-packages is library code, not yours.
Unhandled promise rejections and swallowed errors
The most frustrating bug is the one that prints nothing. In both languages an error inside an async handler can vanish if nothing is watching for it.
On Node, catch what the rest of your code missed by adding this near the top of your main file:
process.on('unhandledRejection', err => console.error('Unhandled rejection:', err));
process.on('uncaughtException', err => console.error('Uncaught exception:', err));
On Python, discord.py already routes handler errors to its logger, so turn the logger on rather than relying on print:
import logging
logging.basicConfig(level=logging.INFO)
That one line gives you timestamps, library warnings and gateway events you would otherwise never see, and it is the fastest upgrade to any discord.py bot's debuggability.
Logging on purpose
Printing as you go is not cheating, it is the main technique. A few rules that keep it useful:
- Log the start of an action, not just the failure, so you can tell whether your code was reached at all.
- Include the value you are unsure about:
console.log('guild', guild?.id, 'channel', channelId)rather thanconsole.log('here'). - Prefix with something searchable, for example
[tickets], so you can scan one feature's lines out of a busy console. - Use
console.errororlogging.errorfor problems, and turn the noisy lines off once the bug is fixed. A console full of per message logging hides the next error.
If you want a log you can keep, write it to a file in your server's files as well as the console and download it later over SFTP. How to read your server logs and crash reports covers log files on a GuavaHost server generally.
Errors that come from Discord, not your code
Some failures are your bot asking Discord for something it is not allowed to do. These have recognisable shapes.
| Message or code | What it means |
|---|---|
Used disallowed intents / PrivilegedIntentsRequired | A privileged Gateway Intent (Message Content, Server Members or Presence) is requested in code but not switched on in the Discord Developer Portal. |
| Bot connects but never sees message text | Message Content intent missing, so the content arrives empty. |
DiscordAPIError[50013]: Missing Permissions | The bot is in the channel but lacks a permission for the action, often Send Messages, Embed Links, Manage Roles or Attach Files. |
DiscordAPIError[50001]: Missing Access | The bot cannot see the channel at all. Check channel overwrites and the role it holds. |
DiscordAPIError[50035]: Invalid Form Body | The payload broke a limit or a rule, for example an embed over the character limit or an empty message. |
DiscordAPIError[10062]: Unknown interaction | You answered a slash command too late. Discord gives you three seconds, so defer the reply if the work takes longer. |
An invalid token was provided / LoginFailure | The token is wrong, has a stray space, or was reset. |
429 Too Many Requests | Rate limited. |
An intent is a switch telling Discord which categories of event to send your bot, and the three privileged ones must be enabled on your application before your code can ask for them. A permission error is about role hierarchy as much as checkboxes: a bot cannot manage a role higher than its own, no matter what its permissions say.
Rate limits
Discord limits how often you can call its API, and a bot that loops over members or edits a message on every tick will hit that limit. Both libraries handle normal rate limits for you by queuing and retrying, so an occasional warning in the log is not a bug.
What you should act on:
- Repeated warnings on the same route. Something is calling it far too often, so batch the work, cache the result, or slow the loop down.
- Editing a message in a loop. Once a second is a rate limit waiting to happen, and once every few seconds is plenty for a live counter.
- A Cloudflare ban, which is what happens if you keep hammering after being limited. The bot cannot talk to Discord for a while, and the only cure is fixing the behaviour.
Rate limits are per route and per bot, so splitting the work across two processes does not raise your ceiling.
Keep secrets out of your logs
It is surprisingly easy to print your own token: a console.log(client.token) left in from debugging, or a crash handler that dumps the whole config object. Then you paste that console output into Discord to ask for help.
- Never log a whole config or environment object. Log the one field you need.
- Before sharing console output, replace anything credential shaped with
REDACTED. Tokens, database passwords and webhook URLs all count, and a webhook URL is as good as a password for posting to that channel. - If a token has been in a log you shared, treat it as leaked and reset it. Keeping your Discord bot token secret and safe walks through resetting it and updating Startup settings. Our team never needs your bot token to help you.
When the bot stops and the log says nothing
A silent exit with no error is usually resources rather than code. An out of memory kill ends the process without a stack trace, and so does a loop that ties up the process until nothing responds. Why your Discord bot keeps going offline runs through those causes in order, and if the failure happens during the dependency install instead, installing dependencies for a Discord bot has the install errors and what each one means.
Common questions
Where do I find my Discord bot's logs?
In the Console on your bot's server at customer.guavahost.com. It shows live output, so press Restart and watch it from the first line if you are chasing a startup problem. Anything you want to keep, write to a file from your code and download it afterwards.
Why does my bot run with no errors but ignore messages?
Nearly always the Message Content intent. Without it Discord delivers the event with an empty content field, so your checks never match and nothing looks broken. Switch it on in the Developer Portal, make sure your code requests it, and restart.
What does Missing Permissions mean when my bot is an administrator?
Either a channel level permission overwrite is denying the action, or the target sits above the bot in the role list. Role hierarchy beats permissions, so a bot can never edit, kick or assign anything attached to a role higher than its own highest role.
Is it safe to paste my console log in Discord for help?
Only after you have read it through. Logs can contain your bot token, database passwords or webhook URLs, so replace anything credential shaped before you post it, and reset the token if one was already exposed.
Still stuck? Jump into our Discord at discord.gg/GuavaHost and the team will help you out.
- discord bots
- logs
- debugging
- console
- errors
Host your Discord bot 24/7 From $1.50/mo, with instant setup and DDoS protection.
Still need help? Our team is online 24/7 to answer questions.