Errors

conflict

409. The current state of the resource prevents the operation, a request with the same Idempotency-Key is still in flight, or another write held the resource, or the database aborted the transaction on a transient conflict, so nothing was written. The cause is in errors[0].code: invalid_state for the first, in_progress for the second and lock_timeout for the third. detail is not for deciding. HTTP 409.

HTTP status
409
Problem type
https://docs.filmo.io/errors/conflict

Example

{
  "type": "https://docs.filmo.io/errors/conflict",
  "title": "Conflict",
  "status": 409,
  "code": "conflict",
  "detail": "The current state of the resource does not allow the operation",
  "requestId": "req_0b9f6c1d2e3a4f5a8b7c6d5e4f3a2b1c",
  "errors": [
    {
      "path": "",
      "code": "invalid_state",
      "message": "The current state of the resource does not allow the operation"
    }
  ]
}

When it happens

409. The current state of the resource prevents the operation, a request with the same Idempotency-Key is still in flight, or another write held the resource, or the database aborted the transaction on a transient conflict, so nothing was written. The cause is in errors[0].code: invalid_state for the first, in_progress for the second and lock_timeout for the third. detail is not for deciding.

What to do

Branch on errors[0].code. For in_progress and lock_timeout, wait and send the same request again with the same Idempotency-Key; with backoff for lock_timeout. If an in_progress 409 persists for about two minutes, the reservation is treated as abandoned and the next attempt with the same key runs, so read the resource before retrying. For invalid_state, do not retry unchanged: read the resource and, if the request still fits, you may send it again; otherwise change it to fit its state; examples are archiving an order that is neither a draft nor cancelled, unreserving a cancelled order, or cancelling one already checked in.

Retry

  • Retry with the same key409 conflict · in_progress · Idempotency-Key: Yes

    errors[0].code is in_progress: another request with the same Idempotency-Key is still running. Wait and retry with the same key (exponential backoff, up to 3 times): you get its stored response when it finishes. If the 409 persists for about two minutes, the reservation is treated as abandoned and the next attempt with the same key runs; read the resource before retrying.

  • Retry with backoff409 conflict · lock_timeout

    errors[0].code is lock_timeout: another write held the resource, or the database aborted the transaction on a transient conflict; nothing was written. Retry with the same key and an exponential backoff, up to 3 times; if it persists, read the resource again.

  • Read the resource first409 conflict · invalid_state

    errors[0].code is invalid_state: the state of the resource forbids the operation (a unique violation, a line of an atomic batch, an item deleted while saving). Do not retry unchanged: waiting never fixes it. Read the resource again; if the request still fits, you may send it again.

Fields of errors[]

errors[].codestring

Stable code of the field error (required, must_not_be_null, invalid_type, invalid_value, too_small, too_big, unknown_field, invalid_format, not_found, must_be_after…). On a 409 conflict it says the cause: in_progress (another request with the same Idempotency-Key is still running), lock_timeout (another conditional write held the resource for more than five seconds) or invalid_state (the state of the resource forbids the operation).

Returned by

98 operations

Through MCP

A tool call that fails comes back with `isError` set and the problem as structured content, with the same `code`.

Status

Was this page helpful?