-
Notifications
You must be signed in to change notification settings - Fork 8
Troubleshooting
Common issues and solutions.
Symptom: Can't start a new session.
Solution:
bdg cleanup --force
# Or if that doesn't work:
bdg cleanup --aggressiveSymptom: Commands fail with exit code 83 (Resource Not Found).
Solution:
# Start a session first
bdg example.com
# Then run commands
bdg dom query "button"Symptom: bdg thinks a session is running but Chrome is closed.
Solution:
bdg cleanup --force
# Check status
bdg statusSymptom: Exit code 100.
Causes & Solutions:
-
Chrome not installed:
# macOS brew install --cask google-chrome # Linux sudo apt install google-chrome-stable
-
Port in use:
# Use different port bdg example.com --port 9223 -
Permission denied:
# Check Chrome binary ls -la /Applications/Google\ Chrome.app/
Symptom: Multiple Chrome processes after stopping bdg.
Solution:
bdg cleanup --aggressive
# Or manually:
pkill -f "chrome.*remote-debugging"Symptom: Headless Chrome behaves differently.
Tips:
- Some sites detect headless mode
- Use
--user-data-dirfor persistent profile - Check
bdg status --verbosefor Chrome flags
Symptom: Exit code 101.
Causes:
- Chrome closed unexpectedly
- WebSocket disconnected
- Network issues
Solution:
bdg status --verbose
# If Chrome is dead:
bdg cleanup --force
bdg example.comSymptom: Exit code 102.
Solutions:
-
Page is slow - wait longer:
bdg example.com --timeout 60
-
Skip page readiness:
bdg example.com --no-wait
Symptom: Exit code 83.
Debugging:
# Check what's on the page
bdg dom query "*" --json | jq '.count'
# Try broader selector
bdg dom query "button"
bdg dom query "[type=submit]"
# Check if page loaded
bdg dom eval "document.readyState"Symptom: "Index out of range" after query.
Cause: Page changed since last query.
Solution:
# Re-run query to refresh cache
bdg dom query "button"
# Then use new indices
bdg dom get 0Not an error! This means Chrome's accessibility tree didn't have data for the element, so bdg inferred the role from HTML. The output is still valid and usable.
Symptom: bdg peek --network shows empty.
Causes:
- Session just started - make some requests
- Page loaded before session started
Solution:
# Navigate to trigger requests
bdg cdp Page.reload
bdg peek --networkSymptom: Response bodies are null.
Causes:
- Binary content (images, etc.)
- Large responses (> 5MB default)
- Streaming responses
Solution:
# Increase body size limit
bdg example.com --max-body-size 10Cause: Unix sockets don't work on native Windows.
Solution: Use WSL:
wsl
bdg example.comSymptom: Can't access Chrome or write files.
Solutions:
- Grant Terminal full disk access in System Preferences
- Check ~/.bdg/ directory permissions:
ls -la ~/.bdg/ chmod 755 ~/.bdg/
| Code | Meaning | Action |
|---|---|---|
| 0 | Success | Continue |
| 1 | Generic error | Check stderr |
| 80 | Invalid URL | Fix URL format |
| 81 | Invalid arguments | Check command syntax |
| 82 | Permission denied | Check file/directory permissions |
| 83 | Resource not found | Check selector/resource exists |
| 84 | Resource already exists | Remove duplicate or use different name |
| 85 | Resource busy | Resource is locked, wait or cleanup |
| 86 | Daemon already running | Run bdg cleanup --force
|
| 100 | Chrome launch failed | Check Chrome installation |
| 101 | CDP connection failed | Check Chrome is running |
| 102 | CDP timeout | Increase timeout or use --no-wait
|
| 103 | Session file error | Check ~/.bdg/ permissions |
| 104 | Unhandled exception | Report bug with details |
| 105 | Signal handler error | Restart session |
| 110 | Software error | Check logs, report bug |
Symptom: CDP commands fail with unexpected errors.
Solution:
# Check Chrome version
google-chrome --version # Linux
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version # macOS
# Update to latest stable Chrome
brew upgrade --cask google-chrome # macOSSymptom: Can't connect to HTTPS sites with self-signed certificates.
Solution:
# Add Chrome flag to ignore cert errors (use with caution)
bdg https://localhost:3000 --chrome-ws-url "ws://localhost:9222/..."
# Or use Chrome's --ignore-certificate-errors flag manuallySymptom: Chrome becomes slow or crashes during long sessions.
Solutions:
- Increase Chrome memory limits (advanced)
- Restart session periodically:
bdg stop bdg cleanup --force bdg example.com
- Use
--compactto reduce memory usage:bdg example.com --compact
Symptom: Local file:// URLs or CORS errors.
Workaround:
# For local files, use a local server instead
python3 -m http.server 8000
bdg localhost:8000
# CORS errors are browser-enforced, bdg can't bypass them
# Use a development proxy or CORS-enabled server- Check
bdg --helpfor command syntax - Use
bdg status --verbosefor diagnostics - Search existing issues
- Open a new issue with:
- bdg version (
bdg --version) - Node.js version (
node --version) - OS and version
- Full error output
- Steps to reproduce
- bdg version (