Troubleshooting
This guide covers common issues with JamBot and their solutions.
Quick Diagnosis: Bot Not Detecting Messages
If your bot is online but not responding to messages:
Step 1: Verify Message Content Intent
This is the #1 reason bots don’t detect messages.
- Go to Discord Developer Portal
- Select your JamBot application
- Click “Bot” in the left sidebar
- Scroll down to “Privileged Gateway Intents”
- Ensure “Message Content Intent” is toggled ON
- Click “Save Changes”
- Restart your bot
Step 2: Verify Your User ID
The bot only responds to configured jam leader user IDs.
- Enable Developer Mode: Discord Settings → Advanced → Developer Mode ON
- Right-click your username → Copy User ID
- Use
/jambot-setupto add yourself as a jam leader
Step 3: Verify Bot Can See the Channel
- Look at the member list on the right side of the channel
- Find JamBot in the list
- If not there: Right-click channel → Edit Channel → Permissions → Add JamBot
Step 4: Test Message Format
Use this exact format:
Here's the setlist for the 7pm jam on November 20th.
1. Will the Circle Be Unbroken2. Rocky Top3. Man of Constant SorrowRequirements:
- Line 1 must contain:
here's the setlist for the [TIME] jam on [DATE]. - There must be a period (.) after the date
- Songs must be numbered:
1. Song Title
Step 5: Check the Logs
docker compose logs -f| What You See | Problem | Solution |
|---|---|---|
| No “Received message” logs | Message Content Intent not enabled | Step 1 |
| ”Received message” but wrong user ID | Not configured as jam leader | Use /jambot-setup |
| ”Received message” but no “Detected setlist” | Message format wrong | Check Step 4 |
| ”Detected setlist message” | ✅ Working! | Bot should send you a DM |
Bot Status Issues
Bot shows as offline
Solutions:
- Check if bot process is running
- Verify Discord token in
.env - Check network connectivity
- Restart the bot
Bot connects then disconnects
Solutions:
- Check Discord Developer Portal for enabled intents
- Verify configuration is valid
- Check database initialization
Discord Integration
Bot doesn’t detect setlist messages
- Verify jam leader ID is correct
- Check bot permissions in channel
- Test setlist format matches expected pattern
Bot can’t send DMs to admin
- Verify admin User ID is correct
- Check admin’s DM privacy settings (Settings → Privacy & Safety → Allow DMs from server members)
- Ensure bot and admin share a server
Reactions not detected
- Verify bot has Add Reactions permission
- Wait for message to fully load before reacting
- Check logs for reaction events
Spotify Integration
Authentication failed
- Verify client ID and secret in configuration
- Regenerate refresh token if expired
- Verify redirect URI matches exactly
Song search returns no results
- Test search manually in Spotify
- Try variations of the song name
- Use manual override with direct Spotify link
Rate limit errors
Bot includes automatic retry logic. For persistent issues:
- Check retry logs
- Add delays between searches
- Split large setlists
Playlist creation fails
- Verify Spotify permissions/scopes
- Check logs for specific errors
- Test playlist creation manually
Database Issues
Database initialization fails
- Check directory permissions (
chmod 700 data/) - Verify disk space
- Check database path in configuration
Database locked error
- Ensure only one bot instance is running
- Remove lock files:
rm data/jambot.db-wal data/jambot.db-shm - Check database integrity
Data not persisting
- Verify volume mount in Docker
- Check that database writes are succeeding
- Match mount path with
DATABASE_PATH
Deployment Issues
Container won’t start
- Check container logs
- Verify all environment variables are set
- Build without cache:
docker-compose build --no-cache
DigitalOcean deployment fails
- Verify image in registry
- Check environment variables in App Platform
- Review deployment logs
- Consider increasing resources
Common Error Messages
| Error | Solution |
|---|---|
| ”Missing required environment variables” | Check .env file |
| ”Invalid Spotify track URL” | Use format https://open.spotify.com/track/TRACK_ID |
| ”Could not find admin user” | Verify DISCORD_ADMIN_ID |
| ”Failed to create playlist” | Check Spotify authentication |
| ”Database transaction failed” | Check permissions and disk space |
| ”Discord API error: 50007” | Admin has DMs disabled |
| ”Discord API error: 50013” | Missing bot permissions |
| ”429 Too Many Requests” | Rate limited - bot will auto-retry |
Debugging Tips
Enable Verbose Logging
# In .envLOG_LEVEL=DEBUGMonitor in Real-Time
# Follow logstail -f logs/jambot.log
# Monitor containerdocker stats jambotTest Individual Components
# Test configfrom src.config import ConfigConfig.validate()
# Test databasefrom src.database import Databasedb = Database()
# Test Spotifyfrom src.spotify_client import SpotifyClientsp = SpotifyClient()Prevention Tips
- Regular backups: Backup
data/jambot.dbregularly - Monitor logs: Review logs weekly for warnings/errors
- Update dependencies: Keep Python packages updated
- Test changes: Test in development before deploying
Still Need Help?
- Review the source code in
src/ - Check GitHub Issues
- Consult Discord and Spotify API documentation