Skip to content

payments returns CONFLICT error code not declared in PaymentsErrorsEnum, breaking generated clients (infinite retry) #803

Open

Description

@tycjan-byte

The v2/v3 transfer-initiation create path returns "CONFLICT" (ErrUniqueReference) on a duplicate/unique-reference collision, but PaymentsErrorsEnum in openapi.yaml (and the generated client) only declares INTERNAL, VALIDATION, NOT_FOUND.

Generated clients (including orchestration's, used by the CreateTransferInitiation activity) fail to deserialize the response with:

error unmarshalling json response body: invalid value for PaymentsErrorsEnum: CONFLICT

The unmarshal failure is treated as retryable, so orchestration retries the create in a loop instead of surfacing the conflict to the caller. The payable creation looks like a silent failure rather than a rejection.

Impact

Not isolated to a single request: the same error string can affect many workflows on a stack concurrently, with retry attempts accumulating into the thousands, since the enum mismatch causes an unbounded retry loop.

Root cause

The server emits an error code that its own published contract does not declare. V3ErrorsEnum already includes CONFLICT, but the older PaymentsErrorsEnum (used by the v1/v2 CreateTransferInitiation error type PaymentsErrorResponse) does not.

Suggested fix

  • Add CONFLICT to PaymentsErrorsEnum in the OpenAPI spec and regenerate the client.
  • Ensure orchestration picks up the regenerated client so the conflict surfaces as a real error instead of an infinite retry.

Refs (@38312593b)

  • internal/api/v2/errors.go:18,31 — server returns "CONFLICT" (ErrUniqueReference) on transfer-initiation create
  • pkg/client/models/operations/createtransferinitiation.go:14 — CreateTransferInitiation error typed as PaymentsErrorResponse (ErrorCode = PaymentsErrorsEnum)
  • pkg/client/models/components/paymentserrorsenum.go — enum allows only INTERNAL/VALIDATION/NOT_FOUND; UnmarshalJSON returns invalid value for PaymentsErrorsEnum: %v
  • openapi.yaml:4545 — PaymentsErrorsEnum spec omits CONFLICT

Activity

  1. bashkirian commented on Sep 25, 2026

    @bashkirian

    Looks like this was fixed in #805 (commit 472e0af): CONFLICT is now declared in PaymentsErrorsEnum in openapi.yaml and the generated client, and TestErrorCodesAreDeclaredInOpenAPIEnums guards against this regressing. Can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions