Troubleshooting¶
Each problem below starts with what you see. Look at the bot's log first, since it names most problems:
On a bare-metal host, the log is journalctl -u teabot.
setup.sh says "cannot reach Docker"¶
Docker is not running, or on Linux your user may not use it. Start Docker, or add yourself to the docker group, then log out and in again:
"did not become healthy within 90 seconds"¶
setup.sh printed the end of the bot's log above this message.
LoginFailureorImproper token. The token is wrong. Reset it in the developer portal, put the new one afterTEABOT_DISCORD_TOKEN=inteabot.env, and run./setup.shagain.PrivilegedIntentsRequired. Turn on Server Members Intent on the Bot tab of the developer portal, then run./setup.shagain.
"A new password would lock teabot out of its database"¶
Or, from the bot's log: password authentication failed for user "teabot_owner".
The database already exists, but .env, which holds its password, is missing or newer than it. Postgres keeps the password it was first started with.
- If you have the old
.env, put it back and run./setup.shagain. -
On a new install with nothing to keep, delete the database, then run
./setup.shagain:Warning
down -vdeletes the database of every teabot on this machine. Never run it on an install with data you want.
/healthz stops saying "ok":true¶
The log says why. The two usual causes are the same as at setup: a token that was reset (put the new one in teabot.env), or the Server Members Intent turned off. After fixing either, recreate the bot:
The log says event loop blocked¶
A plugin held teabot for more than a second, and the log line names it, with the file and line. Past thirty seconds teabot stops, logs every thread's traceback, and Compose or systemd starts it again. A job that does this on every attempt is failed, so it does not stop teabot over and over. If one plugin keeps doing it, block it with TEABOT_DISABLED_PLUGINS (see Turn a plugin off everywhere) and tell its author.
A plugin you installed may be harmful¶
A plugin runs inside the bot, with everything the bot can reach: its Discord token and its database passwords. If you think one has misused them:
- Remove the plugin and deploy, as in Remove a plugin. Blocking it is not enough, since its code may already have taken the secrets.
- Reset the bot's token in the Discord developer portal, under Bot, then Reset Token. Put the new one in
teabot.env. -
Give the database new passwords, and restart the bot:
-
Give the owner role a new password too. Set it in Postgres, put the same value in
.envasTEABOT_DB_OWNER_PASSWORD, and recreate both services: -
If it came from the plugin hub, report it in the hub's issues, so it can be delisted for everyone.
Permission denied reading /app/teabot.env¶
TEABOT_UID and TEABOT_GID in .env must be the ids of the user who owns teabot.env. Compare:
Put your ids in .env, then run docker compose up -d.
A setting change did nothing¶
The bot reads teabot.env when its container starts. Recreate it, which restart does not do:
A plugin does not load¶
/healthz shows each plugin's state, such as failed or duplicate_id, and the log names the error:
- A plugin you added or changed needs
docker compose up -d --build. duplicate_idmeans two plugins have the same id, so neither loads. Remove one.
Commands do not appear in Discord¶
- A plugin's commands appear in a server only after
/plugins enable. - A member sees only the commands they can use. See Who can use what.
- New commands can take a minute. Reload Discord with Ctrl+R, or Cmd+R on macOS.
For problems inside a server, such as a command that refuses, see Using teabot's troubleshooting.