Troubleshooting Guide
This guide covers common issues and their solutions.
Bot Issues
Bot Offline
Symptoms: Bot shows as offline in Discord, no data being captured.
Solutions:
Check if the application is running
# View running containers docker ps # Or check if dotnet process is running ps aux | grep dotnetCheck application logs
- Open Aspire dashboard: https://localhost:17113
- Look for the Bot service
- Check for error messages
Verify the bot token
# Check if token is set dotnet user-secrets list --project src/DiscordDataMirror.BotIf token is missing, set it:
dotnet user-secrets set "Discord:Token" "your-token"Validate token is correct
- Go to Discord Developer Portal
- Regenerate token if unsure
- Update the stored token
Check network connectivity
# Test Discord API access curl -I https://discord.com/api/v10/gateway
"Disallowed Intents" Error
Symptoms: Error message about intents in logs, bot connects but doesn't receive events.
Solution:
- Go to Discord Developer Portal
- Select your application
- Go to Bot section
- Enable under "Privileged Gateway Intents":
- ✅ SERVER MEMBERS INTENT
- ✅ MESSAGE CONTENT INTENT
- Save changes
- Wait 1-2 minutes for propagation
- Restart the application
"Missing Access" Errors
Symptoms: Bot is online but can't see certain channels.
Solutions:
Check bot role position
- In Discord, go to Server Settings → Roles
- Drag the bot's role higher in the list
- Roles can only see channels at or below their level
Check channel permissions
- Right-click channel → Edit Channel → Permissions
- Ensure the bot role has "View Channel" and "Read Message History"
Re-invite with correct permissions
https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=66560&scope=bot
Messages Not Captured in Real-Time
Symptoms: Old messages sync, but new messages don't appear.
Solutions:
Check Message Content Intent
- Without this intent, message content is empty
- Enable in Developer Portal
Check for gateway disconnections
- Look for "Disconnected" or "Reconnecting" in logs
- Network issues can cause temporary gaps
Verify channel is text-based
- Voice channels don't have messages
- Category channels don't have messages
Check for rate limiting
- Heavy sync operations may delay real-time capture
- Wait for backfill to complete
Database Issues
Connection Failed
Symptoms: Application crashes on startup with database errors.
Solutions:
Check if PostgreSQL is running
docker ps | grep postgresCheck the connection string
- In development, Aspire handles this automatically
- Verify Docker networking is working
Test database connectivity
psql -h localhost -p 5432 -U postgres -d discorddatamirrorReset the database container
docker compose down -v docker compose up -d
Migrations Failed
Symptoms: Errors about schema or missing tables.
Solutions:
Run migrations manually
cd src/DiscordDataMirror.Infrastructure dotnet ef database updateCheck migration history
SELECT * FROM "__EFMigrationsHistory";Reset database (development only)
dotnet ef database drop --force dotnet ef database update
Database Full
Symptoms: Insert errors, disk space warnings.
Solutions:
Check disk usage
df -hCheck table sizes
SELECT relname as table, pg_size_pretty(pg_total_relation_size(relid)) as size FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;Vacuum and analyze
VACUUM ANALYZE;Consider data retention policies
- Delete old messages
- Archive to cold storage
- Increase disk space
Dashboard Issues
Dashboard Won't Load
Symptoms: Browser shows error or blank page.
Solutions:
Check if dashboard service is running
- Open Aspire dashboard: https://localhost:17113
- Verify Dashboard service is green
Check the URL
- Default: https://localhost:5001
- May vary based on configuration
Check browser console
- Press F12 → Console tab
- Look for JavaScript errors
Clear browser cache
- Ctrl+Shift+Delete
- Clear cached images and files
Slow Performance
Symptoms: Dashboard takes long to load, searches time out.
Solutions:
Add database indexes
CREATE INDEX IF NOT EXISTS idx_messages_channel_timestamp ON messages(channel_id, timestamp DESC); CREATE INDEX IF NOT EXISTS idx_messages_content_search ON messages USING gin(to_tsvector('english', content));Reduce page size
- Lower
Dashboard:ItemsPerPagein config
- Lower
Check database query plans
EXPLAIN ANALYZE SELECT * FROM messages WHERE ...;Increase server resources
- More RAM for PostgreSQL
- Faster disk (SSD)
Real-Time Updates Not Working
Symptoms: Need to refresh page to see new messages.
Solutions:
Check SignalR connection
- Browser console should show SignalR connected
- Look for WebSocket errors
Verify SignalR is enabled
{ "Dashboard": { "EnableRealTimeUpdates": true } }Check firewall/proxy
- WebSockets may be blocked
- Ensure port is accessible
Sync Issues
Initial Sync Stuck
Symptoms: Sync progress doesn't advance, appears frozen.
Solutions:
Check logs for errors
- Rate limiting messages
- Permission errors
- Network timeouts
Check sync status table
SELECT * FROM sync_state WHERE status = 'in_progress';Reset stuck syncs
UPDATE sync_state SET status = 'idle' WHERE status = 'in_progress';Reduce parallel channels
{ "Sync": { "ParallelChannels": 1 } }
Missing Historical Messages
Symptoms: Sync completes but older messages are missing.
Causes:
Discord retention limits
- Some server features limit message history
- Deleted messages can't be fetched
Bot joined after messages
- Bot can only fetch messages from after its oldest cached message
- For new channels, this goes back to channel creation
Configuration limits
- Check
Sync:MaxHistoricalMessages - Set to
-1for unlimited
- Check
Docker Issues
Container Won't Start
Solutions:
Check container logs
docker logs discorddatamirror-bot-1Verify image exists
docker images | grep discorddatamirrorPull latest image
docker compose pullRebuild containers
docker compose down docker compose up --build
Port Already in Use
Symptoms: Error about port binding.
Solutions:
Find what's using the port
lsof -i :5432 # PostgreSQL lsof -i :5001 # DashboardStop conflicting service
sudo systemctl stop postgresqlChange the port in configuration
- Modify docker-compose.yaml
- Update connection strings
Getting More Help
Collect Debug Information
Before asking for help, gather:
Application version
dotnet --infoError logs (redact sensitive info)
Configuration (redact tokens)
System info
- OS and version
- Docker version
- Available RAM/disk
Where to Get Help
- GitHub Issues: https://github.com/JerrettDavis/DiscordDataMirror/issues
- GitHub Discussions: https://github.com/JerrettDavis/DiscordDataMirror/discussions
- Search existing issues before posting
Reporting Bugs
Include:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Error messages
- Environment details