Skip to content
pols.so docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

Errors

The stable error codes of the pols API, CLI, MCP server and TypeScript client, what usually causes each, and what to do.

Every failed API call returns a JSON body with a stable, machine-readable code and a human-readable message:

{ "error": { "code": "quota_exceeded", "message": "..." } }

The CLI prints the message, and with --json it prints the same document. The TypeScript client throws a PolsError with status and code. Match on code, never on the message text.

Code HTTP Usually means What to do
bad_request 400 an invalid argument: size, name, CIDR, path, coordinates, or a vault entry that does not exist fix the input; add a missing vault entry on the account page
unauthorized 401 no API key, a wrong one, or a revoked or expired one run pols login or set POLS_API_KEY
forbidden 403 the action is not allowed, such as deleting the system template, or a key limited to some sandboxes acting on the org use your own template; use a key for the whole org
quota_exceeded 403 too many templates, or over the org’s running-sandbox or sandbox limit stop or delete something; see quotas
not_found 404 a wrong ID or name, or a file that does not exist check pols ls or the path
sandbox_in_other_org 404 the sandbox is not in the org the API key acts in, but in another of your orgs, given in org_id switch with pols org use ORG, or use a key of that org
conflict 409 the sandbox is not running, is still in a transition, or the name is taken (on create, fork or rename) pols get it, wait until it has arrived or resume it, or pick another name
rate_limited 429 too many requests, failed logins, or calls in progress at once wait the Retry-After seconds and retry with fewer parallel calls; see rate limits
host_capacity 429 the host has no room for the sandbox’s size right now, on create, resume or resize; temporary retry after the Retry-After seconds
internal 500 a bug or an outage on our side retry later; tell us if it persists
runtime_error 502 the sandbox host failed to carry out the call retry; a sandbox in status error has to be deleted
unavailable 503 the feature is not configured on this deployment, such as the vault, ports, desktop links or SSH use pols exec and pols cp instead, or ask us
waking 503 the sandbox is still waking from standby or booting retry
server_busy 503 the sandbox’s host has no room yet to wake it from standby; pols keeps retrying for up to 10 minutes retry after the Retry-After seconds
timeout 504, 408 the sandbox host was too slow, or a request body stalled for 30 seconds retry

Sandbox errors

Separate from API errors, a sandbox whose transition failed goes to status error, with the reason in last_error. It cannot be used any more: delete it and create a new one, or fork an earlier copy if you have one.

Exit codes

A command that runs in a sandbox and exits with a non-zero code is not an API error. pols exec exits with the same code, the API returns it in exit_code, and the MCP tool sandbox_exec returns it as a normal result.