Checks and limits
Before TourOptimizer stores a job, it checks whether the server can take it, whether the tenant and the license are valid, and whether the request stays within the limits. A job that fails a check is refused before any work starts, with an HTTP status and a reason code. This page lists the checks, the limits and every reason code.
The diagram opens full size on click.
Load of the server
These checks protect a copy of TourOptimizer and its MongoDB. They run in both modes. In trusted mode only the storage reserve is on by default; the others are UNLIMITED until you set them. In auth mode the JOpt Platform stack sets them.
| Check | Setting | Trusted mode default | Refusal |
|---|---|---|---|
| Free space of the MongoDB disk, read every 60 seconds | DNA_STORAGE_RESERVE (a size such as 10GB, or 0 to turn the check off) | 10GB | 503 STORAGE_LOW, Retry-After: 300 |
| Job uploads that one copy receives at a time | DNA_MAX_SUBMITS_IN_FLIGHT (a number or UNLIMITED) | UNLIMITED | 503 SERVER_BUSY, Retry-After: 5 |
| Bytes of the job uploads that one copy receives at a time | DNA_MAX_SUBMIT_BYTES_IN_FLIGHT (a size or UNLIMITED) | UNLIMITED | 503 SERVER_BUSY, Retry-After: 5 |
| Job uploads of one tenant at a time (auth mode only) | DNA_MAX_SUBMITS_IN_FLIGHT_PER_TENANT | No effect in trusted mode | 429 TENANT_BUSY, Retry-After: 5 |
| Input of all waiting jobs together, over all copies | DNA_MAX_TOTAL_QUEUED_BYTES (a size or UNLIMITED) | UNLIMITED | 503 SERVER_BUSY, Retry-After: 15 |
| An upload that sends no bytes for a while | DNA_SUBMIT_BODY_IDLE_TIMEOUT (a duration) | PT60S | 408 REQUEST_BODY_TIMEOUT |
- The upload checks answer before the body of the request is read.
- An upload counts with its
Content-Length. Send the header, so that a copy can count a large job correctly. - The sum of the waiting input is read every 15 seconds, so the bound is soft.
DNA_SUBMIT_BODY_IDLE_TIMEOUTis the time between two parts of the body, not the time of the whole upload.
Tenant and license
| Check | Refusal |
|---|---|
The request names no tenant (trusted mode: no X-Tenant-Id header) | 400 TENANT_MISSING |
| The tenant id is malformed | 400 or 403 TENANT_INVALID |
| No license with the request and no default license on the server | 403 LICENSE_MISSING |
| The license does not allow the request or cannot be read | 403 LICENSE_INVALID |
| The subscription of the account has ended (auth mode) | 403 TENANT_SUSPENDED |
| The account is removed from the server (auth mode) | 403 TENANT_REMOVED |
Where the license comes from in each mode is on Settings.
The request
| Check | Refusal |
|---|---|
| More elements (nodes and resources) than the server or the account accepts | 403 ELEMENT_LIMIT_EXCEEDED |
extension.timeOut above the max run time of the server or the account | 403 RUN_TIME_LIMIT_EXCEEDED |
mongoSettings.expiry above the max keep time of the server or the account | 403 KEEP_TIME_LIMIT_EXCEEDED |
| The completion webhook URL is not allowed | 400 WEBHOOK_URL_NOT_ALLOWED |
| The encryption secret of the client is too weak | 400 ENCRYPTION_SECRET_WEAK |
| The job sends its own encryption secret (auth mode) | 400 ENCRYPTION_SECRET_NOT_ALLOWED |
The Idempotency-Key is malformed, or used before with another body | 400 IDEMPOTENCY_KEY_INVALID, 422 IDEMPOTENCY_KEY_REUSED |
How the run time, the keep time, the webhook URL policy and the encryption work is on Jobs.
Limits of the plan (auth mode)
In auth mode the plan of each account sets its limits: how many of its jobs run at a time and how many wait, how much data its waiting jobs may hold, its quotas, its element limit, its max run time and keep time, and the capabilities and geo providers it may use. A request above a limit of the plan is refused with 403 or 429; the codes are in the tables below. GET /api/account/plan returns the plan of the signed-in account. A job of an account that already runs as many jobs as it may waits in the queue; it is not refused.
Size limits
| Limit | Trusted mode | Auth mode |
|---|---|---|
| Elements per optimization | Off by default. DNA_HAS_ELEMENT_LIMITS=true turns it on, DNA_ELEMENT_LIMITS_COUNT sets the number (default 100). | From the plan of the account |
| Size of a request body | 250 MB, the largest body the server reads into memory | A maximum request size set by the stack; a larger body gets 413 REQUEST_TOO_LARGE |
CPU cores of a run (JOpt.NumCPUCores) | As the request asks | A larger value is lowered to the maximum of the stack; the job is not refused |
Errors and reason codes
Every error answer has a JSON body (ErrorResponse) with the fields timestamp, path, status, error, requestId, message and reasonCode. React to the reasonCode, not to the text of message.
- A
401comes only from the token check in auth mode. License problems are403, never401. - A
429or503that names aRetry-Afterheader asks the client to send the request again after that many seconds. - A job of another tenant answers
404, as if it did not exist. - An
INTERNAL_ERRORcarries the request id in its message. Quote it when you contact support.
Request and account
| Code | HTTP status | Meaning |
|---|---|---|
TENANT_MISSING | 400 | The request names no account (trusted mode: no X-Tenant-Id header). |
TENANT_INVALID | 400, 403 | The account id is not accepted: a malformed X-Tenant-Id header (400) or a malformed tenant claim in the token (403). |
TENANT_CLAIM_MISSING | 403 | The token carries no tenant claim. |
TENANT_REQUIRED | 403 | This request needs an account and this path has none. |
JOB_ID_MISSING | 400 | The request names no job. |
REQUEST_INVALID | 400 | The request is malformed or misses a required part. |
REQUEST_TOO_LARGE | 413 | The request body is larger than this server accepts (auth mode). |
REQUEST_BODY_TIMEOUT | 408 | The job upload stopped: its body sent no bytes for longer than this server waits; send the request again. |
License, plan and account state
| Code | HTTP status | Meaning |
|---|---|---|
LICENSE_MISSING | 403 | No license for this account (trusted mode: none sent and no default license). |
LICENSE_INVALID | 403 | The license does not allow this request or cannot be read. |
ELEMENT_LIMIT_EXCEEDED | 403 | More elements (nodes and resources) than this server or this account accepts per optimization. |
CAPABILITY_DISABLED | 403 | The capability (optimization, geocoding, routing, distance matrices) is not enabled for this account, or the endpoint is not available. |
CLIENT_NOT_ALLOWED | 403 | The application the token was obtained with (JOpt.Solve, the MCP connector) is not enabled for this account, or this server does not accept tokens of that application. |
PROVIDER_NOT_ALLOWED | 403 | The geo provider is not enabled for this account. |
MATRIX_TOO_LARGE | 403 | The distance matrix is larger than this account allows. |
ROUTING_TOO_LARGE | 403 | The routing request has more routes than this account allows. |
ENTITLEMENT_MISCONFIGURED | 403 | A size, run or time limit of the plan of this account, or the date its subscription is paid until, is missing or invalid; there is no default, so the calls that need it are refused until the plan is set up. |
RUN_TIME_LIMIT_EXCEEDED | 403 | The job asks for a longer max run time (extension.timeOut, or UNLIMITED) than this account allows. |
KEEP_TIME_LIMIT_EXCEEDED | 403 | The job asks to keep its results longer (mongoSettings.expiry, or UNLIMITED) than this account allows. |
SYNC_RUN_TIME_LIMIT_EXCEEDED | 403 | The synchronous run asks for a longer run time than synchronous runs allow; submit it as a job. |
RATES_MISSING | 403 | A quota (its limit or its window) or the queued-job maximum of the plan of this account is missing or invalid, or its queued-data maximum is invalid; there is no default, so the calls that need it are refused until the plan is set up. |
TENANT_SUSPENDED | 403 | The subscription of the account has ended (its paid-until date and the grace period after it have passed): new optimizations and geo calls are refused until it is renewed; its results stay readable. |
TENANT_REMOVED | 403 | The account is removed from this server, or its removal is under way: its job submits, imports, synchronous runs and geo calls and the requests that would store data for it are refused; its reads and deletes still answer. |
GEO_KEY_MISSING | 403 | No geo provider key for this account and provider. |
Quotas and server load
| Code | HTTP status | Meaning |
|---|---|---|
QUOTA_EXCEEDED | 429 | The account reached its quota; try again later. |
CONCURRENT_RUNS_EXCEEDED | 429 | The account already runs as many optimizations at a time as it may; try again when one finishes. Job submits do not return it: a job of an account at its maximum waits in the queue. |
QUEUED_JOBS_EXCEEDED | 429 | The account already has as many jobs waiting in the queue as it may; try again when one has started. |
QUEUED_DATA_EXCEEDED | 429 | The jobs of the account waiting in the queue already hold as much data as it may, or this job alone holds more; try again when one has started. |
TENANT_BUSY | 429 | The account already sends as many job uploads to this server at a time as it may, or its uploads raced for its last free waiting place; try again after the seconds in the Retry-After header. |
DEPENDENCY_UNAVAILABLE | 503 | A service this request needs is temporarily unavailable; try again later. |
SERVER_BUSY | 503 | This server is busy with other uploads, or its queue holds as much waiting data as it takes; try again after the seconds in the Retry-After header. |
STORAGE_LOW | 503 | The storage of this server is nearly full, so it takes no new jobs for now; try again after the seconds in the Retry-After header. |
SERVICE_MAINTENANCE | 503 | This server is under maintenance (an account removal or a restore of its data), so it answers no request for now; try again after the seconds in the Retry-After header. |
Encryption, webhooks and retries
| Code | HTTP status | Meaning |
|---|---|---|
ENCRYPTION_SECRET_INVALID | 403 | The result is encrypted and the secret sent is missing or wrong. |
ENCRYPTION_SECRET_WEAK | 400 | The encryption secret is too weak. |
ENCRYPTION_SECRET_NOT_ALLOWED | 400 | The job carries its own encryption secret (mongoSettings.secret), which auth mode does not accept: the server manages the encryption of stored data. |
WEBHOOK_URL_NOT_ALLOWED | 400 | The completion webhook URL is not allowed. |
IDEMPOTENCY_KEY_INVALID | 400 | The Idempotency-Key header is not 1 to 64 characters of letters, digits and . _ : -, or it was sent more than once. |
IDEMPOTENCY_KEY_REUSED | 422 | This account already used the Idempotency-Key for a job with another request body; send a new key for a new job. |
Jobs and runs
| Code | HTTP status | Meaning |
|---|---|---|
NOT_FOUND | 404 | No such run, job, solution, result or environment. |
PLAN_NOT_AVAILABLE | 404 | This server runs without accounts (trusted mode), so it has no account plan; the plan is served in auth mode. |
JOB_NOT_QUEUED | 409 | The job is not waiting in the queue (it runs or has ended), so it cannot be cancelled; stop a running job instead. |
RUN_RESULT_TIMEOUT | 504 | Timed out waiting for the result of a synchronous run; the run may still be active. |
RUN_TIMEOUT | 504 | The optimization took too long, or a synchronous run did not stop within the stop grace after its time limit. |
INTERNAL_ERROR | 500, other 5xx | An internal error; the message carries the request id. |
Geo data (JOpt Platform stack)
| Code | HTTP status | Meaning |
|---|---|---|
GEO_REQUEST_INVALID | 400, 404, 413, 422 | The geo service did not accept the request. |
GEO_REQUEST_LIMIT_EXCEEDED | 400, 413 | The geo request is larger than the geo service accepts (413: the request body). |
GEO_PROVIDER_UNKNOWN | 400 | The requested geo provider is not known. |
GEO_PROVIDER_KEY_REJECTED | 502 | The geo provider rejected the API key. |
GEO_PROVIDER_RATE_LIMITED | 502 | The rate limit of the geo provider was reached; try again later. |
GEO_PROVIDER_REQUEST_REJECTED | 502 | The geo provider rejected the request. |
GEO_SERVICE_ERROR | 502 | The geo service could not complete the request. |
GEO_SERVICE_UNAVAILABLE | 503 | The geo service is temporarily unavailable. |
GEO_SERVICE_BUSY | 429, 503 | The geo service takes no more requests for now: this account already has as many geo requests running at a time as it may (429), or the geo service is busy with other requests (503); try again after the seconds in the Retry-After header, when it is sent. |
GEO_SERVICE_UNREACHABLE | 504 | The geo service did not answer. |
GEO_SERVICE_TIMEOUT | 504 | The geo request did not finish in time: the geo provider did not answer, or the request ran longer than the geo service allows; try again later. |
Related pages
- Jobs: run time, keep time, webhooks and encryption
- Settings: every setting of both modes
- API and clients: the endpoint groups and the headers
- JOpt Platform: accounts and plans in auth mode
Added: 2026-11-27 | Last updated: 2026-11-27