{% extends "_layout.html" %} {% set title = "The job is not in a state that allows this" %} {% set status = "409 Conflict" %} {% set description = "The job’s current state does not allow this call: a submit or upload grant past awaiting_input, a grant re-issue with a different bytes, or deleting a job that is not terminal." %} {% block main %}

The job’s current state does not allow the call you made: a submit that is not a replay of the original, or an upload grant, for a job past awaiting_input; a submit for a job holding no upload; an upload-grant re-issue naming a different size_bytes or digest from the ones the archive’s first grant fixed; or DELETE of a job that is not terminal. With reason: "in_progress" and Retry-After, it is a create or a submit repeating an Idempotency-Key whose original request the server is still handling.

What to do

  1. On reason: "in_progress", wait Retry-After and retry with the same key and the same body.
  2. Otherwise read the job with GET /v1/jobs/{id} to see its state, and act on it.
  3. A retried submit that already succeeded is not this: replay it with the same Idempotency-Key and the same body, and you get the original response back.
  4. Re-issue a grant with the size_bytes and digest the archive’s first grant fixed. A re-issue cannot change either.
  5. A job that is still going is cancelled first and deleted once the job object says it is terminal. A person does both in the portal, which offers a delete only to those who may.

The body

{
  "type":     "https://sc.example.com/server-errors/job-state-conflict",
  "title":    "The job is not in a state that allows this",
  "status":   409,
  "detail":   "...",
  "instance": "/v1/jobs/01J9.../submit",
  "reason":   "in_progress",   // only on a retry the server is still handling
  "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}

detail is prose and may be reworded at any time. Branch on type, then on reason — never parse detail.

Where it comes from

POST /v1/jobs reason: "in_progress": a create repeating an Idempotency-Key whose original is still being handled.
POST /v1/jobs/{id}/upload-grant The job is not in created or awaiting_input, or a re-issue names a different size_bytes or digest from the grant already fixed.
POST /v1/jobs/{id}/submit The job is past awaiting_input, and this is not a replay of the original submit — or no upload has arrived for it: ask for a grant and PUT first. reason: "in_progress", as at create.
DELETE /v1/jobs/{id} The job is not terminal. Cancel a running job first; an administrator is held to this too.
{% include "_help.html" %}

What this is not

not-ready is also a 409, and transient: an output that is on its way, with a Retry-After to wait for. This one carries no Retry-After: the identical call gets the identical answer, unless something else has moved the job on — a cancel finishing, for a DELETE.

not-found (404) is a job that does not exist or is not yours. A 409 means the job is established and its state is the problem.

idempotency-key-reuse (422) is a key sent again with a different request. A true replay of the original submit is answered with the original response, not with either.

{% endblock %}