CoreX Hosting

Fix a bot that will not start or keeps stopping

My bot crashes, stays offline or stops straight after starting. What do I do?

Read the last lines in the Console: they name the problem. The usual causes are a missing or wrong token, the wrong start file, a missing dependency, or running out of memory.

Before you start: Access to your bot's panel.

Step by step

  1. Open Console and press Start. Read the red or last lines after "CoreX: installing dependencies" and before "the bot exited".
  2. "An invalid token was provided", "Improper token" or a 401 error: save the correct token under Environment using the exact name your code reads, then restart.
  3. "Cannot find module" (Node.js) or "ModuleNotFoundError" (Python): add the package to package.json or requirements.txt, make sure that file is uploaded next to your code, and keep "Install dependencies before each start" switched on under Bot settings.
  4. "Cannot find module '/home/container/index.js'" or "can't open file": the start file under Bot settings does not match your project. Set it to your real main file, for example src/index.js.
  5. A syntax error that mentions a newer language feature: switch to a newer runtime version under Bot settings and restart.
  6. The bot stops with no error and memory use at the top of the panel was near the limit: it ran out of memory. Move to a bigger plan from Billing > Change plan.

Check it worked: The Console shows your bot's ready message and it stays running for more than a minute.

Why it happens: A bot that crashes is started again automatically, but if it crashes again within a minute it is left stopped so a broken bot does not restart for ever.

If the Console shows nothing at all after pressing Start, or the panel says the node is not answering, contact support with your service ID.

More guides on Discord bot hosting: