-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
Complete troubleshooting guide for StreamTV on macOS, Windows, and Linux.
Run these diagnostic scripts directly from this page to check your installation:
- Run Script: check_python - Check Python installation and version
- Run Script: check_ffmpeg - Check FFmpeg installation and version
- Run Script: check_database - Check database connectivity and integrity
- Run Script: check_ports - Check if required ports are available
- Run Script: test_connectivity - Test network connectivity to media sources (with auto-fix for DNS issues)
- Run Script: repair_database - Attempt to repair corrupted database
- Run Script: clear_cache - Clear application cache
How to use: Click on any script link above. You'll be prompted to confirm before the script runs. The results will appear below.
StreamTV includes powerful web-based troubleshooting tools accessible from the web interface:
- Access Streaming Logs: Click "Streaming Logs" in the sidebar under Resources
- Real-Time Monitoring: View logs as they happen with automatic updates
- Error Detection: Errors and warnings are automatically highlighted and clickable
-
Click for Details: Click any error/warning to see:
- Full error context (20 lines before/after)
- Matched troubleshooting scripts
- "Self-Heal" button to automatically run fixes
- Auto-Fix Prompts: When scripts detect fixable issues (e.g., missing yt-dlp, DNS issues), you'll be prompted to apply fixes automatically
All documentation is available directly in the web interface:
- Click "Documentation" in the sidebar dropdown
- Browse guides: Quick Start, Beginner, Installation, Path Independence, GUI Installer, SwiftUI Installer
- Click script buttons in documentation to run diagnostics
- Access troubleshooting guides from the "Troubleshooting" dropdown
Install Ollama for AI-powered troubleshooting:
- Click "AI Troubleshooting" in the sidebar under Resources
- Install Ollama (~5 GB base installation)
- Select and install AI models based on your hardware
- The AI can analyze errors and suggest fixes based on your system's configuration
Features:
- Analyzes log errors and provides explanations
- Suggests fixes based on your system configuration
- Learns from patterns in your logs
- Completely private - no data leaves your machine
Symptoms: python3: command not found or Python version too old
Solutions:
-
macOS:
- Download from python.org
- Or use Homebrew:
brew install python3 - Run diagnostic: Run Script: check_python
-
Windows:
- Download from python.org
- Check "Add Python to PATH" during installation
- Restart terminal/PowerShell after installation
-
Linux:
- Ubuntu/Debian:
sudo apt-get install python3 python3-pip - Fedora:
sudo dnf install python3 python3-pip - Arch:
sudo pacman -S python python-pip
- Ubuntu/Debian:
Symptoms: ffmpeg: command not found or FFmpeg errors in logs
Solutions:
-
macOS:
- Apple Silicon: Download from evermeet.cx
- Or use Homebrew:
brew install ffmpeg - Run diagnostic: Run Script: check_ffmpeg
-
Windows:
- Download from ffmpeg.org
- Extract and add to PATH
- Or use Chocolatey:
choco install ffmpeg
-
Linux:
- Ubuntu/Debian:
sudo apt-get install ffmpeg - Fedora:
sudo dnf install ffmpeg - Arch:
sudo pacman -S ffmpeg
- Ubuntu/Debian:
Symptoms: Address already in use or server won't start
Solutions:
- Run diagnostic: Run Script: check_ports
- Change port in
config.yaml:server: port: 8500
-
macOS: Stop existing service:
launchctl unload ~/Library/LaunchAgents/com.retro-tv-simulator.plist -
Linux: Find and kill process:
sudo lsof -i :8410 sudo kill -9 <PID>
-
Windows: Find and kill process:
netstat -ano | findstr :8410 taskkill /PID <PID> /F
Symptoms: Import errors, missing packages, or activation failures
Solutions:
-
Remove and recreate virtual environment:
rm -rf ~/.streamtv/venv python3 -m venv ~/.streamtv/venv
-
Activate and reinstall dependencies:
source ~/.streamtv/venv/bin/activate # Linux/macOS # OR ~/.streamtv/venv/Scripts/activate # Windows pip install --upgrade pip setuptools wheel pip install -r requirements.txt
-
Check Python path:
which python3 # Should point to venv Python
Symptoms: [Errno 8] nodename nor servname provided, or not known or Unable to resolve hostname
Solutions:
- Run diagnostic: Run Script: test_connectivity
-
macOS: Flush DNS cache:
sudo dscacheutil -flushcache sudo killall -HUP mDNSResponder
-
Linux: Flush DNS cache:
sudo systemd-resolve --flush-caches # systemd # OR sudo service network-manager restart # NetworkManager
-
Windows: Flush DNS cache:
ipconfig /flushdns - Check DNS servers in network settings
- Try using Google DNS (8.8.8.8, 8.8.4.4)
Symptoms: yt-dlp not installed, Unable to download API page, or YouTube videos won't play
Solutions:
- Run diagnostic: Run Script: test_connectivity
- Install/update yt-dlp:
pip install yt-dlp # OR update pip install --upgrade yt-dlp - Check YouTube accessibility in browser
- Verify network connectivity to YouTube
- Check firewall settings
Symptoms: Archive.org videos won't load or timeout errors
Solutions:
- Run diagnostic: Run Script: test_connectivity
- Check Archive.org accessibility in browser
- Verify network connectivity
- Check if authentication is required (configure in settings)
Symptoms: Database connection failed, SQLite error, or database locked
Solutions:
- Run diagnostic: Run Script: check_database
- Check database file permissions:
ls -la streamtv.db chmod 644 streamtv.db # If needed - Check if database is locked:
# macOS/Linux lsof streamtv.db - Repair database: Run Script: repair_database
- Backup and recreate if corrupted:
cp streamtv.db streamtv.db.backup rm streamtv.db python3 -c "from streamtv.database.session import init_db; init_db()"
Symptoms: database disk image is malformed or inconsistent data
Solutions:
- Backup current database
- Run repair: Run Script: repair_database
- If repair fails, restore from backup or recreate database
- Re-import channels and media
Symptoms: Channel exists but shows "No stream available" or timeout
Solutions:
- Check channel is enabled in web interface
- Verify channel has content (media items)
- Check channel schedule is configured
- View streaming logs for errors
- Test stream URL directly:
curl http://localhost:8410/api/channels/{channel_id}/stream
Symptoms: Video plays but buffers frequently or stutters
Solutions:
- Check network bandwidth
- Reduce stream quality in config:
youtube: quality: "medium" # Instead of "best"
- Check FFmpeg performance
- Monitor system resources (CPU, RAM, disk I/O)
- Check for network latency issues
Symptoms: FFmpeg crashes, format errors, or codec issues
Solutions:
- Update FFmpeg to latest version
- Check FFmpeg supports required codecs:
ffmpeg -codecs | grep h264 - Check FFmpeg logs in streaming logs
- Verify source video format is supported
- Try different FFmpeg options in config
Symptoms: YAML syntax error, Invalid configuration, or config not loading
Solutions:
- Validate YAML syntax:
python3 -c "import yaml; yaml.safe_load(open('config.yaml'))" - Check indentation (YAML is sensitive to spaces)
- Verify all required fields are present
- Compare with
config.example.yaml - Reset to defaults if needed
Symptoms: Changes in web interface don't persist
Solutions:
- Check file permissions on
config.yaml - Verify write access to config directory
- Check for syntax errors preventing save
- Restart server after changes
- Check logs for save errors
Symptoms: Server fails to start or crashes immediately
Solutions:
- Check logs:
tail -f streamtv.log - Verify Python and dependencies are installed
- Check port availability: Run Script: check_ports
- Verify database is accessible: Run Script: check_database
- Check configuration file syntax
- Try running directly:
python3 -m streamtv.main
Symptoms: Service starts but stops immediately
Solutions:
-
macOS: Check LaunchAgent logs:
log show --predicate 'process == "streamtv"' --last 1h -
Linux: Check systemd logs:
journalctl -u streamtv -n 50
-
Windows: Check Event Viewer for errors
-
Verify service configuration file syntax
-
Check for permission issues
-
Verify working directory is correct
Symptoms: Server uses excessive CPU resources
Solutions:
- Reduce number of concurrent streams
- Lower stream quality settings
- Check for infinite loops in logs
- Monitor FFmpeg processes
- Consider hardware limitations
Symptoms: Server uses excessive RAM
Solutions:
- Reduce buffer sizes in config:
streaming: buffer_size: 4096 # Reduce from default
- Limit concurrent connections
- Check for memory leaks in logs
- Restart server periodically
- Monitor with system tools
Symptoms: Web interface is slow or API calls timeout
Solutions:
- Check database performance
- Optimize database queries
- Check network latency
- Monitor system resources
- Consider database indexing improvements
- Check Logs: Always check streaming logs first
- Run Diagnostics: Use the diagnostic scripts above
- Check Documentation: Review installation and configuration guides
- Search Issues: Check if others have encountered the same problem
When asking for help, include:
- Error Messages: Exact error text from logs
- System Information: OS, Python version, FFmpeg version
-
Configuration: Relevant parts of
config.yaml(remove sensitive data) - Steps to Reproduce: What you did before the error occurred
- Diagnostic Results: Output from diagnostic scripts
- Web Interface: Use the built-in troubleshooting tools
- Streaming Logs: Check real-time logs with error detection
- Self-Healing: Use automatic fix suggestions
- AI Troubleshooting: Install Ollama for AI-powered help
- Documentation: Browse guides in the web interface
- GitHub Issues: Report bugs and request features
Enable debug logging for more detailed information:
logging:
level: "DEBUG"
file: "streamtv.log"Test individual components:
-
Test Database:
python3 -c "from streamtv.database.session import SessionLocal; db = SessionLocal(); print('OK')" -
Test API:
curl http://localhost:8410/health curl http://localhost:8410/api/channels
-
Test Streaming:
curl http://localhost:8410/api/channels/{channel_id}/stream
Analyze logs for patterns:
# Find errors
grep -i error streamtv.log
# Find warnings
grep -i warning streamtv.log
# Monitor in real-time
tail -f streamtv.log | grep -i error- Regular Backups: Backup database and configuration regularly
- Monitor Logs: Check logs periodically for warnings
- Keep Updated: Update dependencies and StreamTV regularly
- Test Changes: Test configuration changes before deploying
- Document Changes: Keep notes of configuration changes
- Clear Cache: Run Script: clear_cache periodically
- Check Database: Run Script: check_database regularly
- Monitor Resources: Watch CPU, RAM, and disk usage
- Review Logs: Check for recurring errors or warnings
- Update Dependencies: Keep Python packages updated
For platform-specific troubleshooting, see the installation guides in the Documentation section.