Skip to main content

Troubleshooting

Fix the most common problems with the container, the bot connection, features, scheduled work, notifications, Backup imports, setup, and signing in.

For a problem that isn't listed here, turn on Debug logging and read the debug entries on the Logs page.

The Container Won't Start

docker logs discord-stonker-bot, or docker compose logs app with Compose, shows why the appliance stopped.

  • "POSTGRES_DB must start with a lowercase letter…" — Database and role names use only lowercase letters, digits, and underscores.
  • "Unknown timezone: …" — Set TZ to an IANA name, such as America/New_York.
  • "PostgreSQL data directory is non-empty but has no PG_VERSION marker." — The data volume holds files that aren't a PostgreSQL database.
  • "The installation key must contain 64 hexadecimal characters followed by a newline." — The installation key file was changed or cut short. A version 4.0 raw 32-byte key is converted automatically after it is verified.
  • "Refusing to overwrite PostgreSQL state…" or "Refusing to overwrite the installation key…" — Both an old-layout source and a non-empty contract destination exist. Startup leaves both intact; compare them and keep the database and key that belong together before restarting.
  • "The installation key at /config/keys/installation.key doesn't belong to this database. Put back the key file this database was created with, or delete /config/keys/installation.key and restart to make a new key, then enter the saved secrets again." — The installation key file comes from another database, such as after restoring a dump into a new container, as described in Storage and Backups.
  • "Migration … changed after it was applied." — A migration file in the image differs from the one the database already ran.

The Bot Shows Stopped by an Error

The panel shows "Check the bot token on the Connection page, then restart the bot." for every failure, so check each cause in turn. The gateway_start_failed entry in the Bot log and a Bot can't sign in notification include Discord's own reason.

  • Wrong token — On the Connection page, select Replace token, paste a fresh token from the Developer Portal, and select Save token. A running bot reconnects with it on its own.
  • A privileged intent is off — Switch on the intents your enabled features need, as described in Discord Application, then select Restart.
  • Slow connection — The start gives up after 15 seconds, so check the host's network access to Discord.

The Bot Shows Not Connected

No Bot Token is saved. Save one on the Connection page, then select Start.

When Saved secrets were removed is at the top of the page, a lost installation key took the token, so select Enter the Bot Token in that notice, as described in Storage and Backups.

The Bot Shows Not Responding

The bot is set to run, but its process hasn't written a heartbeat for 90 seconds. docker logs discord-stonker-bot, or docker compose logs app with Compose, shows what happened, and s6 restarts the bot process on its own when it exits.

A Feature Won't Turn On

  • The switch is disabled — The feature isn't set up yet, so select Start from the example or Start from scratch, or import configuration from Backup.
  • "Set up this feature before turning it on." — The same cause, reported by the API.
  • "Fix this feature's settings before turning it on." — The saved settings fail a check, so fix the marked fields, save, and turn it on again.
  • "Check the highlighted fields." — Saving found a problem, so fix the marked fields and save again.
  • "Enter this secret." — A secret field has no value, so enter one before you save.
  • "This feature changed since you opened it. Reload to see the latest version." — Someone else saved the feature first, so select Reload and make your change again.
  • Anti-raid stays off after an older config.json import — The old file has no alert channel under Raid bans, so choose one and save.
  • It turns on but does nothing — Check the configuration issues on the Overview page, which lists problems found when the bot connected. Scheduled posts, RSS feeds, permission toggles, and web applications don't show there, so check the Worker or Web log instead.

The Bot Doesn't Post or Act

  • Missing permissions — Give the bot's role the permissions the feature needs, as listed in Permissions and Intents.
  • Role order — Move the bot's role above every role it gives, removes, or manages.
  • Unknown channel or role — A picker shows Unknown channel or Unknown role when the ID isn't in the selected server, so choose one from the list.
  • Missed events — The bot sees edits, deletes, and member changes only for messages and members it has seen since its last reconnect.

Scheduled Posts Are Missing or Repeated

  • Missing — The bot was stopped at that time, and scheduled times that pass while it is stopped are skipped.
  • Failed — Every delivery attempt failed, and the Worker log shows job_failed with the reason, such as "Missing Permissions". A Job gave up notification can tell you when a post fails on every try.
  • Reaction failed — The posted message ID is saved before reactions are added, so a failed reaction retry adds only the remaining reactions and doesn't post the message again.
  • Many at once — The worker caught up on up to 24 hours of missed times after it had been down.
  • Wrong hour — Each schedule uses UTC unless you set its Time zone.

Notifications Don't Arrive

More causes are listed in Notifications.

A Backup Import Is Rejected

  • A feature is imported but stays off — Its older settings don't pass the current checks, so open it in Features and fix the marked fields, as described in Legacy Migration.
  • "This config.json belongs to another Discord server. Switch to that server first." — Select the server that matches the file's guild-id in the server menu, or remove that value from the file.
  • "Another server already uses …" — Change the conflicting invite or webhook path in the older file or on the other server before importing.
  • "That file is not valid JSON." — The selected file is damaged or is not JSON.
  • The export file is rejected in Source — Choose the original discord-stonker-bot-export-YYYY-MM-DD.json file without adding, removing, or renaming its fields.
  • An older config.json is rejected in Source — Check that the file is the legacy bot's config.json and is no longer than 750,000 characters.
  • "Choose a JSON file smaller than 10 MB." — The browser refuses any selected source above its upload limit.
  • "Confirm it's you again." — The five-minute confirmation expired, was already used, came from another browser session, or was made for export instead of import. Return to Review and confirm again.

Export and Import explains the Source, Settings, Review, and Importing steps and what each source replaces, adds, or skips.

Setup Problems

  • "That setup code is wrong or expired. Restart the container to print a new one." — Each restart prints a new setup code, so use the last setup_code_issued line, or run docker restart discord-stonker-bot (docker compose restart app with Compose) for a fresh one.
  • "Too many setup attempts. Try again in 15 minutes." — Setup allows 10 wrong codes from one address in 15 minutes.
  • No code in the log — An account already exists, so the panel shows the sign-in screen instead.

Sign-In Problems