ACLClouds
ACLClouds

My bot is offline: which logs should I check?

Differentiate invalid token, missing dependency, crash loop and memory overflow. A 401 or invalid token error requires regenerating the token.

Start with the service console and work your way up to the first error your application generated.

Step-by-step procedure

  1. Check connection

    A 401 or invalid token error requires regenerating the token. Don't post it in the ticket.

  2. Check dependencies

    A module not found indicates that the installation did not complete or the package is missing from the dependencies file.

  3. Observe restarts

    A fast loop means that the process exits immediately. Correct the error before clicking Start several times.

  4. Monitor limits

    An exit 137 or OOM indicates a lack of memory. Reduce the cache or choose a higher plan.

  5. Respect rate limits

    Discord 429 responses ask to reduce call frequency and use library queuing mechanisms.

Where to read the logs

A bot’s logs are read in the “Console” tab. It mixes your code’s output (console.log, print, errors) with the platform’s lines, which start with [ACLClouds]: and describe each step of the launch.

The “Errors” filter isolates the error lines. “Copy all logs” and “Download logs (.txt)” get the full output, for example for a ticket: read it again before sending it, because a token printed by your code would be in it too.

Reading a crash sequence

A crash always follows the same pattern. Find the command line, then read down to the first error from your code:

The platform restarts the bot up to three times in a row. Running for at least 60 seconds resets this counter. Fix the error before clicking “Start”: running the same code again repeats the same sequence.

  • “Server marked as starting”, then the command, for example $ node index.js;
  • your code’s output, then the error, for example Error [TokenInvalid] or Traceback (most recent call last);
  • “Process exited with code 1.”, then “Server marked as crashed”;
  • “New attempt 1/3”, and after three failures “The bot stopped after 3 failed starts. Last error above.”

What the exit code tells you

The number shown at the end of the process exit line points to the cause:

  • 1: an unhandled error in your code, with the cause just above;
  • 137: process killed; with “(out of memory)”, the bot went over its plan’s memory.

Frequently asked questions

The bot is “Crashed” and no longer restarts: where is the error?

In the console, a box “The bot stopped after several crashes” shows the last error lines. Fix the file concerned, then click “Start”.

What should I do about Error: listen EADDRINUSE: address already in use :::3000?

Two HTTP servers in your code listen on the same port, often a “keep alive” server copied from a tutorial on top of your dashboard. A Discord bot does not need a port. If you want one, assign it in Startup and open a single server on process.env.PORT, at address 0.0.0.0.

The bot is online but does not respond: what should I check?

No error appears in this case. For prefix commands, enable “Message Content Intent” in the Discord portal: without it, message.content arrives empty. For slash commands, check that they were registered. Add a console.log at the start of the event handler to see in the console whether it is called.