Chuyển đến nội dung

Giới hạn và lỗi

Các giới hạn của phiên hosted, những lỗi mà API trả về, và lỗi nào đáng thử lại.

Giới hạn

  • 75 trình duyệt đang chạy hoặc đang khởi động cùng lúc trên mỗi tài khoản.
  • Mỗi phiên kéo dài tối đa 4 giờ.
  • Phiên không nhận lệnh CDP nào trong 5 phút sẽ bị đóng (thay đổi bằng idleTimeoutSec).
  • Mỗi phiên bắt đầu với một profile trình duyệt mới, bị xóa khi phiên kết thúc, trừ khi bạn dùng một profile có tên, loại profile giữ cookie và dữ liệu lưu trữ của site giữa các phiên.
  • Vì lý do an toàn, trình duyệt không thể mở file local (file://), upload file từ máy chủ, truy cập mạng riêng hoặc mạng nội bộ, hay gửi email qua cổng 25.
  • Upload file hoạt động từ code của bạn — xem Upload file. Download thì nằm lại trên máy chủ của chúng tôi và bị xóa cùng với phiên; để giữ lại một file, hãy lấy nó từ bên trong trang và trả về nội dung của file đó.
  • Không thể nạp Chrome extension vào trình duyệt hosted.
  • Trình duyệt không chuyển tiếp console message hay lỗi trang, nên page.on("console") và page.on("pageerror") sẽ im lặng. Hãy thu thập những gì bạn cần bên trong trang rồi đọc lại bằng evaluate. Có hai lệnh gọi của driver phụ thuộc vào các sự kiện này: xem setContent và exposeFunction.

Lỗi

Trạng tháicodeÝ nghĩa
400—The body is not JSON, or an option is invalid; the message says which.
400UNKNOWN_VERSIONNo release matches version; the message lists the ones you can pick.
400TOO_LARGEThe whole run configuration as stored (task, schema, sealed secrets and the browser options) is capped at 60 KB; shorten them.
400INVALIDA webhook or cookie import body is invalid; the message says which field (and which cookie).
400TOO_MANYA cookie import would leave the profile with more than 5000 cookies. Use mode "replace", or import fewer.
400CHALLENGE_KEY_MISSINGchallengeService 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.
401INVALID_LINKA share, hand-off or replay link that is invalid, of the wrong kind, or expired.
403NOT_CONTROLOnly a link that lets you take control can mark a hand-off done; this one is watch-only.
402INSUFFICIENT_BALANCEBalance below the minimum. Top up in the dashboard.
402CHALLENGE_LIMITThis month's challenge-service limit on our key is reached. Raise it in the dashboard (Settings), or use your own key.
404NOT_FOUNDNo session, run, profile, webhook or recording with that id on your account.
409NOT_RUNNINGLive view, a reconnect or a hand-off asked for before the browser started or after it ended.
409NOT_KEEPALIVEThis session cannot be reconnected. Start it with keepAlive: true.
409PROFILE_IN_USEAnother session is already saving to that profile. Stop it, or open the profile with persist: false.
409NOT_READYThe recording is still being uploaded. Try again shortly after the session ends.
409HANDOFF_UNSUPPORTEDThe server running this browser does not support hand-off yet.
409NO_HANDOFFMarked done, but no hand-off was asked for.
409HANDOFF_EXPIREDThe hand-off timed out before it was marked done.
409WEBHOOK_LIMITAt most 5 webhooks per account. Delete one first.
410ENDEDA live link whose session has ended.
410GONEA replay link whose recording is no longer available (failed, or past its retention).
413TOO_LARGEA cookie import would make the profile larger than 3.5 MB.
429CONCURRENCY_LIMITToo 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.
503NO_CAPACITYNo 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.
503NO_WORKERThe server running that session is not reachable at the moment.
503NOT_CONFIGUREDHosted browsers (or that part of them) are not configured on this server.
503NOT_AVAILABLENotes, profiles, runs, recordings, events, hand-off, webhooks or the challenge service are not enabled on this server yet.

Lỗi được trả về dạng JSON: { "error": "...", "code": "..." }. Nếu chính kết nối WebSocket bị từ chối, hãy tạo một phiên mới: connect URL chỉ dùng được một lần và hết hạn sau hai phút. Một WebSocket upgrade bị từ chối sẽ trả về một mã trạng thái HTTP kèm error dạng JSON: 409 khi URL đã được dùng, phiên đã bị hủy, không được khởi động với keepAlive, hoặc đang có kết nối rồi; 401 khi URL đã hết hạn.

Khi nào nên thử lại

  • Thử lại với backoff: 503 NO_CAPACITY và 503 NO_WORKER (chờ 1, 2, 4… giây kèm một chút jitter, và dừng sau vài lần), cùng 429 không có code (rate limit theo địa chỉ).
  • Thử lại vài lần với backoff: các phản hồi 5xx khác, và một lần kết nối bị từ chối trước khi script của bạn bắt đầu (với một phiên mới: connect URL cũ đã dùng rồi).
  • Không thử lại trong vòng lặp: 400 (sửa request), 401, 402 (nạp thêm tiền), 429 CONCURRENCY_LIMIT (đóng bớt một trình duyệt trước) và 409 PROFILE_IN_USE. Phải có người xử lý; thử lại chỉ tốn request vô ích.