Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Errors and limits

Error shape

Errors Compute Gateway raises are JSON with an error field:

{"error": "module main@1.0.0 is not run-capable (no `run_init` export)"}
  • An error from POST /v1/compute/runs also has a run_id once the run exists, whatever its status, so you can read the run it saved; see Start a durable run.
  • 401 is always {"error":"unauthorized"} and 403 is always {"error":"forbidden"}.
  • 5xx is always {"error":"internal error"}; details are kept out of responses.
  • Other messages are written for people and may change. There are no error codes. Messages about running a module often pass on what Drive, Granite, Spend Gateway or the WebAssembly runtime said.
curl -sS https://j5afbrmr6qzrwewgxdwacvmedq0ylxvy.lambda-url.us-east-1.on.aws/v1/connectors/example | grep -Fx '{"error":"unauthorized"}'

Some errors are not JSON. They come from request parsing, before Compute Gateway looks at your token, and are plain text:

StatusCauseExample body
400A required query parameter is missing, or the body is not valid JSONFailed to deserialize query string: missing field `owner_uid`
413Body larger than 2 MiB
415Body sent without Content-Type: application/jsonExpected request with `Content-Type: application/json`
422Body is JSON but a required field is missing or has the wrong typeFailed to deserialize the JSON body into the target type: missing field `grant_id` ...
curl -sS -o /dev/null -w '%{http_code}\n' https://j5afbrmr6qzrwewgxdwacvmedq0ylxvy.lambda-url.us-east-1.on.aws/v1/compute/runs/00000000-0000-0000-0000-000000000000 | grep -Fx 400

An unknown path returns 404, and a known path with the wrong method returns 405, both with an empty body.

Status codes

StatusMeaning
200, 201Done. POST /v1/connectors returns 201.
400The module could not be run or stepped: it is not in Drive, Granite refused or does not know the grant, the grant has no per_call_fuel_cap, Spend Gateway refused the reservation, a service the module called rejected what it asked for, the module trapped or ran out of fuel or time, it emitted a malformed command or a capability its grant lacks, or it is not run-capable. Also a run id that is not a UUID, an owner_uid/app_id that does not match the run, or a connector base_url that breaks the rules.
401No token, or one Compute Gateway does not accept.
403The token is not owner_uid’s: only the owner may run a module or read, tick or message its runs. Also a grant owned by someone other than owner_uid, or a machine token on an endpoint that acts for a person.
404No such run or connector.
409Ticking a run that is already finished; resolving or using a Model Gateway link that is not approved or not started; running a module, or resolving a wallet grant, before the person’s spend:wallet grant is approved.
500Compute Gateway failed. On the Model Gateway link, Pigeon link and connector endpoints, also a service it depends on.
503A service Compute Gateway depends on (Drive, Granite, Spend Gateway, Model Gateway or Pigeon) is down, unreachable, overloaded, or refused Compute Gateway’s own credentials. Not caused by your request; retry later.

Limits

LimitValue
Fuel per one-shot call, durable-run step or Nora turnWhat Spend Gateway reserves, at most the grant’s per_call_fuel_cap
Module memory256 MiB per call or step
Module time30 seconds per call or step
Request time60 seconds; a request still running then is cut off
Durable-run state128 KiB; a larger set_state traps the step. A run whose saved record (state, plus the command it waits on and that command’s result) passes Drive’s 256 KiB record limit ends failed
Module output1 MiB of post_output and 1 MiB of stdout per call or step; an append past either traps
Steps in one request10,000
Request body2 MiB
Connector call15 seconds; at most 1 MiB of the response body is read

Compute Gateway has no rate limits of its own.