Cloud Browser API Errors
The Cloud Browser API returns standard HTTP status codes and detailed error information to help you troubleshoot issues. This page lists error codes specific to browser session operations.
Note: The Cloud Browser API uses WebSocket connections. Most errors occur during the initial connection handshake or browser allocation phase.
Browser-Specific Errors
The Cloud Browser API has specific error codes that are unique to browser session operations:
Error Handling Best Practices
Understanding how to handle browser errors is crucial for building robust automation scripts. Different error types require different handling strategies.
Retryable Errors - Automatic Recovery
Some browser errors are transient and can be safely retried. These typically indicate temporary resource unavailability or network issues.
Automatic Retry: For retryable errors, implement exponential backoff (e.g., wait 1s, 2s, 4s) before retrying. Most transient issues resolve within seconds.
Retryable error codes:
-
ERR::BROWSER::ALLOCATION_FAILED- Browser pool temporarily saturated -
ERR::BROWSER::CDP_CONNECTION_FAILED- Failed to establish CDP connection -
ERR::BROWSER::WEBSOCKET_UPGRADE_FAILED- WebSocket upgrade failed -
ERR::BROWSER::TOO_MANY_CONCURRENT_REQUEST- Concurrent session limit reached -
ERR::BROWSER::PROXY_UNAVAILABLE- Proxy temporarily unavailable
Recommended retry strategy:
Non-Retryable Errors - Immediate Action Required
These errors indicate configuration issues, quota limits, or session timeouts that cannot be automatically resolved. You must take action before retrying.
Requires Intervention: Non-retryable errors need manual action - fix configuration, upgrade plan, or wait for quota reset.
Non-retryable error codes:
-
ERR::BROWSER::CONFIG_ERROR- Invalid browser configuration parameters -
ERR::BROWSER::QUOTA_LIMIT_REACHED- Monthly browser quota exhausted -
ERR::BROWSER::SESSION_TIMEOUT- Browser session exceeded maximum duration
How to handle non-retryable errors:
- Config errors: Review the error message and fix invalid parameters
- Quota reached: Upgrade your plan or wait until quota resets (monthly)
- Session timeout: Design scripts to complete within session time limits
- Concurrency limit: Wait for existing sessions to close before starting new ones
Connection Lifecycle & Errors
Understanding when errors occur in the browser connection lifecycle helps with debugging and implementing proper error handling.
Connection Phases
-
WebSocket Handshake
Initial HTTP upgrade to WebSocket connection.
Possible errors:
ERR::BROWSER::WEBSOCKET_UPGRADE_FAILED- Network issues, invalid headers
-
Browser Allocation
Request browser instance from the pool.
Possible errors:
ERR::BROWSER::ALLOCATION_FAILED- Pool saturated, no available instancesERR::BROWSER::TOO_MANY_CONCURRENT_REQUEST- Plan concurrency limit reachedERR::BROWSER::QUOTA_LIMIT_REACHED- Monthly quota exhaustedERR::BROWSER::PROXY_UNAVAILABLE- Requested proxy unavailable
-
CDP Connection
Establish Chrome DevTools Protocol connection to browser.
Possible errors:
ERR::BROWSER::CDP_CONNECTION_FAILED- Browser crashed, network timeoutERR::BROWSER::CONFIG_ERROR- Invalid CDP configuration
-
Active Session
Browser session is active and ready for automation commands.
Possible errors:
ERR::BROWSER::SESSION_TIMEOUT- Session exceeded maximum duration
Monitoring Browser Sessions
Track your browser usage to avoid hitting limits and optimize your automation workflows.
Monitoring recommendations:
- Active sessions: Check
GET /accountendpoint for current concurrent session count - Monthly quota: Monitor remaining browser hours via dashboard or API
- Session duration: Log session start/end times to optimize scripts
- Error rates: Track error codes to identify patterns (e.g., frequent allocation failures)
Troubleshooting Common Issues
Cause: Browser pool is temporarily saturated (high demand).
Solutions:
- Implement exponential backoff retry logic (wait 1s, 2s, 4s, 8s)
- Reduce concurrent session usage during peak hours
- Upgrade to a plan with dedicated browser instances
- Contact support if issue persists for extended periods
Cause: You've reached your plan's concurrent browser session limit.
Solutions:
- Close unused browser sessions before starting new ones
- Implement session pooling to reuse browsers across tasks
- Queue automation tasks to run sequentially instead of in parallel
- Upgrade to a plan with higher concurrency limits
Cause: Network issues or firewall blocking WebSocket connections.
Solutions:
- Verify your network allows WebSocket connections (not just HTTP/HTTPS)
- Check firewall rules for port 443 (wss://) or port 80 (ws://)
- Ensure no proxy/middleware is stripping WebSocket upgrade headers
- Test with a simple WebSocket client to isolate the issue
Cause: Browser session exceeded maximum allowed duration.
Solutions:
- Optimize scripts to complete tasks faster (e.g., reduce wait times)
- Split long-running tasks into multiple shorter sessions
- Use caching to avoid re-scraping already processed data
- Consider using the Crawler API for large-scale, long-running jobs
Note: Session timeout errors are billed as the session was active until timeout.
HTTP Status Codes
| Status Code | Description |
|---|---|
101 Switching Protocols |
WebSocket connection successfully upgraded |
400 Bad Request |
Invalid parameters or configuration (ERR::BROWSER::CONFIG_ERROR) |
401 Unauthorized |
Invalid or missing API key |
408 Request Timeout |
Browser session timeout (ERR::BROWSER::SESSION_TIMEOUT) |
422 Unprocessable Entity |
Proxy unavailable (ERR::BROWSER::PROXY_UNAVAILABLE) |
429 Too Many Requests |
Quota or concurrency limit exceeded |
502 Bad Gateway |
CDP connection failed (ERR::BROWSER::CDP_CONNECTION_FAILED) |
503 Service Unavailable |
Browser allocation failed (ERR::BROWSER::ALLOCATION_FAILED) |
Error Response Format
Browser API errors are returned via WebSocket messages in a consistent format:
Error message fields:
type- Always "error" for error messageserror.code- Machine-readable error code (e.g., ERR::BROWSER::ALLOCATION_FAILED)error.message- Human-readable error descriptionerror.retryable- Whether the operation can be retriederror.http_code- HTTP status code equivalenterror.details- Additional context-specific details (optional)