Troubleshooting
Troubleshooting
Section titled âTroubleshootingâCommon issues and their solutions when using Pocat.
Download Issues
Section titled âDownload IssuesâVideo Download Fails
Section titled âVideo Download FailsâSymptoms:
- API returns error status
- Download never completes
- File not created
Solutions:
-
Check URL validity:
Terminal window curl -X POST /v2/projects \-d '{"youtubeUrl": "VALID_YOUTUBE_URL"}' -
Try different downloader:
{"youtubeUrl": "URL","downloader": "yt-dlp"} -
Check logs:
Terminal window tail -f storage/logs/app.log
403 Forbidden Errors
Section titled â403 Forbidden ErrorsâCause: YouTube blocking requests
Solutions:
- Use yt-dlp downloader (more reliable)
- Add delays between requests
- Rotate IP addresses if possible
{ "youtubeUrl": "URL", "downloader": "yt-dlp"}Quality Not Available
Section titled âQuality Not AvailableâSymptoms:
- Requested quality returns lower resolution
- Error about format not found
Solution:
# Check available formats firstyt-dlp -F "YOUTUBE_URL"
# Use auto quality selectioncurl -X POST /v2/projects \ -d '{"youtubeUrl": "URL", "quality": "auto"}'API Issues
Section titled âAPI IssuesâConnection Refused
Section titled âConnection RefusedâSymptoms:
Error: connect ECONNREFUSED 127.0.0.1:3333Solutions:
-
Check if server is running:
Terminal window ps aux | grep nodenetstat -tlnp | grep 3333 -
Start the server:
Terminal window cd pocatnpm start -
Check port availability:
Terminal window lsof -i :3333
CORS Errors
Section titled âCORS ErrorsâSymptoms:
Access to fetch blocked by CORS policySolution: Add CORS headers in your frontend:
fetch('http://localhost:3333/v2/projects', { method: 'POST', headers: { 'Content-Type': 'application/json', 'ngrok-skip-browser-warning': 'true' // if using ngrok }, body: JSON.stringify(data)});Rate Limiting
Section titled âRate LimitingâSymptoms:
HTTP 429 Too Many RequestsSolutions:
- Reduce request frequency
- Implement exponential backoff
- Contact admin for rate limit increase
Performance Issues
Section titled âPerformance IssuesâSlow Downloads
Section titled âSlow DownloadsâCauses & Solutions:
-
Network bandwidth:
- Check internet connection
- Use lower quality settings
-
Server resources:
Terminal window # Check CPU/Memory usagetophtop# Check disk spacedf -h -
Concurrent downloads:
- Limit simultaneous downloads
- Queue downloads instead
High Memory Usage
Section titled âHigh Memory UsageâSolutions:
-
Restart the service:
Terminal window pm2 restart pocat -
Increase memory limit:
Terminal window node --max-old-space-size=4096 server.js -
Clean up old files:
Terminal window find downloads/ -mtime +7 -delete
Installation Issues
Section titled âInstallation IssuesâDependencies Not Installing
Section titled âDependencies Not InstallingâError:
npm ERR! peer dep missingSolutions:
# Clear npm cachenpm cache clean --force
# Delete node_modules and reinstallrm -rf node_modules package-lock.jsonnpm install
# Use specific Node.js versionnvm use 18npm installPython/yt-dlp Issues
Section titled âPython/yt-dlp IssuesâError:
yt-dlp: command not foundSolutions:
-
Install yt-dlp:
Terminal window # Using pippip install yt-dlp# Using package managersudo apt install yt-dlp # Ubuntu/Debianbrew install yt-dlp # macOS -
Check PATH:
Terminal window which yt-dlpecho $PATH
Database Issues
Section titled âDatabase IssuesâSQLite Locked
Section titled âSQLite LockedâError:
SQLITE_BUSY: database is lockedSolutions:
# Check for zombie processesps aux | grep node
# Kill hanging processespkill -f node
# Restart the applicationnpm startMigration Errors
Section titled âMigration ErrorsâSolutions:
# Reset database (development only)rm -f database/database.sqlitenpm run migration:run
# Or run migrations manuallynpm run migration:freshFile System Issues
Section titled âFile System IssuesâPermission Denied
Section titled âPermission DeniedâError:
EACCES: permission denied, open '/path/to/file'Solutions:
# Fix permissionschmod 755 storage/chmod 755 downloads/chown -R $USER:$USER storage/ downloads/
# Or run with sudo (not recommended for production)sudo npm startDisk Space Full
Section titled âDisk Space FullâError:
ENOSPC: no space left on deviceSolutions:
# Check disk usagedf -h
# Clean up old downloadsfind downloads/ -mtime +7 -delete
# Clean up logstruncate -s 0 storage/logs/*.logGetting Help
Section titled âGetting HelpâEnable Debug Mode
Section titled âEnable Debug ModeâDEBUG=* npm startCollect System Information
Section titled âCollect System Informationâ# System infouname -anode --versionnpm --versionyt-dlp --version
# Process infops aux | grep nodenetstat -tlnp | grep 3333Log Analysis
Section titled âLog Analysisâ# View recent errorstail -100 storage/logs/app.log | grep ERROR
# Monitor real-time logstail -f storage/logs/app.logIf issues persist, please create an issue on GitHub with:
- Error messages
- System information
- Steps to reproduce
- Log files (remove sensitive data)