Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/content/docs/browser-rendering/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@ If you cannot find the answer you are looking for, join us on [Discord](https://

## Errors & Troubleshooting

### Error: Cannot read properties of undefined (reading 'fetch')

This error typically occurs because your Puppeteer launch is not receiving the browser binding. To resolve this error, pass your browser binding into `puppeteer.launch`.

### Error: 429 browser time limit exceeded

This error (`Unable to create new browser: code: 429: message: Browser time limit exceeded for today`) indicates you have hit the daily browser-instance limit on the Workers Free plan. [Workers Free plan accounts are capped at 10 minutes of browser use a day](/browser-rendering/limits/#workers-free). Once you exceed that limit, further creation attempts return a 429 error until the next UTC day.

To resolve this error, [upgrade to a Workers Paid plan](/workers/platform/pricing/) which allows for more than 10 minutes of usage a day and has higher [limits](/browser-rendering/limits/#workers-paid). If you recently upgraded but still see this error, try redeploying your Worker to ensure your usage is correctly associated with your new plan.
<Render file="error-429-browser-time-limit" product="browser-rendering" />

### Error: 422 unprocessable entity

Expand Down
14 changes: 4 additions & 10 deletions src/content/docs/browser-rendering/limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ Rate limits are enforced with a fixed per-second fill rate, not as a burst allow
| Workers Free | 6 requests/min | 1 request every 10 seconds |
| Workers Paid | 180 requests/min | 3 requests/second |

If you exceed the rate limit, the API responds with HTTP status code `429 Too many requests` and includes a `Retry-After` header specifying how many seconds to wait before retrying.
If you exceed the rate limit, the API responds with HTTP status code `429 Rate limit exceeded.` and includes a `Retry-After` header specifying how many seconds to wait before retrying.

### Error: `429 Too many requests`
### Error: `429 Rate limit exceeded.`

When you make too many requests in a short period of time, Browser Rendering will respond with HTTP status code `429 Too many requests`. You can view your account's rate limits in the [Workers Free](#workers-free) and [Workers Paid](#workers-paid) sections above.
When you make too many requests in a short period of time, Browser Rendering will respond with HTTP status code `429 Rate limit exceeded.` You can view your account's rate limits in the [Workers Free](#workers-free) and [Workers Paid](#workers-paid) sections above.

The example below demonstrates how to handle rate limiting gracefully by reading the `Retry-After` value and retrying the request after that delay.

Expand Down Expand Up @@ -152,10 +152,4 @@ try {

### Error: `429 Browser time limit exceeded for today`

This `Error processing the request: Unable to create new browser: code: 429: message: Browser time limit exceeded for today` error indicates you have hit the daily browser limit on the Workers Free plan. [Workers Free plan accounts are limited](#workers-free) to 10 minutes of Browser Rendering usage per day. If you exceed that limit, you will receive a `429` error until the next UTC day.

You can [increase your limits](#workers-paid) by upgrading to a Workers Paid plan on the **Workers plans** page of the Cloudflare dashboard:

<DashButton url="/?to=/:account/workers/plans" />

If you recently upgraded but still encounter the 10-minute per day limit, redeploy your Worker to ensure your usage is correctly associated with the new plan.
<Render file="error-429-browser-time-limit" product="browser-rendering" />
76 changes: 76 additions & 0 deletions src/content/docs/browser-rendering/reference/errors.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: Errors
pcx_content_type: reference
sidebar:
order: 13
---

import { Plan } from "~/components";

<Plan type="workers-all" />

This page provides a reference for error codes you may encounter when using Browser Rendering.


## Service-level errors

Service-level errors occur when Browser Rendering cannot fulfill a request due to system availability, authentication, or resource constraints. These errors apply to both the [REST API](/browser-rendering/rest-api/) and [Workers Bindings](/browser-rendering/workers-bindings/).

| HTTP code | Internal code | Error | Description | Recommended fix |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

general table question. do we purposely have periods in each box?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kathayl Since some of the cells have multiple sentences, those need periods. And if some of them have periods, I think all of them should have periods for consistency. afaik there's no specific rule about it other than consistency.

| --- | --- | --- | --- | --- |
| `400` | - | `Bad Request` | The request is malformed or contains invalid parameters. | Refer to the [REST API documentation](/browser-rendering/rest-api/). |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the right link? this just takes to REST API overview page which i still don't know what to do next. If they need to go to specific endpoint page, maybe should add that wording in here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kathayl Adding "for the specific endpoint you are using and check the required parameters" to next commit.

| `401` | `10000` | `Authentication failed` | Authentication credentials are invalid or missing. | Verify your API token exists and has `Browser Rendering - Edit` permissions. Refer to [REST API prerequisites](/browser-rendering/rest-api/#before-you-begin). |
| `408` | - | `Request timed out` | The request exceeded the allowed time limit. | Increase timeout settings. Refer to [REST API timeouts](/browser-rendering/reference/timeouts/). |
| `413` | - | `Error: request entity too large` | The request body exceeds the maximum allowed size (50 MB for PDF endpoint). | Reduce request payload size by hosting assets externally (such as on [R2](/r2/) or [Images](/images/)) and referencing via URLs instead of embedding them inline. Refer to [PDF endpoint request size limits](/browser-rendering/rest-api/pdf-endpoint/). |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to have this point to the note specifically? If not, maybe at least the section that the note is in instead of the top of PDF page

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add link to that section in next commit - can't link to note

| `422` | - | `Unprocessable Entity` | Browser Rendering could not complete the action because of an issue with the target site. | Refer to [422 Unprocessable Entity](/browser-rendering/faq/#error-422-unprocessable-entity). |
| `429` | - | `Rate limit exceeded.` | You have exceeded the [rate limit](/browser-rendering/limits/#understanding-rate-limits) for your plan. | Refer to [429 Rate limit exceeded](/browser-rendering/limits/#error-429-rate-limit-exceeded). |
| `429` | - | `Browser time limit exceeded for today` | Daily browser time limit exceeded (Workers Free plan only: 10 minutes per day). | Refer to [429 Browser time limit exceeded](/browser-rendering/limits/#error-429-browser-time-limit-exceeded-for-today). |
| `500` | `2000` | `Internal Error` | An unexpected issue occurred on the Browser Rendering service. | Retry your request. If the issue persists, check [Cloudflare Status](https://www.cloudflarestatus.com) or [contact Cloudflare Support](/support/contacting-cloudflare-support/). |
| `503` | - | `No browser available. Please try again in a few minutes.` | Browser Rendering cannot provision a browser instance. | Retry your request after a few minutes. If the issue persists, [contact Cloudflare Support](/support/contacting-cloudflare-support/). |

## Chrome network errors

Chrome network errors occur when the browser encounters issues loading the target website. These errors come directly from Chrome and use the `net::` prefix.

| Internal code | Error | Description | Recommended fix |
| --- | --- | --- | --- |
| `5000` | `net::ERR_CERT_INVALID`, `net::ERR_CERT_COMMON_NAME_INVALID` | Certificate or SSL error. | Verify the target site has a valid SSL certificate with correct hostname. |
| `5001` | `net::ERR_ADDRESS_UNREACHABLE` | The address is unreachable. | Check if the domain exists or if the site is blocked by firewalls or network policies. |
| `5002` | `net::ERR_ABORTED` | The network connection was aborted. | Check if the site is blocked by firewalls or network policies. |
| `5002` | `net::ERR_CONNECTION_TIMED_OUT`, `net::ERR_TIMED_OUT` | The connection timed out. | Verify the target site is responding and not experiencing performance issues. |
| `5003` | `net::ERR_TOO_MANY_REDIRECTS` | The page has too many redirects. | If you control the site, fix the redirect configuration. |
| `5004` | `net::ERR_HTTP2_PROTOCOL_ERROR` | HTTP/2 protocol error. | If you control the site, check server HTTP/2 configuration. |
| `5005` | `net::ERR_NAME_NOT_RESOLVED`, `net::ERR_DNS_TIMED_OUT` | DNS resolution failed. | Verify the domain exists and DNS records are configured correctly. Check for typos in the URL. |
| `5006` | `net::ERR_CONNECTION_CLOSED`, `net::ERR_CONNECTION_RESET`, `net::ERR_TUNNEL_CONNECTION_FAILED` | The network connection was closed. Can also happen due to DNS resolution failure or bot/WAF blocking. | Verify the target site is operational and not blocking automated requests. Check if the site has WAF or bot protection rules that may be blocking Browser Rendering. Also verify DNS records if the issue persists. |
| `5007` | `net::ERR_HTTP_RESPONSE_CODE_FAILURE` | HTTP error with empty response body. | If you control the site, check server error page configuration. |
| `5008` | `net::ERR_CONNECTION_REFUSED` | The server refused the connection. | Verify the web service is running and accessible. |
| `5009` | `net::` errors | A general network error occurred when attempting to load the page. | Review the specific error message for details. Verify the target site is accessible and network connectivity is stable. |
| `5010` | `net::ERR_INVALID_URL`, `net::ERR_BLOCKED_BY_ADMINISTRATOR`, `net::ERR_FILE` | The URL is invalid or blocked. | Verify the URL format is correct. Browser Rendering does not support `file://` URLs or URLs blocked by security policies. |
| `5011` | `net::ERR_EMPTY_RESPONSE` | The server returned an empty response. | If you control the site, check server logs for crashes or configuration issues. |

## Browser automation errors

Browser automation errors occur during browser operations when using [Puppeteer](/browser-rendering/puppeteer/) or [Playwright](/browser-rendering/playwright/). These errors are related to the Chrome DevTools Protocol (CDP).

| Internal code | Error | Description | Recommended fix |
| --- | --- | --- | --- |
| `6000` | `Execution context was destroyed`, `Navigating frame was detached` | The execution context was destroyed, most likely because of a navigation or page reload. | Add [wait conditions](/browser-rendering/reference/timeouts/) or retry logic to handle navigation timing. |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add link

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kathayl I added a link but would be open to your recommendation if you think a different link is better?

| `6001` | `TargetCloseError` | The target closed due to user or site actions, or excessive memory consumption. | Check if the site calls `window.close()` or consumes excessive memory. Refer to [browser close reasons](/browser-rendering/reference/browser-close-reasons/). |
| `6002` | `TimeoutError`, `Navigation timeout`, `timed out`, `Waiting failed: .* exceeded` | A timeout was reached during a browser operation. | Increase the relevant [timeout settings](/browser-rendering/reference/timeouts/) for your operation (page load, element wait, or action timeout). |
| `6003` | `Page.captureScreenshot`, `Page.printToPDF`, `Page is too large`, `Unable to capture screenshot` | Failed to capture screenshot or generate PDF. The page may be too large or in an invalid state. | Reduce page size, simplify content, or adjust [screenshot](/browser-rendering/rest-api/screenshot-endpoint/) or [PDF](/browser-rendering/rest-api/pdf-endpoint/) parameters. |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for these two links, instead of linking to page which starts users at top of page, should we link to the advanced section which is where we start using more parameters AND has the link to REST API docs?

like https://tori-browser-rendering-error-codes.preview.developers.cloudflare.com/browser-rendering/rest-api/screenshot-endpoint/#advanced-usage

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding with next commit

| - | `Page crashed!` | The browser instance crashed, often due to memory issues or page complexity. | Reduce page complexity, limit heavy JavaScript, or simplify the page to lower memory consumption. |

## Platform errors

Platform errors occur at the [Workers platform](/workers/) level before Browser Rendering code runs.

| Error | Description | Recommended fix |
| --- | --- | --- |
| `Cannot read properties of undefined (reading 'fetch')` | The [browser binding](/browser-rendering/workers-bindings/#create-a-browser-binding) was not passed to `puppeteer.launch()` or `playwright.chromium.launch()`. | Pass your browser binding to `puppeteer.launch()` or `playwright.chromium.launch()`. |
| `No such module 'cloudflare:browser'` | Browser Rendering is not enabled on your account. | [Enable Browser Rendering](/browser-rendering/get-started/) by creating a [browser binding](/browser-rendering/workers-bindings/#create-a-browser-binding) in your Worker configuration. |

## Related resources

- [Limits](/browser-rendering/limits/)
- [Browser close reasons](/browser-rendering/reference/browser-close-reasons/)
- [Timeouts](/browser-rendering/reference/timeouts/)
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ You can set multiple timers — as long as one is complete, the request will fir
If you are not getting the expected output:
- Try increasing `goToOptions.timeout` (up to 60 s).
- If waiting for a specific element, use `waitForSelector`. Otherwise, use `goToOptions.waitUntil` set to `networkidle2` to ensure the page has finished loading dynamic content.
- If you are getting a `422`, it may be the action itself (ex: taking a screenshot, extracting the html content) that takes a long time. Try increasing the `actionTimeout` instead.
- If you receive a `422` error, refer to [422 Unprocessable Entity](/browser-rendering/faq/#error-422-unprocessable-entity).
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { DashButton } from "~/components";

If you receive a `Error processing the request: Unable to create new browser: code: 429: message: Browser time limit exceeded for today` error, it means you have hit the daily browser limit on the Workers Free plan. [Workers Free plan accounts are limited](/browser-rendering/limits/#workers-free) to 10 minutes of Browser Rendering usage per day. If you exceed that limit, you will see this `429` error until the next UTC day.

To [increase your limits](/browser-rendering/limits/#workers-paid), upgrade to a Workers Paid plan on the **Workers plans** page of the Cloudflare dashboard:

<DashButton url="/?to=/:account/workers/plans" />

If you recently upgraded but still encounter the 10-minute per day limit, redeploy your Worker to ensure your usage is correctly associated with the new plan.
Loading