Troubleshooting
PM2 process not found
If you get "process not found" when running pm2 commands, you are likely running as a different user from the one that started PM2. Prefix commands with sudo -u <user>:
sudo -u bot pm2 status
sudo -u bot pm2 restart all
Slash commands not appearing in Discord
- Confirm
pnpm deploy:commandscompleted without errors. - Guild commands (when
DISCORD_GUILD_IDis set) appear immediately. - Global commands (no
DISCORD_GUILD_ID) can take up to 60 minutes to propagate. SetDISCORD_GUILD_IDduring development.
Dashboard login fails
- Verify
DISCORD_REDIRECT_URIin.envexactly matches the redirect registered in the Discord Developer Portal (including protocol and path). - Check that the API is running and healthy:
curl http://localhost:4000/health
- Check the API logs for errors:
pm2 logs api
Database connection errors
- Confirm PostgreSQL is running:
sudo systemctl status postgresql - Test the connection string directly:
psql "postgresql://arkenbot:password@localhost:5432/arkenbot" -c "SELECT 1;"
- Make sure
DATABASE_URLin.envdoes not have surrounding quotes.
.next build permission errors
The .next directory is created by the Next.js build process. If you switch between running builds as different users, ownership conflicts can occur. Fix with:
sudo chown -R <build-user>:<group> packages/web/.next
Redis connection errors
- Confirm Redis is running:
sudo systemctl status redis-server - Test:
redis-cli ping— should returnPONG. - If your Redis instance has a password, set
REDIS_PASSWORDin.env.
Music commands not working
- Confirm both binaries are installed and on
PATHfor the user PM2 runs as:yt-dlp --versionandffmpeg -version. There's no separate server to check — playback runs directly through these two. - Check the bot logs for the actual error:
pm2 logs bot | grep -i yt-dlp - If you see YouTube 403s or "Sign in to confirm you're not a bot" errors, your server's IP is likely blocked — set up
YTDLP_PROXYorYOUTUBE_COOKIES_FILE(see Deployment → Music Support). - If it used to work and suddenly stopped, re-download the latest
yt-dlprelease — YouTube changes break older versions frequently.
Bot joins but can't assign roles
The bot's role in the server role list must be above any roles it needs to assign. Go to Server Settings → Roles and drag the ArkenBot role above your managed roles.
API returns 500 on login after a restart
Discord's OAuth2 token endpoint occasionally returns 500 during high-traffic periods or immediately after a service restart. Wait a few seconds and try again. If the error persists, check pm2 logs api for the underlying error.