Limits und Fehler
Die Limits für gehostete Sessions, die Fehler, die die API zurückgibt, und welche davon sich zu wiederholen lohnen.
Limits
- 75 gleichzeitig laufende oder startende Browser pro Account.
- Sessions dauern höchstens 4 Stunden.
- Eine Session, die 5 Minuten lang keinen CDP-Befehl erhält, wird geschlossen (einstellbar mit
idleTimeoutSec). - Jede Session startet mit einem frischen Browser-Profil, das beim Ende der Session gelöscht wird – es sei denn, Sie verwenden ein benanntes Profil, das Cookies und Site-Storage über Sessions hinweg behält.
- Aus Sicherheitsgründen kann der Browser keine lokalen Dateien öffnen (
file://), keine Dateien vom Server hochladen, keine privaten oder internen Netze erreichen und keine E-Mails über Port 25 senden. - Das Hochladen einer Datei funktioniert aus Ihrem Code — siehe Dateien hochladen. Downloads bleiben auf unserem Server und werden mit der Session gelöscht; um eine Datei zu behalten, rufen Sie sie aus der Seite heraus ab und geben Sie ihren Inhalt zurück.
- Chrome-Erweiterungen lassen sich nicht in gehostete Browser laden.
- Der Browser leitet weder Konsolenmeldungen noch Seitenfehler weiter, daher bleiben
page.on("console")undpage.on("pageerror")stumm. Sammeln Sie, was Sie brauchen, in der Seite und lesen Sie es mitevaluateaus. Zwei Treiberaufrufe hängen von diesen Events ab: siehe setContent und exposeFunction.
Fehler
| Status | code | Bedeutung |
|---|---|---|
| 400 | — | The body is not JSON, or an option is invalid; the message says which. |
| 400 | UNKNOWN_VERSION | No release matches version; the message lists the ones you can pick. |
| 400 | TOO_LARGE | The whole run configuration as stored (task, schema, sealed secrets and the browser options) is capped at 60 KB; shorten them. |
| 400 | INVALID | A webhook or cookie import body is invalid; the message says which field (and which cookie). |
| 400 | TOO_MANY | A cookie import would leave the profile with more than 5000 cookies. Use mode "replace", or import fewer. |
| 400 | CHALLENGE_KEY_MISSING | challengeService has no key to use: pass challengeService.apiKey, store your key in the dashboard (Settings), or use key "managed". |
| 401 | — | Missing, malformed or revoked API key. |
| 401 | INVALID_LINK | A share, hand-off or replay link that is invalid, of the wrong kind, or expired. |
| 403 | NOT_CONTROL | Only a link that lets you take control can mark a hand-off done; this one is watch-only. |
| 402 | INSUFFICIENT_BALANCE | Balance below the minimum. Top up in the dashboard. |
| 402 | CHALLENGE_LIMIT | This month's challenge-service limit on our key is reached. Raise it in the dashboard (Settings), or use your own key. |
| 404 | NOT_FOUND | No session, run, profile, webhook or recording with that id on your account. |
| 409 | NOT_RUNNING | Live view, a reconnect or a hand-off asked for before the browser started or after it ended. |
| 409 | NOT_KEEPALIVE | This session cannot be reconnected. Start it with keepAlive: true. |
| 409 | PROFILE_IN_USE | Another session is already saving to that profile. Stop it, or open the profile with persist: false. |
| 409 | NOT_READY | The recording is still being uploaded. Try again shortly after the session ends. |
| 409 | HANDOFF_UNSUPPORTED | The server running this browser does not support hand-off yet. |
| 409 | NO_HANDOFF | Marked done, but no hand-off was asked for. |
| 409 | HANDOFF_EXPIRED | The hand-off timed out before it was marked done. |
| 409 | WEBHOOK_LIMIT | At most 5 webhooks per account. Delete one first. |
| 410 | ENDED | A live link whose session has ended. |
| 410 | GONE | A replay link whose recording is no longer available (failed, or past its retention). |
| 413 | TOO_LARGE | A cookie import would make the profile larger than 3.5 MB. |
| 429 | CONCURRENCY_LIMIT | Too many browsers running or starting at once. Close one first. |
| 429 | — | More than 60 create calls in a minute from one address. Slow down. |
| 429 | — | More than 60 cookie imports in 10 minutes on one account (or 30 new webhooks in 10 minutes, 10 webhook tests or 60 hand-off requests a minute). Wait and retry. |
| 503 | NO_CAPACITY | No free browser slot right now, or no server that can run what you asked for (runs, schema, secrets, recording, the challenge service). Retry after a few seconds. |
| 503 | NO_WORKER | The server running that session is not reachable at the moment. |
| 503 | NOT_CONFIGURED | Hosted browsers (or that part of them) are not configured on this server. |
| 503 | NOT_AVAILABLE | Notes, profiles, runs, recordings, events, hand-off, webhooks or the challenge service are not enabled on this server yet. |
Fehler kommen als JSON: { "error": "...", "code": "..." }. Wird die WebSocket-Verbindung selbst abgelehnt, legen Sie eine neue Session an: Connect-URLs gelten nur einmal und laufen nach zwei Minuten ab. Ein abgelehntes WebSocket-Upgrade antwortet mit einem HTTP-Status und einem JSON-error: 409, wenn die URL bereits verwendet wurde, die Session abgebrochen wurde, nicht mit keepAlive gestartet wurde oder bereits verbunden ist; 401, wenn die URL abgelaufen ist.
Was Sie wiederholen sollten
- Mit Backoff wiederholen:
503 NO_CAPACITYund503 NO_WORKER(1, 2, 4 … Sekunden mit etwas Jitter warten und nach einer Handvoll Versuchen aufgeben) sowie ein429ohne Code (das Rate-Limit pro Adresse). - Einige Male mit Backoff wiederholen: andere
5xx-Antworten sowie ein Connect, der abgelehnt wurde, bevor Ihr Skript gestartet ist (mit einer neuen Session: Die alte Connect-URL ist verbraucht). - Nie in einer Schleife wiederholen:
400(Request korrigieren),401,402(Guthaben aufladen),429 CONCURRENCY_LIMIT(erst einen Browser schließen) und409 PROFILE_IN_USE. Hier muss ein Mensch handeln; Wiederholungen verbrennen nur Requests.