-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
Common issues and solutions for the Wisp Framework.
See also: Configuration-Reference | Deployment-Guide | API-Reference
- Installation Issues
- Configuration Issues
- Database Issues
- Module Issues
- Command Issues
- Performance Issues
- Deployment Issues
Problem: Package not found during installation.
Solutions:
- Check URL format:
git+https://github.com/redkeysh/wisp.git - Ensure repository is accessible
- Check Python version (requires 3.13+)
- Try upgrading pip:
pip install --upgrade pip
Problem: ModuleNotFoundError when importing.
Solutions:
- Verify installation:
pip show wisp-framework - Check Python environment
- Reinstall:
pip install --force-reinstall git+https://github.com/redkeysh/wisp.git - Check import path:
from wisp_framework import WispBot, create_app, Module, ... -
Common error:
cannot import name 'Wisp'- There is noWispclass. UseWispBot(the main bot class) orcreate_app()(convenience function) instead.
Problem: ConfigError: Missing required environment variables: DISCORD_TOKEN
Solutions:
- Set
DISCORD_TOKENenvironment variable - Create
.env.localfile withDISCORD_TOKEN=your_token - Check token is valid in Discord Developer Portal
Problem: Environment variables from .env file not loading.
Solutions:
- Check
ENVvariable (defaults tolocal) - Ensure file is named
.env.{ENV} - Verify file format (no spaces around
=) - Check file permissions
Problem: Bot not receiving events.
Solutions:
- Enable intents in Discord Developer Portal
- Set intent environment variables:
INTENTS_MEMBERS=true - Check bot has necessary permissions
- Verify intent configuration in code
Problem: Database connection fails.
Solutions:
- Check
DATABASE_URLformat - Verify database is running
- Check network connectivity
- Verify credentials
- Check firewall rules
Problem: Alembic migrations fail.
Solutions:
- Check database connection
- Verify Alembic configuration
- Review migration files
- Try:
alembic upgrade head --sql(dry run) - Check database permissions
Problem: "QueuePool limit of size X overflow Y reached"
Solutions:
- Increase pool size:
DB_POOL_SIZE=20 - Increase max overflow:
DB_MAX_OVERFLOW=30 - Check for connection leaks
- Review connection usage
Problem: Using default passwords in production.
Solutions:
- MUST change all default passwords
- Set strong passwords via environment variables
- Never commit passwords to version control
- Use secret management services
Problem: Module doesn't appear or load.
Solutions:
- Check module is registered:
module_registry.register(MyModule()) - Verify module name is unique
- Check module is enabled for guild
- Review module logs for errors
- Check required services are available
Problem: Module fails due to missing dependency.
Solutions:
- Declare dependencies:
depends_on = ["other_module"] - Ensure dependency is registered first
- Check dependency is enabled
- Review dependency loading order
Problem: Required service not found.
Solutions:
- Check service is registered
- Verify service started successfully
- Check service name spelling
- Review service logs
- Provide fallback behavior
Problem: Slash commands don't show in Discord.
Solutions:
- Wait for sync (can take up to 1 hour globally)
- Use
/synccommand (owner only) - Check
SYNC_ON_STARTUPis enabled - Verify bot has "Use Slash Commands" permission
- Check intents are enabled
- Review command registration code
Problem: Commands fail with errors.
Solutions:
- Check error logs
- Use
@handle_errorsdecorator - Validate user input
- Check permissions
- Review command implementation
Problem: Commands fail permission checks.
Solutions:
- Use
@require_guildfor guild-only commands - Use
@require_adminfor admin commands - Use
@require_ownerfor owner commands - Check bot permissions in guild
- Verify user has required permissions
Problem: Bot uses too much memory.
Solutions:
- Review cache usage
- Check for memory leaks
- Limit cached data size
- Use Redis instead of in-memory cache
- Review module resource usage
Problem: Commands are slow to respond.
Solutions:
- Optimize database queries
- Use caching for frequent data
- Review async/await usage
- Check network latency
- Profile command execution
Problem: Database queries are slow.
Solutions:
- Add database indexes
- Optimize queries
- Use connection pooling
- Review query patterns
- Consider caching
Problem: Docker container fails to start.
Solutions:
- Check logs:
docker-compose logs bot - Verify environment variables
- Check Docker resources
- Review health checks
- Check container permissions
Problem: Migrations fail in production.
Solutions:
- Test migrations in staging first
- Review migration files
- Check database permissions
- Verify database version compatibility
- Have rollback plan
Problem: Environment variables not set in production.
Solutions:
- Verify
.env.prodfile exists - Check variable names match
- Review deployment process
- Use secret management
- Test configuration before deployment
Enable debug logging:
LOG_LEVEL=DEBUG# Docker
docker-compose logs -f bot
# Manual
# Check console output or log files# Check configuration
python -c "from wisp_framework.config import AppConfig; print(AppConfig())"
# Test database connection
python -c "from wisp_framework.services.db import DatabaseService; ..."
# List registered modules
# Use /modules list command in DiscordWhen reporting issues, include:
- Python version
- Framework version
- Error messages
- Relevant logs
- Steps to reproduce
- Configuration (sanitized)
- Review Configuration-Reference for configuration details
- Check Deployment-Guide for deployment issues
- See API-Reference for API details