Identify Errors
Your bot crashed, won't start, or behaves strangely? The answer is almost always in the console. This page shows you how to read it, how to log more useful errors, and where to go next for each common error message.
Find the Logs
- Log in to
control.katabump.com - Select your server
- Open the "Console" tab — everything your bot prints (
console.log(),print(), errors) shows up here in real time
If the console has scrolled too far, restart the server and watch the output from the very first line.
Read the First Error, Not the Last
When something breaks, one error often triggers several others. The last line in the console is usually a consequence — the first error is the real cause. Scroll up to where the red text starts.
Reading a Node.js Stack Trace
In Node.js, the error message comes first, followed by the list of calls that led to it. Look for the first line that points to your own file (not node_modules or node:internal):
TypeError: Cannot read properties of undefined (reading 'send')
at Client.<anonymous> (/home/container/events/ready.js:8:21)
at Client.emit (node:events:519:28)
at WebSocketManager.triggerClientReady (/home/container/node_modules/discord.js/...)
- Line 1 — what went wrong: something is
undefinedwhen calling.send - Line 2 — where:
events/ready.js, line 8, column 21 (your code) - Next lines —
node:internals andnode_modules: usually safe to ignore
Reading a Python Traceback
Python prints the calls first ("most recent call last") and the error message at the bottom. Read the last line for the error, then the last frame that points to your own file:
Traceback (most recent call last):
File "/home/container/main.py", line 14, in on_ready ← your file, line 14
await channel.send("Online!")
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'send' ← what went wrong
Add Error Logging
Some errors are silent by default: an unhandled promise rejection or a failing event handler can stop your bot without a clear message. Add these handlers to your entry file so every error lands in the console.
Node.js (discord.js)
Place this near the top of your entry file (e.g. index.js), right after creating your client:
// Promises that fail without a .catch()
process.on('unhandledRejection', (reason) => {
console.error('[unhandledRejection]', reason);
});
// Errors thrown outside of any try/catch
process.on('uncaughtException', (error, origin) => {
console.error('[uncaughtException]', origin, error);
process.exit(1); // The process state is unreliable: exit and fix the cause
});
// Errors emitted by discord.js itself
client.on('error', (error) => console.error('[client error]', error));
client.on('shardError', (error) => console.error('[shard error]', error));
Python (discord.py)
bot.run() already prints discord.py's logs to the console. Add these handlers to also see errors raised inside your events and commands:
import logging
import traceback
# Errors raised inside events (on_message, on_ready, ...)
@bot.event
async def on_error(event, *args, **kwargs):
logging.exception(f"Error in event {event}")
# Errors raised inside prefix commands (!ping, ...)
@bot.event
async def on_command_error(ctx, error):
traceback.print_exception(type(error), error, error.__traceback__)
# Errors raised inside slash commands
@bot.tree.error
async def on_app_command_error(interaction, error):
traceback.print_exception(type(error), error, error.__traceback__)
These handlers make errors visible — they don't make them go away. Once you see the error, fix its cause, then restart the server.
Identify the Cause
- Restart the server and reproduce the problem (run the command, wait for the crash...)
- Find the first error in the console
- Note the file and line it points to in your code
- Look up the message in the table below — most errors have a dedicated page
Error Index
Search for the message you see in the console:
| Error message (excerpt) | Guide |
|---|---|
Something went wrong on control.katabump.com | Something Went Wrong |
Cannot find module, ModuleNotFoundError, ENOENT, No such file or directory | Module Not Found |
TokenInvalid, TOKEN_INVALID, LoginFailure: Improper token | Invalid Token |
Used disallowed intents, PrivilegedIntentsRequired | Disallowed Intents |
Unknown interaction (10062), Interaction has already been acknowledged | Unknown Interaction |
JavaScript heap out of memory, MemoryError, server stops with no error | Out of Memory |
invalid ELF header, NODE_MODULE_VERSION, ERR_DLOPEN_FAILED | Invalid ELF Header |
429 Too Many Requests, bot stops responding for a few minutes | Rate Limited |
Authentication failed, Connection refused, Connection timed out (FileZilla) | SFTP Connection Issues |
Still Stuck?
Open a ticket on our Discord server in #support. To get help quickly, include:
- Your server ID
- The full error, copied from the console starting at the first red line (text, not a screenshot)
- Your language and runtime version (e.g. Node.js 20, Python 3.11)
- What you already tried
Before sharing logs or code, check that they don't contain your bot token or any password. If you leaked it by mistake, reset it right away.