Skip to main content

Troubleshooting

Symptom, cause, check, fix, from the real failure modes in the code. Variables are in Configuration; procedures in the Runbook; log fields in Observability. Error type URIs are /problems/<slug>.

Boot​

SymptomCauseCheckFix
cmd/api exits 1 at once: DATABASE_URL is required: this context runs on real Postgres, there is no in-memory modeDATABASE_URL unsetthe message names the variable; nothing was opened or boundset it (chart: database.url or database.existingSecret). The chart refuses to render without it
KAFKA_BROKERS is required: this context runs on real Kafka (outbox relay, consumers, /readyz)unset or only blanks/commassameset a comma-separated list (chart: kafka.brokers)
OFFER_AVAILABILITY_CONSUMER_GROUP is required: the consumer always runs on real Kafkagroup id unsetsameset a stable id such as product-content-offer-availability (chart: config.offerAvailabilityConsumerGroup)
cmd/mcp exits 1: DATABASE_URL is required: this context runs on real Postgres, there is no in-memory modeDATABASE_URL unsetcmd/mcp/main.go (buildDeps); nothing was opened or boundset it (chart: database.url or database.existingSecret)
cmd/a2a exits 1: A2A_AGENT_URL is required ... or A2A_AGENT_URL="..." is not an absolute http(s) URLmissing, relative or schemeless URLcmd/a2a/main.go (checkAgentURL); both mandatory problems are reported togetherset an absolute URL such as http://<release>-a2a.<ns>.svc.cluster.local:8093/
Pod stuck before ready, logs retrying ... op=run migrations / ping postgres then service exited with errorPostgres unreachable, wrong DSN, or Istio sidecar not ready; after 5 attempts (1+2+4+8 s) the last error is returnedthe err field of the retrying WARN linesfix the DSN/network. The startup probe allows about 60 s, so a slow sidecar is tolerated, a dead database is not
Boot hangs on run migrationsMIGRATIONS_DATABASE_URL (or DATABASE_URL fallback) goes through a transaction-mode pooler; golang-migrate's session advisory lock cannot be takencompare the migrations DSN with the pooled onepoint MIGRATIONS_DATABASE_URL at a direct, session-mode connection (chart: database.migrationsExistingSecretKey)
helm template / install fails naming a valuethe chart refuses to render without database.*, kafka.brokers, config.offerAvailabilityConsumerGroup, with a grace period shorter than drain + 30 s, or with a *_MODE / *_CONSUMER_GROUP in extraEnvthe failure message names the valueset the value; see Runbook
Log line invalid OUTBOX_RELAY_INTERVAL; using the default (or OUTBOX_MAX_ATTEMPTS, ignoring invalid SHUTDOWN_DRAIN_DELAY)malformed valuethe value and default fieldscorrect the value. A typo never disables the attempt cap

Readiness and liveness​

SymptomCauseCheckFix
GET /readyz returns 503 application/problem+json, type /problems/dependency-unavailable, detail not ready: kafka (or postgres)the broker did not answer a metadata request, or the Postgres ping failed, within 2 sWARN readiness: dependency is not ready with dependency and error; verdicts are cached 3 srestore the dependency. Topics are not checked, only reachability
GET /readyz returns 503 {"status":"not_ready"}the process received SIGTERM and is drainingpod is terminatingnone, expected for SHUTDOWN_DRAIN_DELAY
Pod restarts; last log outbox-relay stopped unexpectedly or offer-availability stopped unexpectedly: exiting so the orchestrator restarts the servicethe relay or the consumer returned on its own; the consumer exits after 10 consecutive transient fetch failures or on a non-transient reader errorkubectl logs --previous for the preceding consumer stopped / outbox relay stopped ERRORfix the broker; the restart is by design. Alert WarehousePodRestarting fires at 2 restarts in 15 min
MCP pod Ready but tool calls failcmd/mcp probes only /healthz (process up), not Postgrescall a tool; look for mcp tool failed with an unexpected errorrestore Postgres
A2A pod Ready but answers failcmd/a2a probes only /healthz (process up), not Postgrescall the agent; look for a2a skill failedrestore Postgres

REST responses​

All errors are RFC 9457 application/problem+json (internal/adapters/inbound/http/errors.go).

Status and typeCauseFix
400 idempotency-key-requireda POST without Idempotency-Keysend a key of 1 to 128 printable ASCII characters, unique per logical request
400 idempotency-key-invalidan Idempotency-Key longer than 128 characters or with a character outside printable ASCIIsend a key of 1 to 128 printable ASCII characters
409 idempotency-key-reusedthe same key with a different method, path or body (the key is global, another route counts)use a new key for a different request; the same key replays the stored first response (header Idempotency-Replayed: true) for 24 h — but only a 2xx or a FINAL refusal is stored (ADR 0009): a RETRYABLE refusal released the key, and a 5xx is never stored
400 malformed-requestinvalid JSON, an unknown field, a wrong type, a body over 64 KiB, or a NUL character in path, query or bodyfix the request
422 unknown-catalog-itemno CatalogItemCreated for this id has been consumed yet (the local catalog_item_view does not know it)check the item exists in the network, that the consumer is running (consumer running log, group lag) and that the event reached retailnetwork.offer-availability.events; retry once it is applied
422 item-discontinuedCatalogItemDiscontinued was consumed for the itemnone: content is neither created nor published for a discontinued item
422 incomplete-contentpublish needs a description, exactly one PRIMARY medium and a category; revising PUBLISHED content must also stay completerevise the draft to satisfy the gate, then publish
422 unknown-categoryprimaryCategoryId (or a parent) is not in the live treeGET /categories; create the category first
422 too-many-bullets / too-many-attributes / too-many-mediamore than 10 bullets, 50 attributes or 12 mediatrim the body
422 validation-faileda field rule: text must be trimmed and non-blank (description up to 4000, bullet up to 300, attribute name 100 / value 300 / unit 20, alt text up to 200 characters), media URL absolute http(s) up to 2048, unique valid mediaId, role PRIMARY or GALLERY, ids of 1 to 64 characters from A-Z a-z 0-9 . _ : -the detail names the field
409 concurrent-updateoptimistic version mismatch (two writers), or a second create for the same itemre-read and retry
409 illegal-transitionfor example /retirements on a DRAFT (use DELETE .../draft), DELETE .../draft on PUBLISHED (use /retirements)check state with GET /product-contents/{id}
409 content-retiredRETIRED is terminal; no revise or publishcreate nothing new for that item; there is no un-retire
404 not-foundno content or category with that idcheck the id
422 category-cycle, max-depth (tree at most 4 levels), duplicate-sibling-name (case-insensitive), unknown-category (unknown parent)category rulesadjust the tree command
500 internal-errorany unmapped error; the detail never leaks the causesearch the log by request_id/trace_id for the ERROR line

Events not flowing​

SymptomCauseCheckFix
publish returns 200 but nothing appears on retailnetwork.product-content.eventsthe relay cannot reach the broker, or the row hit the attempt capSELECT id, event_type, attempts, last_error FROM outbox_events WHERE published_at IS NULL ORDER BY id; and ERROR outbox relay pass failedrestore the broker; rows retry every OUTBOX_RELAY_INTERVAL. Capped rows: fix the cause, then UPDATE outbox_events SET attempts = 0 WHERE id = <id>; (ERROR outbox relay: row reached the attempt cap ... names outbox_id)
A /publications of unchanged PUBLISHED content raises no eventby design: the current revision is already publishedrevision equals publishedRevision/revisions first, or POST /category-tree-publications to re-send the tree
Downstream sees the same event twiceat-least-once delivery after a relay retrysame CloudEvents idde-duplicate on id; the producer republishes the stored id
unknown-catalog-item persists although the item existsthe consumer is not running under the expected group, or the group has no committed offsets and is replayingconsumer running log: group_id, topic; kafka-consumer-groups --describea fresh group starts from the first offset and replays the topic; give it time. Never derive the group from the pod name
Messages in retailnetwork.offer-availability.events.dlqtype known but catalogItemId invalid (poison, dead-lettered at once), or a transient failure persisted for 5 attemptsheaders x-dlq-error, x-dlq-source-*; WARN dead-lettering an event that can never be appliedfix the producer, re-drive per Runbook
Consumer partition seems frozen, ERROR offer-availability dead-letter publish failed; retrying the same message repeatsthe DLQ publish itself fails (broker down or topic not ready); it is retried forever on purposelog error fieldrestore the broker; nothing is dropped
WARN skipping a message that is not a valid CloudEventa producer sent the retired flat envelope or non-JSONerror fieldproducer must send CloudEvents 1.0 structured mode with content-type: application/cloudevents+json
A discontinued item still shows PUBLISHED contentCatalogItemDiscontinued not yet consumedconsumer lagthe RetireOnDiscontinue policy retires PUBLISHED content (reason DISCONTINUED, raises ProductContentRetired) and DRAFT content silently when the event is applied

MCP​

SymptomCauseFix
A tool call answers isError with text not-found: ...no content for that catalogItemId, or the id is over 128 characters or carries a NULcheck GET /product-contents/{id} on the API
A tool call answers isError with text invalid-argument: catalogItemId is requireda blank catalogItemIdsend the id
tools/call of a content write (create, revise, publish, retire, discard) is refused as an unknown toolby design: the MCP surface is read-only, every write is RESTuse the REST route
helm template fails with mcp.extraEnv sets ... or mcp.httpAddr is ...the chart refuses *_MODE, Kafka, outbox, consumer-group and chart-owned names in mcp.extraEnv, and an MCP_ADDR port that differs from mcp.service.targetPortthe message names the value

A2A​

SymptomCauseFix
Clients dial the wrong hostthe Agent Card advertises A2A_AGENT_URLcheck /.well-known/agent-card.json; set a2a.agentUrl to the URL clients can reach
JSON-RPC reply is a normal message containing a problem (unknown-skill, malformed-skill-request, invalid-argument, not-found)skill errors are answered in the message, never as JSON-RPC errorsread the data part: skill must be get_product_content or list_categories; unknown argument names are refused; catalogItemId is required
404 not-found for an item that existsthe agent reads the same database; the id is over 128 characters or the content was never createdcheck GET /product-contents/{id} on the API

Data and capacity​

SymptomCauseFix
idempotency_keys, processed_events, published outbox_events grow without boundno sweeper exists (expired idempotency keys are ignored, not deleted)prune by hand, for example DELETE FROM idempotency_keys WHERE created_at < now() - interval '7 days'; and DELETE FROM outbox_events WHERE published_at < now() - interval '30 days';
Telemetry missingCollector unreachable; export is non-blockingrun with LOG_LEVEL=debug for opentelemetry error; check otel.endpoint
Statements cancelled after 5 sstatement_timeout = 5s on every pooled connection; pool of 10look at Postgres load; the limits are compiled in