Skip to main content

Troubleshooting

Symptom, cause, check, fix, for the failure modes the code can produce. Log messages are quoted exactly as the binaries write them. For the deployed shape and routine procedures see the Runbook; for every variable see Configuration.

The process does not start​

SymptomCauseCheckFix
cmd/api exits 1 at once: DATABASE_URL is required: this context runs on real Postgres, there is no in-memory modemandatory variable missingthe error names the variable; they are checked in the order DATABASE_URL, KAFKA_BROKERS, PAYMENT_PROVIDER_URL, CHECKOUT_CONSUMER_GROUP, ORDER_SOURCING_CONSUMER_GROUP, SHIPPING_AND_TRACKING_CONSUMER_GROUP and only the first missing one is reportedset it (chart: database.*, kafka.brokers, config.paymentProviderUrl, config.*ConsumerGroup)
cmd/a2a exits 1: A2A_AGENT_URL is required: the Agent Card must advertise the absolute URL of this agent's JSON-RPC endpointno A2A_AGENT_URL, or a relative / schemeless / non-http(s) / host-less value (A2A_AGENT_URL="/a2a" is not an absolute http(s) URL)the error is joined with the DATABASE_URL one when both are missingset an absolute URL such as http://<release>-a2a.<ns>.svc.cluster.local:8093/; the chart defaults it
cmd/mcp / cmd/a2a exits 1 with DATABASE_URL is required: this context runs on real Postgresno DSNset DATABASE_URL; neither binary needs Kafka variables
Pod CrashLoopBackOff, log ends with a migration or ping error after 5 attemptsPostgres unreachable, wrong DSN, or credentials rejected; first-dial reset of an injected pod outlasted the budget (1+2+4+8 s)kubectl logs --previous; the lines run migrations / ping postgres name the attemptfix the DSN or Postgres; the startup probe allows about 60 s
Migrations hang or fail on a pooled DSNDATABASE_URL points at PgBouncer in transaction mode, which cannot hold golang-migrate's session advisory lockset MIGRATIONS_DATABASE_URL to a direct DSN (chart: Secret key MIGRATIONS_DATABASE_URL)
helm template / helm upgrade failsthe chart refuses to render without database.*, kafka.brokers, config.paymentProviderUrl and the three group ids, refuses *_MODE / *_CONSUMER_GROUP in extraEnv, and a terminationGracePeriodSeconds below the worst-case shutdownthe failure message names the valueset it, or raise the grace period
Process exits after running: <name> stopped unexpectedly: exiting so the orchestrator restarts the servicea worker returned on its own: outbox-relay, policies, checkout, order-sourcing or shipping-and-tracking. The usual cause is a broker still unreachable after 10 consecutive stalled fetchesthe log line just before it (... consumer stopped, outbox relay stopped)restore Kafka; the restart is by design

Readiness and traffic​

SymptomCauseCheckFix
GET /readyz is 503 dependency-unavailable naming postgresthe ping failedkubectl exec and psql "$DATABASE_URL" -c 'select 1'; verdict is cached 3 srestore Postgres / PgBouncer; no restart needed, /healthz stays 200
/readyz is 503 naming kafkano broker answered a topic-less metadata request within 2 sKAFKA_BROKERS value, broker reachability from the podrestore the broker; a topic that does not exist yet never makes /readyz fail
/readyz is 503 {"status":"not_ready"} for a while, then the pod goesdraining after SIGTERMthe log line shutdown: readiness flipped to not-ready; waiting for traffic to drainexpected on rollout
Pod killed (SIGKILL) during rollout, relay or consumers cut offgrace period shorter than drain delay + 10 s HTTP + 4 workers x 10 s + 10 s relayterminationGracePeriodSeconds (chart default 70)the chart refuses a shorter value for the configured SHUTDOWN_DRAIN_DELAY; keep it
Requests slow or 500 with statement timeout in the logsa query ran past the pool's statement_timeout = 5spg_stat_activityfind the slow query; the timeout is not configurable

REST errors​

All errors are RFC 9457 application/problem+json with type /problems/<slug>.

Status / slugCauseFix
400 idempotency-key-requireda POST without Idempotency-Keysend one key per logical request
400 idempotency-key-invalidthe key is not 1 to 128 printable ASCII characterssend a UUID
409 idempotency-key-reusedthe same key with a different request (method, path or body)mint a new key per logical request, or keep the body byte-stable; a correct replay returns the stored answer with Idempotency-Replayed: true. A key whose first answer was a RETRYABLE refusal or a 5xx was released: it is free again and a different body under it is a new request, not a reuse. Distinguish it from the business 409s by the problem type
400 invalid-limit, invalid-cursora limit outside 1 to 500, or a cursor that is not a nextCursor of this listfix the value; repeat the filters with the cursor
400 unknown-query-parametera list was called with a parameter it does not declare, e.g. the retired after, offset or nextTokenuse limit and cursor; read items and follow nextCursor
400 malformed-requestbad JSON, unknown field, wrong typefix the body (see apis/openapi.yaml)
422 validation-failede.g. exactly one of orderId and checkoutSessionId is required on GET /payment-authorizations, or orderId is required on GET /refundssend the missing / exclusive parameter
422 allocation-mismatchallocations do not sum to totalMinor or repeat a groupNofix the allocations
422 unknown-groupa refund or fact names a groupNo the authorization does not havecheck GET /payment-authorizations/{authorizationId}
422 payment-declinedthe provider declined a void (a declined authorization is a stored DECLINED record answered 201; a declined refund is a FAILED refund). Not stored: the key is releasedread detail for the code; the same key asks the provider again, which answers from its own record
404 not-foundunknown authorization or refund id, or POST /refunds for an order with no bound authorization (authorization of order ...: not found)the order is bound by the CheckoutCompleted event; see "Facts stay parked" below
409 duplicate-authorizationtwo concurrent authorize requests for one checkout session raced past the live-session lookup (the database allows one non-DECLINED authorization per session); a sequential repeat returns the existing authorization with 200 insteadread it back with GET /payment-authorizations?checkoutSessionId=
409 order-already-boundthe authorization is bound to a different ordercheck the checkout event that bound it
409 capture-after-expirya capture fact arrived after the hold expiredthe fact is dead-lettered; investigate the shipping delay and refund / re-authorize out of band
409 over-refundrefunds (REQUESTED plus SUCCEEDED) would exceed the captured total of the order or grouplist GET /refunds?orderId= and compare with the captured amounts
409 illegal-transitione.g. voiding an authorization that already has a captured allocation, or retrying a refund that is not FAILEDread the current state
409 concurrent-updateanother writer changed the aggregate between load and save, after the 2 automatic attemptsretry
503 payment-provider-unavailablethe provider timed out (10 s), refused the connection, or answered 429 / 5xxthe counter payments.authorizations.decided{outcome="failed",reason="payment-provider-unavailable"}; check PAYMENT_PROVIDER_URL. Nothing is stored for an authorization; retry with the same Idempotency-Key (the provider key is deterministic)
500 internal-erroran unexpected errorthe access-log line (status 500, request_id) and the surrounding ERROR lines; the trace by trace_id

A decline is not an error: POST /payment-authorizations answers 201 with state: DECLINED and a declineReason, and a later request for the same checkout session creates a fresh attempt (declined attempts do not block the session).

Events are not leaving (outbox)​

SymptomCauseCheckFix
Downstream contexts do not see PaymentAuthorized etc.the relay cannot publish, or a row is cappedSELECT id, event_type, attempts, last_error FROM outbox_events WHERE published_at IS NULL ORDER BY id; and the log line outbox relay pass failedrestore Kafka; the relay drains in id order by itself
One row stays unpublished, attempts equal OUTBOX_MAX_ATTEMPTS, ERROR outbox relay: row reached the attempt cap and is excluded from future claims; re-arm it with attempts = 0 after fixing the causethe row failed 20 times (default); later rows overtake itlast_error of the rowfix the cause, then UPDATE outbox_events SET attempts = 0 WHERE id = <id>;
outbox relay log shows invalid OUTBOX_MAX_ATTEMPTS; using the defaulta negative or non-numeric valuethe value fieldfix the variable; 0 means unlimited

Consumers, dead letters and parked facts​

SymptomCauseCheckFix
ERROR <consumer> handling failed; retrying the same message repeating, then ... failed after the maximum attempts; dead-lettering the messagea transient failure that outlasted 5 attempts (provider outage during a capture, Postgres trouble)partition, offset, error fieldsfix the dependency; inspect and replay <topic>.dlq (see Runbook)
ERROR ... message can never be applied; dead-lettering it without retrya poison payload: invalid event, unknown group, capture after expiry, illegal transition, order already bound to another authorizationthe x-dlq-error header on the .dlq messagethe producer sent a fact that contradicts the stored state; correct it at the source; do not replay unchanged
WARN skipping a message that is not a valid CloudEventa non-CloudEvents message on a consumed topictopic, errornone needed: committed past; fix the publisher
WARN <consumer> broker connection stalled or lost; fetching again after the backoffidle TCP connection dropped (conntrack, sidecar idle timeout)attempt counternone for isolated lines; after 10 consecutive failures the worker returns and the process restarts
A consumer is silentthe producing sibling has not published yet, or the group id changedkafka-consumer-groups lag for the group; the log line consumer running shows group_id and topiccheck the producer first; a new group id replays the whole topic
customer_payments_parked_facts grows; after 24 h ERROR ALERT fact for an unbound order dead-letteredshipped / cancelled / lost / returned facts arrived for an order that no authorization is bound to: CheckoutCompleted has not been consumed (or never carried the authorizationId)SELECT order_id, kind, parked_at FROM parked_facts ORDER BY parked_at;; the checkout consumer's lag; retailnetwork.checkout.eventsfix checkout's publication; parked facts are applied once the order is bound; unbound ones go to retailnetwork.customer-payments.unbound-facts.dlq after 24 h and are purged after 30 days
Brand-new database or group: customer_payments_parked_facts is high right after first starta group with no committed offset starts at the first offset and replays the whole shared topicparked_facts contentexpected; they escalate and are purged by the policy loop

Authorizations that do not behave​

SymptomCauseCheckFix
An authorization went EXPIREDthe provider hold lapsed without a successful re-authorization (the policy runs within 24 h of expires_at), or the re-authorization was declined (PaymentDeclined with reason REAUTH_DECLINED)payment_authorizations.expires_at, reauthorizations; log lines re-authorization skippeda skipped pass retries at every POLICY_INTERVAL; a provider outage longer than the lead time expires the hold
An AUTHORIZED authorization with no order was voided by itselfvoid-unbound-authorizations: no CheckoutCompleted bound it within 24 hPaymentReleased events with reason VOIDEDexpected backstop for abandoned checkouts
Allocations stay PENDING after shippingthe FulfillmentShipped fact has not been applied: order unbound (see parked facts) or the order-sourcing consumer is behindparked_facts, consumer lagas above

Refunds​

SymptomCauseCheckFix
Refund stays REQUESTEDthe provider was unreachable during the request (WARN refund left REQUESTED: payment provider unavailable)refunds.state, created_atnothing: process-requested-refunds retries every POLICY_INTERVAL once the refund is 30 s old
Refund FAILEDthe provider declined it (failureCode)GET /refunds/{refundId} (attempts, failureCode)fix the cause, then POST /refunds/{refundId}/retries with a new Idempotency-Key; at most 5 provider attempts in all
ERROR ALERT refund failed for good: operator action neededthe fifth attempt failed; the RefundFailed event has final: truerefund_id, order_id, code, attemptsthe refund stays FAILED; settle with the provider manually, then request a new MANUAL refund

MCP and A2A​

SymptomCauseFix
MCP tools/call or tools/list answers an error about the sessionStreamable HTTP needs initialize first and the returned Mcp-Session-Id header on later calls, plus Accept: application/json, text/event-streamfollow the order in MCP tools
A2A answers -32009 VERSION_NOT_SUPPORTED (requested "0.3", served "1.0")the client omitted the A2A-Version: 1.0 headersend it, or use an A2A 1.0 SDK
A2A answers -32601 method not foundthe method name is wrong; the server speaks SendMessageuse SendMessage
A2A / MCP answers an empty list for an orderno authorization is bound to that order in this database (a session id is not an order id)query by checkoutSessionId, or check that the agent points at the same DATABASE_URL as cmd/api
The Agent Card advertises the wrong URLA2A_AGENT_URLset it to the URL clients dial (the gateway URL for off-cluster clients)
Routes /api/mcp/... return 404the MCP component is disabled in the fleet's values (helm-values/customer-payments.yaml)enable mcp.enabled and mcp.route.enabled