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.

Before TourOptimizer stores a job it checks the storage and load of the server, the tenant, the request and the queue limits. A failed check refuses the job with an HTTP status and a reason code in the answer; a refusal for load carries a Retry-After header. A job that passes is stored as QUEUED and answered with 202.

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.

CheckSettingTrusted mode defaultRefusal
Free space of the MongoDB disk, read every 60 secondsDNA_STORAGE_RESERVE (a size such as 10GB, or 0 to turn the check off)10GB503 STORAGE_LOW, Retry-After: 300
Job uploads that one copy receives at a timeDNA_MAX_SUBMITS_IN_FLIGHT (a number or UNLIMITED)UNLIMITED503 SERVER_BUSY, Retry-After: 5
Bytes of the job uploads that one copy receives at a timeDNA_MAX_SUBMIT_BYTES_IN_FLIGHT (a size or UNLIMITED)UNLIMITED503 SERVER_BUSY, Retry-After: 5
Job uploads of one tenant at a time (auth mode only)DNA_MAX_SUBMITS_IN_FLIGHT_PER_TENANTNo effect in trusted mode429 TENANT_BUSY, Retry-After: 5
Input of all waiting jobs together, over all copiesDNA_MAX_TOTAL_QUEUED_BYTES (a size or UNLIMITED)UNLIMITED503 SERVER_BUSY, Retry-After: 15
An upload that sends no bytes for a whileDNA_SUBMIT_BODY_IDLE_TIMEOUT (a duration)PT60S408 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_TIMEOUT is the time between two parts of the body, not the time of the whole upload.

Tenant and license

CheckRefusal
The request names no tenant (trusted mode: no X-Tenant-Id header)400 TENANT_MISSING
The tenant id is malformed400 or 403 TENANT_INVALID
No license with the request and no default license on the server403 LICENSE_MISSING
The license does not allow the request or cannot be read403 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

CheckRefusal
More elements (nodes and resources) than the server or the account accepts403 ELEMENT_LIMIT_EXCEEDED
extension.timeOut above the max run time of the server or the account403 RUN_TIME_LIMIT_EXCEEDED
mongoSettings.expiry above the max keep time of the server or the account403 KEEP_TIME_LIMIT_EXCEEDED
The completion webhook URL is not allowed400 WEBHOOK_URL_NOT_ALLOWED
The encryption secret of the client is too weak400 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 body400 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

LimitTrusted modeAuth mode
Elements per optimizationOff 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 body250 MB, the largest body the server reads into memoryA 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 asksA 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 401 comes only from the token check in auth mode. License problems are 403, never 401.
  • A 429 or 503 that names a Retry-After header 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_ERROR carries the request id in its message. Quote it when you contact support.

Request and account

CodeHTTP statusMeaning
TENANT_MISSING400The request names no account (trusted mode: no X-Tenant-Id header).
TENANT_INVALID400, 403The account id is not accepted: a malformed X-Tenant-Id header (400) or a malformed tenant claim in the token (403).
TENANT_CLAIM_MISSING403The token carries no tenant claim.
TENANT_REQUIRED403This request needs an account and this path has none.
JOB_ID_MISSING400The request names no job.
REQUEST_INVALID400The request is malformed or misses a required part.
REQUEST_TOO_LARGE413The request body is larger than this server accepts (auth mode).
REQUEST_BODY_TIMEOUT408The job upload stopped: its body sent no bytes for longer than this server waits; send the request again.

License, plan and account state

CodeHTTP statusMeaning
LICENSE_MISSING403No license for this account (trusted mode: none sent and no default license).
LICENSE_INVALID403The license does not allow this request or cannot be read.
ELEMENT_LIMIT_EXCEEDED403More elements (nodes and resources) than this server or this account accepts per optimization.
CAPABILITY_DISABLED403The capability (optimization, geocoding, routing, distance matrices) is not enabled for this account, or the endpoint is not available.
CLIENT_NOT_ALLOWED403The 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_ALLOWED403The geo provider is not enabled for this account.
MATRIX_TOO_LARGE403The distance matrix is larger than this account allows.
ROUTING_TOO_LARGE403The routing request has more routes than this account allows.
ENTITLEMENT_MISCONFIGURED403A 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_EXCEEDED403The job asks for a longer max run time (extension.timeOut, or UNLIMITED) than this account allows.
KEEP_TIME_LIMIT_EXCEEDED403The job asks to keep its results longer (mongoSettings.expiry, or UNLIMITED) than this account allows.
SYNC_RUN_TIME_LIMIT_EXCEEDED403The synchronous run asks for a longer run time than synchronous runs allow; submit it as a job.
RATES_MISSING403A 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_SUSPENDED403The 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_REMOVED403The 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_MISSING403No geo provider key for this account and provider.

Quotas and server load

CodeHTTP statusMeaning
QUOTA_EXCEEDED429The account reached its quota; try again later.
CONCURRENT_RUNS_EXCEEDED429The 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_EXCEEDED429The account already has as many jobs waiting in the queue as it may; try again when one has started.
QUEUED_DATA_EXCEEDED429The 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_BUSY429The 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_UNAVAILABLE503A service this request needs is temporarily unavailable; try again later.
SERVER_BUSY503This 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_LOW503The 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_MAINTENANCE503This 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

CodeHTTP statusMeaning
ENCRYPTION_SECRET_INVALID403The result is encrypted and the secret sent is missing or wrong.
ENCRYPTION_SECRET_WEAK400The encryption secret is too weak.
ENCRYPTION_SECRET_NOT_ALLOWED400The 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_ALLOWED400The completion webhook URL is not allowed.
IDEMPOTENCY_KEY_INVALID400The Idempotency-Key header is not 1 to 64 characters of letters, digits and . _ : -, or it was sent more than once.
IDEMPOTENCY_KEY_REUSED422This account already used the Idempotency-Key for a job with another request body; send a new key for a new job.

Jobs and runs

CodeHTTP statusMeaning
NOT_FOUND404No such run, job, solution, result or environment.
PLAN_NOT_AVAILABLE404This server runs without accounts (trusted mode), so it has no account plan; the plan is served in auth mode.
JOB_NOT_QUEUED409The job is not waiting in the queue (it runs or has ended), so it cannot be cancelled; stop a running job instead.
RUN_RESULT_TIMEOUT504Timed out waiting for the result of a synchronous run; the run may still be active.
RUN_TIMEOUT504The optimization took too long, or a synchronous run did not stop within the stop grace after its time limit.
INTERNAL_ERROR500, other 5xxAn internal error; the message carries the request id.

Geo data (JOpt Platform stack)

CodeHTTP statusMeaning
GEO_REQUEST_INVALID400, 404, 413, 422The geo service did not accept the request.
GEO_REQUEST_LIMIT_EXCEEDED400, 413The geo request is larger than the geo service accepts (413: the request body).
GEO_PROVIDER_UNKNOWN400The requested geo provider is not known.
GEO_PROVIDER_KEY_REJECTED502The geo provider rejected the API key.
GEO_PROVIDER_RATE_LIMITED502The rate limit of the geo provider was reached; try again later.
GEO_PROVIDER_REQUEST_REJECTED502The geo provider rejected the request.
GEO_SERVICE_ERROR502The geo service could not complete the request.
GEO_SERVICE_UNAVAILABLE503The geo service is temporarily unavailable.
GEO_SERVICE_BUSY429, 503The 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_UNREACHABLE504The geo service did not answer.
GEO_SERVICE_TIMEOUT504The 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.

Added: 2026-11-27 | Last updated: 2026-11-27