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/runsalso has arun_idonce the run exists, whatever its status, so you can read the run it saved; see Start a durable run. 401is always{"error":"unauthorized"}and403is always{"error":"forbidden"}.5xxis 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:
| Status | Cause | Example body |
|---|---|---|
400 | A required query parameter is missing, or the body is not valid JSON | Failed to deserialize query string: missing field `owner_uid` |
413 | Body larger than 2 MiB | |
415 | Body sent without Content-Type: application/json | Expected request with `Content-Type: application/json` |
422 | Body is JSON but a required field is missing or has the wrong type | Failed 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
| Status | Meaning |
|---|---|
200, 201 | Done. POST /v1/connectors returns 201. |
400 | The 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. |
401 | No token, or one Compute Gateway does not accept. |
403 | The 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. |
404 | No such run or connector. |
409 | Ticking 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. |
500 | Compute Gateway failed. On the Model Gateway link, Pigeon link and connector endpoints, also a service it depends on. |
503 | A 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
| Limit | Value |
|---|---|
| Fuel per one-shot call, durable-run step or Nora turn | What Spend Gateway reserves, at most the grant’s per_call_fuel_cap |
| Module memory | 256 MiB per call or step |
| Module time | 30 seconds per call or step |
| Request time | 60 seconds; a request still running then is cut off |
| Durable-run state | 128 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 output | 1 MiB of post_output and 1 MiB of stdout per call or step; an append past either traps |
| Steps in one request | 10,000 |
| Request body | 2 MiB |
| Connector call | 15 seconds; at most 1 MiB of the response body is read |
Compute Gateway has no rate limits of its own.