Skip to content

Troubleshooting

Common issues and their solutions when using Pocat.

Symptoms:

  • API returns error status
  • Download never completes
  • File not created

Solutions:

  1. Check URL validity:

    Terminal window
    curl -X POST /v2/projects \
    -d '{"youtubeUrl": "VALID_YOUTUBE_URL"}'
  2. Try different downloader:

    {
    "youtubeUrl": "URL",
    "downloader": "yt-dlp"
    }
  3. Check logs:

    Terminal window
    tail -f storage/logs/app.log

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"
}

Symptoms:

  • Requested quality returns lower resolution
  • Error about format not found

Solution:

Terminal window
# Check available formats first
yt-dlp -F "YOUTUBE_URL"
# Use auto quality selection
curl -X POST /v2/projects \
-d '{"youtubeUrl": "URL", "quality": "auto"}'

Symptoms:

Error: connect ECONNREFUSED 127.0.0.1:3333

Solutions:

  1. Check if server is running:

    Terminal window
    ps aux | grep node
    netstat -tlnp | grep 3333
  2. Start the server:

    Terminal window
    cd pocat
    npm start
  3. Check port availability:

    Terminal window
    lsof -i :3333

Symptoms:

Access to fetch blocked by CORS policy

Solution: 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)
});

Symptoms:

HTTP 429 Too Many Requests

Solutions:

  • Reduce request frequency
  • Implement exponential backoff
  • Contact admin for rate limit increase

Causes & Solutions:

  1. Network bandwidth:

    • Check internet connection
    • Use lower quality settings
  2. Server resources:

    Terminal window
    # Check CPU/Memory usage
    top
    htop
    # Check disk space
    df -h
  3. Concurrent downloads:

    • Limit simultaneous downloads
    • Queue downloads instead

Solutions:

  1. Restart the service:

    Terminal window
    pm2 restart pocat
  2. Increase memory limit:

    Terminal window
    node --max-old-space-size=4096 server.js
  3. Clean up old files:

    Terminal window
    find downloads/ -mtime +7 -delete

Error:

npm ERR! peer dep missing

Solutions:

Terminal window
# Clear npm cache
npm cache clean --force
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
# Use specific Node.js version
nvm use 18
npm install

Error:

yt-dlp: command not found

Solutions:

  1. Install yt-dlp:

    Terminal window
    # Using pip
    pip install yt-dlp
    # Using package manager
    sudo apt install yt-dlp # Ubuntu/Debian
    brew install yt-dlp # macOS
  2. Check PATH:

    Terminal window
    which yt-dlp
    echo $PATH

Error:

SQLITE_BUSY: database is locked

Solutions:

Terminal window
# Check for zombie processes
ps aux | grep node
# Kill hanging processes
pkill -f node
# Restart the application
npm start

Solutions:

Terminal window
# Reset database (development only)
rm -f database/database.sqlite
npm run migration:run
# Or run migrations manually
npm run migration:fresh

Error:

EACCES: permission denied, open '/path/to/file'

Solutions:

Terminal window
# Fix permissions
chmod 755 storage/
chmod 755 downloads/
chown -R $USER:$USER storage/ downloads/
# Or run with sudo (not recommended for production)
sudo npm start

Error:

ENOSPC: no space left on device

Solutions:

Terminal window
# Check disk usage
df -h
# Clean up old downloads
find downloads/ -mtime +7 -delete
# Clean up logs
truncate -s 0 storage/logs/*.log
Terminal window
DEBUG=* npm start
Terminal window
# System info
uname -a
node --version
npm --version
yt-dlp --version
# Process info
ps aux | grep node
netstat -tlnp | grep 3333
Terminal window
# View recent errors
tail -100 storage/logs/app.log | grep ERROR
# Monitor real-time logs
tail -f storage/logs/app.log

If issues persist, please create an issue on GitHub with:

  • Error messages
  • System information
  • Steps to reproduce
  • Log files (remove sensitive data)